schemas
Creates, updates, deletes, gets or lists a schemas resource.
Overview
| Name | schemas |
| Type | Resource |
| Id | confluent.schema_registry.schemas |
Fields
The following fields are returned by SELECT queries:
- get_schema
- get_schemas
The schema string.
| Name | Datatype | Description |
|---|---|---|
maxId | integer (int32) | Maximum ID |
metadata | object | User-defined metadata |
references | array | References to other schemas |
ruleSet | object | Schema rule set |
schema | string | Schema string identified by the ID (example: {"schema": "{"type": "string"}"}) |
schemaTags | array | Schema tags |
schemaType | string | Schema type (example: AVRO) |
List of schemas matching the specified parameters.
| Name | Datatype | Description |
|---|---|---|
id | integer (int32) | 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 (example: {"schema": "{"type": "string"}"}) |
schemaTags | array | Schema tags |
schemaType | string | Schema type (example: AVRO) |
subject | string | Name of the subject (example: User) |
version | integer (int32) | Version number |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_schema | select | id | subject, format | Retrieves the schema string identified by the input ID. |
get_schemas | select | subjectPrefix, aliases, deleted, latestOnly, ruleType, offset, limit | Get the schemas matching the specified parameters. | |
get_schema_only | exec | id | subject, format | Retrieves the schema identified by the input ID. |
get_schema_only_1 | exec | subject, version | deleted | Retrieves the schema for the specified version of this subject. Only the unescaped schema string is returned. |
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 | Name of the subject |
version | string | Version of the schema to be returned. Valid values for versionId are between [1,2^31-1] or the string "latest". "latest" returns the last registered schema under the specified subject. Note that there may be a new latest schema that gets registered right after this request is served. |
aliases | boolean | Whether to include aliases in the search |
deleted | boolean | Whether to include deleted schema |
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.) |
latestOnly | boolean | Whether to return latest schema versions only for each matching subject |
limit | integer (int32) | Pagination size for results. Ignored if negative |
offset | integer (int32) | Pagination offset for results |
ruleType | string | Filters results by the given rule type |
subject | string | Name of the subject |
subjectPrefix | string | Filters results by the respective subject prefix |
SELECT examples
- get_schema
- get_schemas
Retrieves the schema string identified by the input ID.
SELECT
maxId,
metadata,
references,
ruleSet,
schema,
schemaTags,
schemaType
FROM confluent.schema_registry.schemas
WHERE id = '{{ id }}' -- required
AND subject = '{{ subject }}'
AND format = '{{ format }}'
;
Get the schemas matching the specified parameters.
SELECT
id,
metadata,
references,
ruleSet,
schema,
schemaTags,
schemaType,
subject,
version
FROM confluent.schema_registry.schemas
WHERE subjectPrefix = '{{ subjectPrefix }}'
AND aliases = '{{ aliases }}'
AND deleted = '{{ deleted }}'
AND latestOnly = '{{ latestOnly }}'
AND ruleType = '{{ ruleType }}'
AND offset = '{{ offset }}'
AND limit = '{{ limit }}'
;
Lifecycle Methods
- get_schema_only
- get_schema_only_1
Retrieves the schema identified by the input ID.
EXEC confluent.schema_registry.schemas.get_schema_only
@id='{{ id }}' --required,
@subject='{{ subject }}',
@format='{{ format }}'
;
Retrieves the schema for the specified version of this subject. Only the unescaped schema string is returned.
EXEC confluent.schema_registry.schemas.get_schema_only_1
@subject='{{ subject }}' --required,
@version='{{ version }}' --required,
@deleted={{ deleted }}
;