This document shows you how to view the details of a schema registry resource within Managed Service for Apache Kafka. You can view details such as its configuration, associated contexts, and subjects.
Different tools provide varying levels of detail:
- The Google Cloud console displays comprehensive configuration information, including schema mode, compatibility type, and the list of associated subjects and contexts.
- The Google Cloud CLI and the Managed Kafka API display the schema registry's fully qualified name and its associated contexts.
You can't use the open source Apache Kafka client APIs to view these specific Managed Service for Apache Kafka schema registry resource details.
Required roles and permissions
To get the permissions that
you need to view a schema registry,
ask your administrator to grant you the
Managed Kafka Schema Registry Viewer (roles/managedkafka.schemaRegistryViewer
)
IAM role on the schema registry instance.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to view a schema registry. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to view a schema registry:
-
Grant this permission on the schema registry resource:
managedkafka.schemaRegistries.get
You might also be able to get these permissions with custom roles or other predefined roles.
Higher-level roles like Managed Kafka Schema Registry Editor
(roles/managedkafka.schemaRegistryEditor
) and
Managed Kafka Schema Registry Admin
(roles/managedkafka.schemaRegistryAdmin
) also lets you view a schema registry.
For more information about the predefined roles available for Managed Service for Apache Kafka, see the Access control documentation.
View schema registry details
To retrieve the configuration and details of a specific schema registry, follow these steps:
Console
- In the Google Cloud console, go to the Schema registries page.
A list of schema registries in your project is displayed.
- Click the name of the schema registry whose details you want to view.
The Schema registry details page opens. The information displayed on this page is explained in the Schema registry page details section.
gcloud
-
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- To retrieve the configuration and details of a specific schema registry, run the
gcloud beta managed-kafka schema-registries describe
command: - SCHEMA_REGISTRY_ID (required): the ID of the schema registry you want to describe.
- LOCATION (required): the Google Cloud region where the schema registry is located.
gcloud beta managed-kafka schema-registries describe SCHEMA_REGISTRY_ID \ --location=LOCATION \
Replace the following:
For example, the following command gets the details of a schema
registry called gcloud_test
located in the
region us-central1
:
gcloud beta managed-kafka schema-registries describe gcloud_test \ --location=us-central1
The command returns the output similar to the following:
contexts: - projects/testing-311516/locations/us-central1/schemaRegistries/gcloud_test/contexts/. name: projects/testing-311516/locations/us-central1/schemaRegistries/gcloud_test
REST
- To retrieve the details of a specific schema registry instance using the
REST API, make a
GET
request to the following URI: - PROJECT_ID (required): your Google Cloud project ID.
- LOCATION (required): the region where the schema registry exists.
- SCHEMA_REGISTRY_ID (required): the unique ID of the schema registry that you want to view.
GET https://managedkafka.googleapis.com/v1main/projects/PROJECT_ID/locations/LOCATION/schemaRegistries/SCHEMA_REGISTRY_ID Authorization: Bearer $(gcloud auth application-default print-access-token)
Replace the following:
If the request is successful, the API returns a 200 OK
status
code. The response body contains a JSON object representing the details of
the requested schema registry.
For example, the following is a response to a command to get the details of a schema
registry called gcloud_test
located in the region us-central1
:
{ "name": "projects/testing-311516/locations/us-central1/schemaRegistries/gcloud_test", "contexts": [ "projects/testing-311516/locations/us-central1/schemaRegistries/gcloud_test/contexts/default", "projects/testing-311516/locations/us-central1/schemaRegistries/gcloud_test/contexts/." ] }
For more information, see the REST API documentation.
Schema registry page details
When you view a schema registry in the Google Cloud console, the Schema registry details page displays the following information for the selected registry:
- Region: the Google Cloud region where the registry resides.
- Schema registry URL: the endpoint URL for the schema
registry. This is of the format
https://managedkafka.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/schemaRegistries/SCHEMA_REGISTRY_ID
.For example—
https://managedkafka.googleapis.com/v1/projects/managed-kafka-project/locations/us-central1/schemaRegistries/testschemaregistry
- Schema mode: the operational mode that you can set at the schema registry level and the individual subject level. This setting controls whether modifications can be made.
- Compatibility type: the registry-level configuration for
the default compatibility setting enforced for new subjects or schema versions
within this registry (unless overridden at the subject or context level).
Common values include
BACKWARD
,FORWARD
,FULL
, orNONE
. - Subjects in this schema registry: a list of subject names associated with the registry. If a context is available, you can also view the context for each subject.