Skip to main content

subjects

Creates, updates, deletes, gets or lists a subjects resource.

Overview

Namesubjects
TypeResource
Idconfluent.schema_registry.subjects

Fields

The following fields are returned by SELECT queries:

List of subjects matching the specified parameters.

NameDatatypeDescription
subjectstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_subjectsselectidsubject, format, deleted, offset, limitRetrieves all the subjects associated with a particular schema ID.
listselectsubjectPrefix, deleted, deletedOnly, offset, limitRetrieves a list of registered subjects matching specified parameters.
delete_subjectdeletesubjectpermanentDeletes 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.
look_up_schema_under_subjectexecsubjectnormalize, format, deletedCheck 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idinteger (int32)Globally unique identifier of the schema
subjectstringSubject under which the schema will be registered
deletedbooleanWhether to lookup deleted schemas
deletedOnlybooleanWhether to return deleted subjects only
formatstringDesired output format, dependent on schema type. For AVRO schemas, valid values are: " " (default) or "resolved". For PROTOBUF schemas, valid values are: " " (default), "ignore_extensions", or "serialized" (The parameter does not apply to JSON schemas.)
limitinteger (int32)Pagination size for results. Ignored if negative
normalizebooleanWhether to lookup the normalized schema
offsetinteger (int32)Pagination offset for results
permanentbooleanWhether to perform a permanent delete
subjectstringFilters results by the respective subject
subjectPrefixstringSubject name prefix

SELECT examples

Retrieves all the subjects associated with a particular schema ID.

SELECT
subject
FROM confluent.schema_registry.subjects
WHERE id = '{{ id }}' -- required
AND subject = '{{ subject }}'
AND format = '{{ format }}'
AND deleted = '{{ deleted }}'
AND offset = '{{ offset }}'
AND limit = '{{ limit }}'
;

DELETE examples

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.

DELETE FROM confluent.schema_registry.subjects
WHERE subject = '{{ subject }}' --required
AND permanent = '{{ permanent }}'
;

Lifecycle Methods

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.

EXEC confluent.schema_registry.subjects.look_up_schema_under_subject
@subject='{{ subject }}' --required,
@normalize={{ normalize }},
@format='{{ format }}',
@deleted={{ deleted }}
@@json=
'{
"version": {{ version }},
"id": {{ id }},
"schemaType": "{{ schemaType }}",
"references": "{{ references }}",
"schema": "{{ schema }}",
"metadata": "{{ metadata }}",
"ruleSet": "{{ ruleSet }}",
"schemaTagsToAdd": "{{ schemaTagsToAdd }}",
"schemaTagsToRemove": "{{ schemaTagsToRemove }}",
"propagateSchemaTags": {{ propagateSchemaTags }}
}'
;