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.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
ManagedSchemaRegistryClient(ManagedSchemaRegistryClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ManagedSchemaRegistryClient const &
|
ManagedSchemaRegistryClient(ManagedSchemaRegistryClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ManagedSchemaRegistryClient &&
|
ManagedSchemaRegistryClient(std::shared_ptr< ManagedSchemaRegistryConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ManagedSchemaRegistryConnection >
|
opts |
Options
|
Operators
operator=(ManagedSchemaRegistryClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ManagedSchemaRegistryClient const &
|
Returns | |
---|---|
Type | Description |
ManagedSchemaRegistryClient & |
operator=(ManagedSchemaRegistryClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ManagedSchemaRegistryClient &&
|
Returns | |
---|---|
Type | Description |
ManagedSchemaRegistryClient & |
Functions
GetSchemaRegistry(std::string const &, Options)
Get the schema registry instance.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the schema registry instance to return. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaRegistry) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchemaRegistry(google::cloud::managedkafka::schemaregistry::v1::GetSchemaRegistryRequest const &, Options)
Get the schema registry instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetSchemaRegistryRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaRegistry) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaRegistries(std::string const &, Options)
List schema registries.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent whose schema registry instances are to be listed. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::ListSchemaRegistriesResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.ListSchemaRegistriesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaRegistries(google::cloud::managedkafka::schemaregistry::v1::ListSchemaRegistriesRequest const &, Options)
List schema registries.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListSchemaRegistriesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::ListSchemaRegistriesResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.ListSchemaRegistriesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateSchemaRegistry(std::string const &, google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry const &, Options)
Create a schema registry instance.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent whose schema registry instance is to be created. Structured like: |
schema_registry |
google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry const &
Required. The schema registry instance to create. The name field is ignored. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaRegistry) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateSchemaRegistry(google::cloud::managedkafka::schemaregistry::v1::CreateSchemaRegistryRequest const &, Options)
Create a schema registry instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::CreateSchemaRegistryRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaRegistry > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaRegistry) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSchemaRegistry(std::string const &, Options)
Delete a schema registry instance.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the schema registry instance to delete. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteSchemaRegistry(google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaRegistryRequest const &, Options)
Delete a schema registry instance.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaRegistryRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
GetContext(std::string const &, Options)
Get the context.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the context to return. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::Context > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.Context) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetContext(google::cloud::managedkafka::schemaregistry::v1::GetContextRequest const &, Options)
Get the context.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetContextRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::Context > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.Context) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListContexts(std::string const &, Options)
List contexts for a schema registry.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent of the contexts. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListContexts(google::cloud::managedkafka::schemaregistry::v1::ListContextsRequest const &, Options)
List contexts for a schema registry.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListContextsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchema(std::string const &, Options)
Get the schema for the given schema id.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the schema to return. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::Schema > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchema(google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const &, Options)
Get the schema for the given schema id.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::Schema > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetRawSchema(std::string const &, Options)
Get the schema string for the given schema id.
The response will be the schema string.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the schema to return. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetRawSchema(google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const &, Options)
Get the schema string for the given schema id.
The response will be the schema string.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetSchemaRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaVersions(std::string const &, Options)
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}].
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The schema whose schema versions are to be listed. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaVersions(google::cloud::managedkafka::schemaregistry::v1::ListSchemaVersionsRequest const &, Options)
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}].
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListSchemaVersionsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaTypes(std::string const &, Options)
List the supported schema types.
The response will be an array of schema types.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent schema registry whose schema types are to be listed. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSchemaTypes(google::cloud::managedkafka::schemaregistry::v1::ListSchemaTypesRequest const &, Options)
List the supported schema types.
The response will be an array of schema types.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListSchemaTypesRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSubjects(std::string const &, std::string const &, bool, Options)
List subjects in the schema registry.
The response will be an array of subject names.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent schema registry/context whose subjects are to be listed. Structured like: |
subject_prefix |
std::string const &
Optional. The context to filter the subjects by, in the format of |
deleted |
bool
Optional. If true, the response will include soft-deleted subjects. The default is false. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSubjects(google::cloud::managedkafka::schemaregistry::v1::ListSubjectsRequest const &, Options)
List subjects in the schema registry.
The response will be an array of subject names.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListSubjectsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSubjectsBySchemaId(std::string const &, std::string const &, bool, Options)
List subjects which reference a particular schema id.
The response will be an array of subject names.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The schema resource whose associated subjects are to be listed. Structured like: |
subject |
std::string const &
Optional. The subject to filter the subjects by. |
deleted |
bool
Optional. If true, the response will include soft-deleted subjects. The default is false. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListSubjectsBySchemaId(google::cloud::managedkafka::schemaregistry::v1::ListSubjectsBySchemaIdRequest const &, Options)
List subjects which reference a particular schema id.
The response will be an array of subject names.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListSubjectsBySchemaIdRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSubject(std::string const &, Options)
Delete a subject.
The response will be an array of versions of the deleted subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the subject to delete. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSubject(google::cloud::managedkafka::schemaregistry::v1::DeleteSubjectRequest const &, Options)
Delete a subject.
The response will be an array of versions of the deleted subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::DeleteSubjectRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
LookupVersion(std::string const &, std::string const &, Options)
Lookup a schema under the specified subject.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The subject to lookup the schema in. Structured like: |
schema |
std::string const &
Required. The schema payload |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaVersion > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
LookupVersion(google::cloud::managedkafka::schemaregistry::v1::LookupVersionRequest const &, Options)
Lookup a schema under the specified subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::LookupVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaVersion > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetVersion(std::string const &, Options)
Get a versioned schema (schema with subject/version) of a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the subject to return versions. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaVersion > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetVersion(google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const &, Options)
Get a versioned schema (schema with subject/version) of a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaVersion > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaVersion) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetRawSchemaVersion(std::string const &, Options)
Get the schema string only for a version of a subject.
The response will be the schema string.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the subject to return versions. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetRawSchemaVersion(google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const &, Options)
Get the schema string only for a version of a subject.
The response will be the schema string.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListVersions(std::string const &, Options)
Get all versions of a subject.
The response will be an array of versions of the subject.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The subject whose versions are to be listed. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListVersions(google::cloud::managedkafka::schemaregistry::v1::ListVersionsRequest const &, Options)
Get all versions of a subject.
The response will be an array of versions of the subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListVersionsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateVersion(std::string const &, std::int32_t, std::int32_t, google::cloud::managedkafka::schemaregistry::v1::Schema::SchemaType, std::string const &, std::vector< google::cloud::managedkafka::schemaregistry::v1::Schema::SchemaReference > const &, bool, Options)
Register a new version under a given subject with the given schema.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The subject to create the version for. Structured like: |
version |
std::int32_t
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 |
std::int32_t
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 |
google::cloud::managedkafka::schemaregistry::v1::Schema::SchemaType
Optional. The type of the schema. It is optional. If not specified, the schema type will be AVRO. |
schema |
std::string const &
Required. The schema payload |
references |
std::vector< google::cloud::managedkafka::schemaregistry::v1::Schema::SchemaReference > const &
Optional. The schema references used by the schema. |
normalize |
bool
Optional. If true, the schema will be normalized before being stored. The default is false. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::CreateVersionResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.CreateVersionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateVersion(google::cloud::managedkafka::schemaregistry::v1::CreateVersionRequest const &, Options)
Register a new version under a given subject with the given schema.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::CreateVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::CreateVersionResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.CreateVersionResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteVersion(std::string const &, Options)
Delete a version of a subject.
The response will be the deleted version id.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the subject version to delete. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteVersion(google::cloud::managedkafka::schemaregistry::v1::DeleteVersionRequest const &, Options)
Delete a version of a subject.
The response will be the deleted version id.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::DeleteVersionRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListReferencedSchemas(std::string const &, Options)
Get a list of IDs of schemas that reference the schema with the given subject and version.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The version to list referenced by. Structured like: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListReferencedSchemas(google::cloud::managedkafka::schemaregistry::v1::ListReferencedSchemasRequest const &, Options)
Get a list of IDs of schemas that reference the schema with the given subject and version.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::ListReferencedSchemasRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::api::HttpBody > |
the result of the RPC. The response message type (google.api.HttpBody) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CheckCompatibility(std::string const &, std::string const &, Options)
Check compatibility of a schema with all versions or a specific version of a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the resource to check compatibility for. The format is either of following:
|
schema |
std::string const &
Required. The schema payload |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.CheckCompatibilityResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CheckCompatibility(google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityRequest const &, Options)
Check compatibility of a schema with all versions or a specific version of a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::CheckCompatibilityResponse > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.CheckCompatibilityResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchemaConfig(std::string const &, Options)
Get schema config at global level or for a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name to get the config for. It can be either of following:
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchemaConfig(google::cloud::managedkafka::schemaregistry::v1::GetSchemaConfigRequest const &, Options)
Get schema config at global level or for a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetSchemaConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSchemaConfig(std::string const &, google::cloud::managedkafka::schemaregistry::v1::SchemaConfig::CompatibilityType, Options)
Update config at global level or for a subject.
Creates a SchemaSubject-level SchemaConfig if it does not exist.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name to update the config for. It can be either of following:
|
compatibility |
google::cloud::managedkafka::schemaregistry::v1::SchemaConfig::CompatibilityType
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. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSchemaConfig(google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaConfigRequest const &, Options)
Update config at global level or for a subject.
Creates a SchemaSubject-level SchemaConfig if it does not exist.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSchemaConfig(std::string const &, Options)
Delete schema config for a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of subject to delete the config for. The format is
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSchemaConfig(google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaConfigRequest const &, Options)
Delete schema config for a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaConfigRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaConfig > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchemaMode(std::string const &, Options)
Get mode at global level or for a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the mode. The format is
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetSchemaMode(google::cloud::managedkafka::schemaregistry::v1::GetSchemaModeRequest const &, Options)
Get mode at global level or for a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::GetSchemaModeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSchemaMode(std::string const &, google::cloud::managedkafka::schemaregistry::v1::SchemaMode::ModeType, Options)
Update mode at global level or for a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the mode. The format is
|
mode |
google::cloud::managedkafka::schemaregistry::v1::SchemaMode::ModeType
Required. The mode type. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateSchemaMode(google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaModeRequest const &, Options)
Update mode at global level or for a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::UpdateSchemaModeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSchemaMode(std::string const &, Options)
Delete schema mode for a subject.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of subject to delete the mode for. The format is
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteSchemaMode(google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaModeRequest const &, Options)
Delete schema mode for a subject.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::managedkafka::schemaregistry::v1::DeleteSchemaModeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::managedkafka::schemaregistry::v1::SchemaMode > |
the result of the RPC. The response message type (google.cloud.managedkafka.schemaregistry.v1.SchemaMode) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListLocations(google::cloud::location::ListLocationsRequest, Options)
Lists information about the supported locations for this service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::location::ListLocationsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::location::Location > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetLocation(google::cloud::location::GetLocationRequest const &, Options)
Gets information about a location.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::location::GetLocationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::location::Location > |
the result of the RPC. The response message type (google.cloud.location.Location) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListOperations(std::string const &, std::string const &, Options)
Lists operations that match the specified filter in the request.
If the server doesn't support this method, it returns UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation's parent resource. |
filter |
std::string const &
The standard list filter. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::longrunning::Operation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListOperations(google::longrunning::ListOperationsRequest, Options)
Lists operations that match the specified filter in the request.
If the server doesn't support this method, it returns UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::ListOperationsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::longrunning::Operation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetOperation(std::string const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOperation(google::longrunning::GetOperationRequest const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::GetOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteOperation(std::string const &, Options)
Deletes a long-running operation.
This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource to be deleted. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteOperation(google::longrunning::DeleteOperationRequest const &, Options)
Deletes a long-running operation.
This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::DeleteOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CancelOperation(std::string const &, Options)
Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1
, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource to be cancelled. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CancelOperation(google::longrunning::CancelOperationRequest const &, Options)
Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED
. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1
, corresponding to Code.CANCELLED
.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::CancelOperationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |