Index
ManagedSchemaRegistry
(interface)CheckCompatibilityRequest
(message)CheckCompatibilityResponse
(message)Context
(message)CreateSchemaRegistryRequest
(message)CreateVersionRequest
(message)CreateVersionResponse
(message)DeleteSchemaConfigRequest
(message)DeleteSchemaModeRequest
(message)DeleteSchemaRegistryRequest
(message)DeleteSubjectRequest
(message)DeleteVersionRequest
(message)GetContextRequest
(message)GetSchemaConfigRequest
(message)GetSchemaModeRequest
(message)GetSchemaRegistryRequest
(message)GetSchemaRequest
(message)GetVersionRequest
(message)ListContextsRequest
(message)ListReferencedSchemasRequest
(message)ListSchemaRegistriesRequest
(message)ListSchemaRegistriesResponse
(message)ListSchemaTypesRequest
(message)ListSchemaVersionsRequest
(message)ListSubjectsBySchemaIdRequest
(message)ListSubjectsRequest
(message)ListVersionsRequest
(message)LookupVersionRequest
(message)Schema
(message)Schema.SchemaReference
(message)Schema.SchemaType
(enum)SchemaConfig
(message)SchemaConfig.CompatibilityType
(enum)SchemaMode
(message)SchemaMode.ModeType
(enum)SchemaRegistry
(message)SchemaVersion
(message)UpdateSchemaConfigRequest
(message)UpdateSchemaModeRequest
(message)
ManagedSchemaRegistry
SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:
- SchemaRegistry
- SchemaRegistry/Context
- SchemaRegistry/Context/Schema
- SchemaRegistry/Context/Subject
- SchemaRegistry/Context/Subject/Version
- SchemaRegistry/Config
- SchemaRegistry/Mode
SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.
Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a 'default' context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the 'default' context.
Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.
Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.
Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.
Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.
Mode represents the mode of a schema registry or a specific subject. Three modes are supported: * READONLY: The schema registry is in read-only mode, no write operations allowed.. * READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema. * IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.
CheckCompatibility |
---|
Check compatibility of a schema with all versions or a specific version of a subject.
|
CreateSchemaRegistry |
---|
Create a schema registry instance.
|
CreateVersion |
---|
Register a new version under a given subject with the given schema.
|
DeleteSchemaConfig |
---|
Delete schema config for a subject.
|
DeleteSchemaMode |
---|
Delete schema mode for a subject.
|
DeleteSchemaRegistry |
---|
Delete a schema registry instance.
|
DeleteSubject |
---|
Delete a subject. The response will be an array of versions of the deleted subject.
|
DeleteVersion |
---|
Delete a version of a subject. The response will be the deleted version id.
|
GetContext |
---|
Get the context.
|
GetRawSchema |
---|
Get the schema string for the given schema id. The response will be the schema string.
|
GetRawSchemaVersion |
---|
Get the schema string only for a version of a subject. The response will be the schema string.
|
GetSchema |
---|
Get the schema for the given schema id.
|
GetSchemaConfig |
---|
Get schema config at global level or for a subject.
|
GetSchemaMode |
---|
Get mode at global level or for a subject.
|
GetSchemaRegistry |
---|
Get the schema registry instance.
|
GetVersion |
---|
Get a versioned schema (schema with subject/version) of a subject.
|
ListContexts |
---|
List contexts for a schema registry.
|
ListReferencedSchemas |
---|
Get a list of IDs of schemas that reference the schema with the given subject and version.
|
ListSchemaRegistries |
---|
List schema registries.
|
ListSchemaTypes |
---|
List the supported schema types. The response will be an array of schema types.
|
ListSchemaVersions |
---|
List the schema versions for the given schema id. The response will be an array of subject-version pairs as: [{"subject":"subject1", "version":1}, {"subject":"subject2", "version":2}].
|
ListSubjects |
---|
List subjects in the schema registry. The response will be an array of subject names.
|
ListSubjectsBySchemaId |
---|
List subjects which reference a particular schema id. The response will be an array of subject names.
|
ListVersions |
---|
Get all versions of a subject. The response will be an array of versions of the subject.
|
LookupVersion |
---|
Lookup a schema under the specified subject.
|
UpdateSchemaConfig |
---|
Update config at global level or for a subject. Creates a SchemaSubject-level SchemaConfig if it does not exist.
|
UpdateSchemaMode |
---|
Update mode at global level or for a subject.
|
CheckCompatibilityRequest
Request for CheckCompatibility.
Fields | |
---|---|
name |
Required. The name of the resource to check compatibility for. The format is either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/*/versions: Check compatibility with one or more versions of the specified subject. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/{subject}/versions/{version}: Check compatibility with a specific version of the subject. |
schema |
Required. The schema payload |
references[] |
Optional. The schema references used by the schema. |
schema_type |
Optional. The schema type of the schema. |
verbose |
Optional. If true, the response will contain the compatibility check result with reasons for failed checks. The default is false. |
CheckCompatibilityResponse
Response for CheckCompatibility.
Fields | |
---|---|
is_compatible |
The compatibility check result. If true, the schema is compatible with the resource. |
messages[] |
Failure reasons if verbose = true. |
Context
Context represents an independent schema grouping in a schema registry instance.
Fields | |
---|---|
name |
Identifier. The name of the context. Structured like: |
subjects[] |
Optional. The subjects of the context. |
CreateSchemaRegistryRequest
Request to create a schema registry instance.
Fields | |
---|---|
parent |
Required. The parent whose schema registry instance is to be created. Structured like: |
schema_registry_id |
Required. The schema registry instance ID to use for this schema registry. The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores (-). The maximum length is 63 characters. The ID must not start with a number. |
schema_registry |
Required. The schema registry instance to create. The name field is ignored. |
CreateVersionRequest
Request for CreateVersion.
Fields | |
---|---|
parent |
Required. The subject to create the version for. Structured like: |
schema |
Required. The schema payload |
references[] |
Optional. The schema references used by the schema. |
version |
Optional. The version to create. It is optional. If not specified, the version will be created with the max version ID of the subject increased by 1. If the version ID is specified, it will be used as the new version ID and must not be used by an existing version of the subject. |
id |
Optional. The schema ID of the schema. If not specified, the schema ID will be generated by the server. If the schema ID is specified, it must not be used by an existing schema that is different from the schema to be created. |
schema_type |
Optional. The type of the schema. It is optional. If not specified, the schema type will be AVRO. |
normalize |
Optional. If true, the schema will be normalized before being stored. The default is false. |
CreateVersionResponse
Response for CreateVersion.
Fields | |
---|---|
id |
The unique identifier of the schema created. |
DeleteSchemaConfigRequest
Request for deleting schema config.
Fields | |
---|---|
name |
Required. The resource name of subject to delete the config for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject} |
DeleteSchemaModeRequest
Request for deleting schema mode.
Fields | |
---|---|
name |
Required. The resource name of subject to delete the mode for. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject} * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject} |
DeleteSchemaRegistryRequest
Request for DeleteSchemaRegistry.
Fields | |
---|---|
name |
Required. The name of the schema registry instance to delete. Structured like: |
DeleteSubjectRequest
Request for DeleteSubject.
Fields | |
---|---|
name |
Required. The name of the subject to delete. Structured like: |
permanent |
Optional. If true, the subject and all associated metadata including the schema ID will be deleted permanently. Otherwise, only the subject is soft-deleted. The default is false. Soft-deleted subjects can still be searched in ListSubjects API call with deleted=true query parameter. A soft-delete of a subject must be performed before a hard-delete. |
DeleteVersionRequest
Request for DeleteVersion.
Fields | |
---|---|
name |
Required. The name of the subject version to delete. Structured like: |
permanent |
Optional. If true, both the version and the referenced schema ID will be permanently deleted. The default is false. If false, the version will be deleted but the schema ID will be retained. Soft-deleted versions can still be searched in ListVersions API call with deleted=true query parameter. A soft-delete of a version must be performed before a hard-delete. |
GetContextRequest
Request for GetContext
Fields | |
---|---|
name |
Required. The name of the context to return. Structured like: |
GetSchemaConfigRequest
Request for getting config.
Fields | |
---|---|
name |
Required. The resource name to get the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Get config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Get config for a specific subject. |
default_to_global |
Optional. If true, the config will fall back to the config at the global level if no subject level config is found. |
GetSchemaModeRequest
Request for getting schema registry or subject mode.
Fields | |
---|---|
name |
Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context |
GetSchemaRegistryRequest
Request for GetSchemaRegistry.
Fields | |
---|---|
name |
Required. The name of the schema registry instance to return. Structured like: |
GetSchemaRequest
Request for GetSchema.
Fields | |
---|---|
name |
Required. The name of the schema to return. Structured like: |
subject |
Optional. Used to limit the search for the schema ID to a specific subject, otherwise the schema ID will be searched for in all subjects in the given specified context. |
GetVersionRequest
Request for GetVersion.
Fields | |
---|---|
name |
Required. The name of the subject to return versions. Structured like: |
deleted |
Optional. If true, no matter if the subject/version is soft-deleted or not, it returns the version details. If false, it returns NOT_FOUND error if the subject/version is soft-deleted. The default is false. |
ListContextsRequest
Request for ListContexts.
Fields | |
---|---|
parent |
Required. The parent of the contexts. Structured like: |
ListReferencedSchemasRequest
Request for ListReferencedSchemas.
Fields | |
---|---|
parent |
Required. The version to list referenced by. Structured like: |
ListSchemaRegistriesRequest
Request for ListSchemaRegistries.
Fields | |
---|---|
parent |
Required. The parent whose schema registry instances are to be listed. Structured like: |
ListSchemaRegistriesResponse
Request for ListSchemaRegistries.
Fields | |
---|---|
schema_registries[] |
The schema registry instances. |
ListSchemaTypesRequest
Request for ListSchemaTypes.
Fields | |
---|---|
parent |
Required. The parent schema registry whose schema types are to be listed. Structured like: |
ListSchemaVersionsRequest
Request for ListSchemaVersions.
Fields | |
---|---|
parent |
Required. The schema whose schema versions are to be listed. Structured like: |
subject |
Optional. The subject to filter the subjects by. |
deleted |
Optional. If true, the response will include soft-deleted versions of the schema, even if the subject is soft-deleted. The default is false. |
ListSubjectsBySchemaIdRequest
Request for listing subjects.
Fields | |
---|---|
parent |
Required. The schema resource whose associated subjects are to be listed. Structured like: |
subject |
Optional. The subject to filter the subjects by. |
deleted |
Optional. If true, the response will include soft-deleted subjects. The default is false. |
ListSubjectsRequest
Request for listing subjects.
Fields | |
---|---|
parent |
Required. The parent schema registry/context whose subjects are to be listed. Structured like: |
subject_prefix |
Optional. The context to filter the subjects by, in the format of |
deleted |
Optional. If true, the response will include soft-deleted subjects. The default is false. |
ListVersionsRequest
Request for GetVersions.
Fields | |
---|---|
parent |
Required. The subject whose versions are to be listed. Structured like: |
deleted |
Optional. If true, the response will include soft-deleted versions of an active or soft-deleted subject. The default is false. |
LookupVersionRequest
Request for LookupVersion.
Fields | |
---|---|
parent |
Required. The subject to lookup the schema in. Structured like: |
schema |
Required. The schema payload |
references[] |
Optional. The schema references used by the schema. |
schema_type |
Optional. The schema type of the schema. |
normalize |
Optional. If true, the schema will be normalized before being looked up. The default is false. |
deleted |
Optional. If true, soft-deleted versions will be included in lookup, no matter if the subject is active or soft-deleted. If false, soft-deleted versions will be excluded. The default is false. |
Schema
Schema for a Kafka message.
Fields | |
---|---|
schema_type |
Optional. The schema type of the schema. |
schema_payload |
The schema payload. |
references[] |
Optional. The schema references used by the schema. |
SchemaReference
SchemaReference is a reference to a schema.
Fields | |
---|---|
name |
Required. The name of the reference. |
subject |
Required. The subject of the reference. |
version |
Required. The version of the reference. |
SchemaType
Schema types.
Enums | |
---|---|
SCHEMA_TYPE_UNSPECIFIED |
No schema type. The default will be AVRO. |
AVRO |
Avro schema type. |
JSON |
JSON schema type. |
PROTOBUF |
Protobuf schema type. |
SchemaConfig
SchemaConfig represents configuration for a schema registry or a specific subject.
Fields | |
---|---|
alias |
Optional. The subject to which this subject is an alias of. Only applicable for subject config. |
compatibility |
Required. The compatibility type of the schema. The default value is BACKWARD. If unset in a SchemaSubject-level SchemaConfig, defaults to the global value. If unset in a SchemaRegistry-level SchemaConfig, reverts to the default value. |
normalize |
Optional. If true, the schema will be normalized before being stored or looked up. The default is false. If unset in a SchemaSubject-level SchemaConfig, the global value will be used. If unset in a SchemaRegistry-level SchemaConfig, reverts to the default value. |
CompatibilityType
Compatibility type of the schemas.
Enums | |
---|---|
NONE |
No compatibility check. |
BACKWARD |
Backwards compatible with the most recent version. |
BACKWARD_TRANSITIVE |
Backwards compatible with all previous versions. |
FORWARD |
Forwards compatible with the most recent version. |
FORWARD_TRANSITIVE |
Forwards compatible with all previous versions. |
FULL |
Backwards and forwards compatible with the most recent version. |
FULL_TRANSITIVE |
Backwards and forwards compatible with all previous versions. |
SchemaMode
SchemaMode represents the mode of a schema registry or a specific subject. Four modes are supported: * NONE: This is the default mode for a subject and essentially means that the subject does not have any mode set. This means the subject will follow the schema registry's mode. * READONLY: The schema registry is in read-only mode. * READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema. * IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.
Fields | |
---|---|
mode |
Required. The mode type of a schema registry (READWRITE by default) or of a subject (NONE by default, which means use the global schema registry setting). |
ModeType
Mode type of the schemas or subjects.
Enums | |
---|---|
NONE |
No mode. |
READONLY |
READONLY mode. |
READWRITE |
READWRITE mode. |
IMPORT |
IMPORT mode. |
SchemaRegistry
SchemaRegistry is a schema registry instance.
Fields | |
---|---|
name |
Identifier. The name of the schema registry instance. Structured like: |
contexts[] |
Output only. The contexts of the schema registry instance. |
SchemaVersion
Version of a schema.
Fields | |
---|---|
subject |
Required. The subject of the version. |
version_id |
Required. The version ID |
schema_id |
Required. The schema ID. |
schema_type |
Optional. The schema type of the schema. |
schema_payload |
Required. The schema payload. |
references[] |
Optional. The schema references used by the schema. |
UpdateSchemaConfigRequest
Request for updating schema config. On a SchemaSubject-level SchemaConfig, an unset field will be removed from the SchemaConfig.
Fields | |
---|---|
name |
Required. The resource name to update the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Update config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Update config for a specific subject. |
compatibility |
Required. The compatibility type of the schemas. Cannot be unset for a SchemaRegistry-level SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the compatibility field for the SchemaConfig. |
normalize |
Optional. If true, the schema will be normalized before being stored or looked up. The default is false. Cannot be unset for a SchemaRegistry-level SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the normalize field for the SchemaConfig. |
UpdateSchemaModeRequest
Request for updating schema registry or subject mode.
Fields | |
---|---|
name |
Required. The resource name of the mode. The format is * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context |
mode |
Required. The mode type. |