confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Add `SchemaRegistryClient` methods for all schema/subject REST endpoints

Open th0ger opened this issue 3 years ago • 4 comments

When using the SchemaRegistryClient class, we find that its methods for working with schemas and subjects are not consistently covering the Schema Registry REST API.

Below are listed all the Schemas and Subjects REST endpoints, together with the Python methods that uses them:

REST API endpoints SchemaRegistryClient methods
Schemas: - -
GET /schemas/types get_schema_types() (PROPOSED)
GET /schemas/ids/{id} get_schema(schema_id)
GET /schemas/ids/{id}/versions get_schema_versions(schema_id) (PROPOSED)
Subjects: - -
GET /subjects get_subjects()
POST /subjects/{subject} (query) lookup_schema(subject_name, schema, ...)
DELETE /subjects/{subject} delete_subject(subject_name, permanent)
POST /subjects/{subject}/versions (create) register_schema(subject_name, schema, ...)
GET /subjects/{subject}/versions get_versions(subject_name)
GET /subjects/{subject}/versions/{version} get_version(subject_name, version) get_latest_version(subject_name)
DELETE /subjects/{subject}/versions/{version} delete_version(subject_name, version)
GET /subjects/{subject}/versions/{version}/schema get_schema_by_subject_version(subject_name, version) (PROPOSED)
GET /subjects/{subject}/versions/{version}/referencedby get_referencedby(subject_name, version) (PROPOSED)

I would recommend we implement the PROPOSED entries. Any preferred naming conventions for method names?

Note: The Mode/Compatibility/Config/Exporters endpoints are not scoped in this proposal.

EDIT: Sorted table on endpoint; Map lookup_schema correctly. Added PROPOSED methods.

th0ger avatar Sep 19 '22 08:09 th0ger

yep, it would be good to have full coverage.

note that these methods were not implemented in order to limit scope, in order to get the feature out. we will have bandwidth to review a PR fairly quickly if it doesn't require much time (is high quality, doesn't involve design issues that require thought). otherwise just warning that it might sit there for a bit.

mhowlett avatar Sep 21 '22 14:09 mhowlett

Great @mhowlett, I will give it a go!

th0ger avatar Sep 21 '22 22:09 th0ger

Ping @mhowlett

th0ger avatar Oct 11 '22 06:10 th0ger

thanks! noted.

mhowlett avatar Oct 24 '22 17:10 mhowlett