azure.schemaregistry package¶
-
class
azure.schemaregistry.
ApiVersion
(value)[source]¶ Represents the Schema Registry API version to use for requests.
-
V2021_10
= '2021-10'¶ This is the default version.
-
-
class
azure.schemaregistry.
Schema
(**kwargs: Any)[source]¶ The schema content of a schema, along with id and meta properties.
- Variables
definition (str) – The content of the schema.
properties (SchemaProperties) – The properties of the schema.
-
class
azure.schemaregistry.
SchemaFormat
(value)[source]¶ Represents the format of the schema to be stored by the Schema Registry service.
-
AVRO
= 'Avro'¶ Represents the Apache Avro schema format.
-
-
class
azure.schemaregistry.
SchemaProperties
(**kwargs: Any)[source]¶ Meta properties of a schema.
- Variables
id (str) – References specific schema in registry namespace.
format (SchemaFormat) – Format for the schema being stored.
-
class
azure.schemaregistry.
SchemaRegistryClient
(fully_qualified_namespace: str, credential: TokenCredential, **kwargs: Any)[source]¶ SchemaRegistryClient is a client for registering and retrieving schemas from the Azure Schema Registry service.
- Parameters
fully_qualified_namespace (str) – The Schema Registry service fully qualified host name. For example: my-namespace.servicebus.windows.net.
credential (TokenCredential) – To authenticate managing the entities of the SchemaRegistry namespace.
- Keyword Arguments
api_version (str) – The Schema Registry service API version to use for requests. Default value and only accepted value currently is “2021-10”.
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
- Raises
Example:
-
get_schema_properties
(group_name: str, name: str, definition: str, format: str, **kwargs: Any) → azure.schemaregistry._common._schema.SchemaProperties[source]¶ Gets the schema properties corresponding to an existing schema within the specified schema group, as matched by schema definition comparison.
- Parameters
group_name (str) – Schema group under which schema should be registered.
name (str) – Name of schema being registered.
definition (str) – String representation of the schema being registered.
format (Union[str, SchemaFormat]) – Format for the schema being registered.
- Return type
- Raises
Example:
-
register_schema
(group_name: str, name: str, definition: str, format: 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
group_name (str) – Schema group under which schema should be registered.
name (str) – Name of schema being registered.
definition (str) – String representation of the schema being registered.
format (Union[str, SchemaFormat]) – Format for the schema being registered. For now Avro is the only supported schema format by the service.
- Return type
- Raises
Example: