subjects
Creates, updates, deletes, gets or lists a subjects
resource.
Overview
Name | subjects |
Type | Resource |
Id | confluent.schema_registry.subjects |
Fields
Name | Datatype | Description |
---|---|---|
id | integer | Globally unique identifier of the schema |
metadata | object | User-defined metadata |
references | array | References to other schemas |
ruleSet | object | Schema rule set |
schema | string | Schema definition string |
schemaType | string | Schema type |
subject | string | Name of the subject |
version | integer | Version number |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_schema_by_version | SELECT | subject, version | Retrieves a specific version of the schema registered under this subject. |
list | SELECT |
| Retrieves a list of registered subjects matching specified parameters. |
delete_schema_version | DELETE | subject, version | Deletes a specific version of the schema registered under this subject. This only deletes the version and the schema ID remains intact making it still possible to decode data using the schema ID. This API is recommended to be used only in development environments or under extreme circumstances where-in, its required to delete a previously registered schema for compatibility purposes or re-register previously registered schema. |
delete_subject | DELETE | subject | Deletes the specified subject and its associated compatibility level if registered. It is recommended to use this API only when a topic needs to be recycled or in development environment. |
get_referenced_by | EXEC | subject, version | Retrieves the IDs of schemas that reference the specified schema. |
get_schema_only_1 | EXEC | subject, version | Retrieves the schema for the specified version of this subject. Only the unescaped schema string is returned. |
look_up_schema_under_subject | EXEC | subject | Check if a schema has already been registered under the specified subject. If so, this returns the schema string along with its globally unique identifier, its version under this subject and the subject name. |
register | EXEC | subject | Register a new schema under the specified subject. If successfully registered, this returns the unique identifier of this schema in the registry. The returned identifier should be used to retrieve this schema from the schemas resource and is different from the schema's version which is associated with the subject. If the same schema is registered under a different subject, the same identifier will be returned. However, the version of the schema may be different under different subjects. A schema should be compatible with the previously registered schema or schemas (if there are any) as per the configured compatibility level. The configured compatibility level can be obtained by issuing a GET http:get:: /config/(string: subject). If that returns null, then GET http:get:: /config When there are multiple instances of Schema Registry running in the same cluster, the schema registration request will be forwarded to one of the instances designated as the primary. If the primary is not available, the client will get an error code indicating that the forwarding has failed. |
SELECT
examples
Retrieves a list of registered subjects matching specified parameters.
SELECT
id,
metadata,
references,
ruleSet,
schema,
schemaType,
subject,
version
FROM confluent.schema_registry.subjects
;
DELETE
example
Deletes the specified subjects
resource.
/*+ delete */
DELETE FROM confluent.schema_registry.subjects
WHERE subject = '{{ subject }}';