subjects
Creates, updates, deletes, gets or lists a subjects resource.
Overview
| Name | subjects |
| Type | Resource |
| Id | confluent.schema_registry.subjects |
Fields
The following fields are returned by SELECT queries:
- get_subjects
- list
List of subjects matching the specified parameters.
| Name | Datatype | Description |
|---|---|---|
subject | string |
List of subjects matching the specified parameters.
| Name | Datatype | Description |
|---|---|---|
item | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_subjects | select | id | subject, format, deleted, offset, limit | Retrieves all the subjects associated with a particular schema ID. |
list | select | subjectPrefix, deleted, deletedOnly, offset, limit | Retrieves a list of registered subjects matching specified parameters. | |
delete_subject | delete | subject | permanent | 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. |
look_up_schema_under_subject | exec | subject | normalize, format, deleted | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
id | integer (int32) | Globally unique identifier of the schema |
subject | string | Subject under which the schema will be registered |
deleted | boolean | Whether to lookup deleted schemas |
deletedOnly | boolean | Whether to return deleted subjects only |
format | string | Desired 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.) |
limit | integer (int32) | Pagination size for results. Ignored if negative |
normalize | boolean | Whether to lookup the normalized schema |
offset | integer (int32) | Pagination offset for results |
permanent | boolean | Whether to perform a permanent delete |
subject | string | Filters results by the respective subject |
subjectPrefix | string | Subject name prefix |
SELECT examples
- get_subjects
- list
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 }}'
;
Retrieves a list of registered subjects matching specified parameters.
SELECT
item
FROM confluent.schema_registry.subjects
WHERE subjectPrefix = '{{ subjectPrefix }}'
AND deleted = '{{ deleted }}'
AND deletedOnly = '{{ deletedOnly }}'
AND offset = '{{ offset }}'
AND limit = '{{ limit }}'
;
DELETE examples
- 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.
DELETE FROM confluent.schema_registry.subjects
WHERE subject = '{{ subject }}' --required
AND permanent = '{{ permanent }}'
;
Lifecycle Methods
- look_up_schema_under_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.
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 }}
}'
;