azure.schemaregistry package

class azure.schemaregistry.SchemaRegistryClient(endpoint: str, credential: TokenCredential, **kwargs: Any)[source]

SchemaRegistryClient is as a central schema repository for enterprise-level data infrastructure, complete with support for versioning and management.

Parameters
  • endpoint (str) – The Schema Registry service endpoint, for example my-namespace.servicebus.windows.net.

  • credential (TokenCredential) – To authenticate to manage the entities of the SchemaRegistry namespace.

Example:

close()None[source]

This method is to close the sockets opened by the client. It need not be used when using with a context manager.

get_schema(schema_id: str, **kwargs: Any) → azure.schemaregistry._common._schema.Schema[source]

Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique within a namespace.

Parameters

schema_id (str) – References specific schema in registry namespace.

Return type

Schema

Example:

get_schema_id(schema_group: str, schema_name: str, serialization_type: str, schema_content: str, **kwargs: Any) → azure.schemaregistry._common._schema.SchemaProperties[source]

Gets the ID referencing an existing schema within the specified schema group, as matched by schema content comparison.

Parameters
  • schema_group (str) – Schema group under which schema should be registered.

  • schema_name (str) – Name of schema being registered.

  • serialization_type (Union[str, SerializationType]) – Serialization type for the schema being registered. The

  • schema_content (str) – String representation of the schema being registered.

Return type

SchemaProperties

Example:

register_schema(schema_group: str, schema_name: str, serialization_type: str, schema_content: str, **kwargs: Any) → azure.schemaregistry._common._schema.SchemaProperties[source]

Register new schema. If schema of specified name does not exist in specified group, schema is created at version 1. If schema of specified name exists already in specified group, schema is created at latest version + 1.

Parameters
  • schema_group (str) – Schema group under which schema should be registered.

  • schema_name (str) – Name of schema being registered.

  • serialization_type (Union[str, SerializationType]) – Serialization type for the schema being registered. For now Avro is the only supported serialization type by the service.

  • schema_content (str) – String representation of the schema being registered.

Return type

SchemaProperties

Example:

class azure.schemaregistry.SerializationType[source]

An enumeration.

AVRO = 'avro'
class azure.schemaregistry.Schema(schema_content: str, schema_properties: azure.schemaregistry._common._schema.SchemaProperties)[source]

The schema content of a schema, along with id and meta properties.

Variables
  • schema_content – The content of the schema.

  • schema_properties – The properties of the schema.

Example:

class azure.schemaregistry.SchemaProperties(schema_id: Optional[str] = None, **kwargs: Any)[source]

Meta properties of a schema.

Variables
  • schema_id – References specific schema in registry namespace.

  • location – URL location of schema, identified by schema group, schema name, and version.

  • location_by_id – URL location of schema, identified by schema ID.

  • serialization_type – Serialization type for the schema being stored.

  • version – Version of the returned schema.

Example: