-
Notifications
You must be signed in to change notification settings - Fork 23
REST documentation
REST APIs for Pravega Schema Registry.
License: Apache 2.0
List all groups within the namespace. If namespace is not specified, All groups in default namespace are listed.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| namespace | query | Namespace in which to look up groups | No | string |
| continuationToken | query | Continuation token | No | string |
| limit | query | The numbers of items to return | No | integer |
| Code | Description | Schema |
|---|---|---|
| 200 | List of all groups | ListGroupsResponse |
| 500 | Internal server error while fetching the list of Groups |
Create a new Group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| namespace | query | Namespace in which to create group | No | string |
| CreateGroupRequest | body | The Group configuration | Yes | object |
| Code | Description |
|---|---|
| 201 | Successfully added group |
| 409 | Group with given name already exists |
| 500 | Internal server error while creating a Group |
Fetch the properties of an existing Group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description | Schema |
|---|---|---|
| 200 | Found Group properties | GroupProperties |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching Group details |
Delete a Group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description |
|---|---|
| 204 | Successfully deleted the Group |
| 500 | Internal server error while deleting the Group |
Fetch the history of schema evolution of a Group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description | Schema |
|---|---|---|
| 200 | Found Group history | GroupHistory |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching Group history |
update schema compatibility of an existing Group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| UpdateCompatibilityRequest | body | update group policy | Yes | object |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description |
|---|---|
| 200 | Updated schema compatibility policy |
| 404 | Group with given name not found |
| 409 | Write conflict |
| 500 | Internal server error while updating Group's schema compatibility |
Fetch latest schema versions for all objects identified by SchemaInfo#type under a Group. If query param type is specified then latest schema for the type is returned.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| type | query | Type of object | No | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description | Schema |
|---|---|---|
| 200 | Latest schemas for all objects identified by SchemaInfo#type under the group | SchemaVersionsList |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching Group's latest schemas |
Adds a new schema to the group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| type | query | Type of object | No | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| schemaInfo | body | Add new schema to group | Yes | SchemaInfo |
| Code | Description | Schema |
|---|---|---|
| 201 | Successfully added schema to the group | VersionInfo |
| 404 | Group not found | |
| 409 | Incompatible schema | |
| 417 | Invalid serialization format | |
| 500 | Internal server error while adding schema to group |
Get all schema versions for the group
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| type | query | Type of object the schema describes. | No | string |
| Code | Description | Schema |
|---|---|---|
| 200 | Versioned history of schemas registered under the group | SchemaVersionsList |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching Group schema versions |
Get the version for the schema if it is registered. It does not automatically register the schema. To add new schema use addSchema
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| schemaInfo | body | Get schema corresponding to the version | Yes | SchemaInfo |
| Code | Description | Schema |
|---|---|---|
| 200 | Schema version | VersionInfo |
| 404 | Group with given name not found | |
| 500 | Internal server error fetching version for schema |
Get schema from the schema id that uniquely identifies the schema in the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| schemaId | path | Schema Id | Yes | integer |
| Code | Description | Schema |
|---|---|---|
| 200 | Schema corresponding to the version | SchemaInfo |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching schema from version |
Delete schema identified by version from the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| schemaId | path | Schema Id | Yes | integer |
| Code | Description |
|---|---|
| 204 | Schema corresponding to the version |
| 404 | Group with given name not found |
| 500 | Internal server error while deleting schema from group |
Get schema from the version number that uniquely identifies the schema in the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| type | path | Schema type from SchemaInfo#type or VersionInfo#type | Yes | string |
| version | path | Version number | Yes | integer |
| Code | Description | Schema |
|---|---|---|
| 200 | Schema corresponding to the version | SchemaInfo |
| 404 | Group with given name not found | |
| 500 | Internal server error while fetching schema from version |
Delete schema version from the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| type | path | Schema type from SchemaInfo#type or VersionInfo#type | Yes | string |
| version | path | Version number | Yes | integer |
| Code | Description |
|---|---|
| 204 | Schema corresponding to the version |
| 404 | Group with given name not found |
| 500 | Internal server error while deleting schema from group |
Checks if given schema is compatible with schemas in the registry for current policy setting.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| ValidateRequest | body | Checks if schema is valid with respect to supplied compatibility | Yes | object |
| Code | Description | Schema |
|---|---|---|
| 200 | Schema validation response | Valid |
| 404 | Group with given name not found | |
| 500 | Internal server error while trying to validate schema |
Checks if given schema can be used for reads subject to compatibility policy in the schema compatibility.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| schemaInfo | body | Checks if schema can be used to read the data in the stream based on compatibility policy. | Yes | SchemaInfo |
| Code | Description | Schema |
|---|---|---|
| 200 | Response to tell whether schema can be used to read existing schemas | CanRead |
| 404 | Group with given name not found | |
| 500 | Internal server error while checking schema for readability |
Get an encoding id that uniquely identifies a schema version and codec type pair.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| GetEncodingIdRequest | body | Get schema corresponding to the version | Yes | object |
| Code | Description | Schema |
|---|---|---|
| 200 | Found Encoding | EncodingId |
| 404 | Group with given name or version not found | |
| 412 | Codec type not registered | |
| 500 | Internal server error while getting encoding id |
Get the encoding information corresponding to the encoding id.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| encodingId | path | Encoding id that identifies a unique combination of schema and codec type | Yes | integer |
| Code | Description | Schema |
|---|---|---|
| 200 | Found Encoding | EncodingInfo |
| 404 | Group or encoding id with given name not found | |
| 500 | Internal server error while getting encoding info corresponding to encoding id |
Get codecTypes for the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| Code | Description | Schema |
|---|---|---|
| 200 | Found CodecTypes | CodecTypesList |
| 404 | Group or encoding id with given name not found | |
| 500 | Internal server error while fetching codecTypes registered |
Adds a new codecType to the group.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| groupName | path | Group name | Yes | string |
| namespace | query | Namespace in which to lookup group. If no namespace is specified, default namespace is used. | No | string |
| codecType | body | The codecType | Yes | string |
| Code | Description |
|---|---|
| 201 | Successfully added codecType to group |
| 404 | Group not found |
| 500 | Internal server error while registering codectype to a Group |
Gets a map of groups to version info where the schema if it is registered. SchemaInfo#properties is ignored while comparing the schema.
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| namespace | query | Namespace in which to lookup schemas used in groups. If no namespace is specified, default namespace is used. | No | string |
| schemaInfo | body | Get schema references for the supplied schema | Yes | SchemaInfo |
| Code | Description | Schema |
|---|---|---|
| 200 | Schema version | AddedTo |
| 404 | Schema not found | |
| 500 | Internal server error while fetching Schema references |
Map of Group names to group properties. For partially created groups, the group properties may be null.
| Name | Type | Description | Required |
|---|---|---|---|
| groups | object | No | |
| continuationToken | string | Continuation token to identify the position of last group in the response. | Yes |
Metadata for a group.
| Name | Type | Description | Required |
|---|---|---|---|
| serializationFormat | SerializationFormat | serialization format for the group. | Yes |
| compatibility | Compatibility | Compatibility to apply while registering new schema. | Yes |
| allowMultipleTypes | boolean | Flag to indicate whether to allow multiple schemas representing distinct objects to be registered in the group. | Yes |
| properties | object | User defined Key value strings. | No |
Serialization format enum that lists different serialization formats supported by the service. To use additional formats, use serializationFormat.Custom and supply fullTypeName.
| Name | Type | Description | Required |
|---|---|---|---|
| serializationFormat | string | Yes | |
| fullTypeName | string | No |
Schema information object that encapsulates various properties of a schema.
| Name | Type | Description | Required |
|---|---|---|---|
| type | string | Name of the schema. This identifies the type of object the schema payload represents. | Yes |
| serializationFormat | SerializationFormat | Type of schema. | Yes |
| schemaData | binary | Base64 encoded string for binary data for schema. | Yes |
| properties | object | User defined key value strings. | No |
Version information object.
| Name | Type | Description | Required |
|---|---|---|---|
| type | string | Type of schema for this version. This is same value used in SchemaInfo#Type for the schema this version identifies. | Yes |
| version | integer | Version number that uniquely identifies the schema version among all schemas in the group that share the same Type. | Yes |
| id | integer | schema id that uniquely identifies schema version and describes the absolute order in which the schema was added to the group. | Yes |
Object that encapsulates SchemaInfo and its corresponding VersionInfo objects.
| Name | Type | Description | Required |
|---|---|---|---|
| schemaInfo | SchemaInfo | Schema information. | Yes |
| versionInfo | VersionInfo | Version information. | Yes |
List of schemas with their versions.
| Name | Type | Description | Required |
|---|---|---|---|
| schemas | [ SchemaWithVersion ] | List of schemas with their versions. | No |
Encoding id that uniquely identifies a schema version and codec type pair.
| Name | Type | Description | Required |
|---|---|---|---|
| encodingId | integer | encoding id generated by service. | Yes |
Encoding information object that resolves the schema version and codec type used for corresponding encoding id.
| Name | Type | Description | Required |
|---|---|---|---|
| schemaInfo | SchemaInfo | Schema information object. | Yes |
| versionInfo | VersionInfo | Version information object. | Yes |
| codecType | string | Codec type. | Yes |
Compatibility policy.
| Name | Type | Description | Required |
|---|---|---|---|
| policy | string | Compatibility policy enum. | Yes |
| advanced | BackwardAndForward | Backward and forward policy details. | No |
BackwardPolicy and forwardPolicy policy.
| Name | Type | Description | Required |
|---|---|---|---|
| backwardPolicy | BackwardPolicy | BackwardAndForward policy type that describes different types of BackwardPolicy policies like Backward, BackwardTransitive and BackwardTill. | No |
| forwardPolicy | ForwardPolicy | BackwardAndForward policy type that describes different types of ForwardPolicy policies like Forward, ForwardTransitive and ForwardTill. | No |
BackwardPolicy policy.
| Name | Type | Description | Required |
|---|---|---|---|
| backwardPolicy | BackwardAndForward type backwardPolicy. Can be one of Backward, backwardTill and backwardTransitive. | Yes |
ForwardPolicy policy.
| Name | Type | Description | Required |
|---|---|---|---|
| forwardPolicy | BackwardAndForward type forwardPolicy. Can be one of forward, forwardTill and forwardTransitive. | Yes |
BackwardPolicy compatibility type which tells the service to check for backwardPolicy compatibility with latest schema.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes |
ForwardPolicy compatibility type which tells the service to check for forwardPolicy compatibilty with latest schema.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes |
BackwardPolicy compatibility type which tells the service to check for backwardPolicy compatibility with all previous schemas.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes |
ForwardPolicy compatibility type which tells the service to check for forwardPolicy compatibility with all previous schemas.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes |
BackwardPolicy compatibility which tells the service to check for backwardPolicy compatibility with all previous schemas till specific version.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes | |
| versionInfo | VersionInfo | Whether given schema is valid with respect to existing group schemas against the configured compatibility. | Yes |
ForwardPolicy compatibility which tells the service to check for forwardPolicy compatibility with all previous schemas till specific version.
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Yes | |
| versionInfo | VersionInfo | Whether given schema is valid with respect to existing group schemas against the configured compatibility. | Yes |
Response object for listCodecTypes.
| Name | Type | Description | Required |
|---|---|---|---|
| codecTypes | [ string ] | List of codecTypes. | No |
Response object for validateSchema api.
| Name | Type | Description | Required |
|---|---|---|---|
| valid | boolean | Whether given schema is valid with respect to existing group schemas against the configured compatibility. | Yes |
Response object for canRead api.
| Name | Type | Description | Required |
|---|---|---|---|
| compatible | boolean | Whether given schema is compatible and can be used for reads. BackwardAndForward is checked against existing group schemas subject to group's configured compatibility policy. | Yes |
Group History Record that describes each schema evolution - schema information, version generated for the schema, time and compatibility policy used for schema validation.
| Name | Type | Description | Required |
|---|---|---|---|
| schemaInfo | SchemaInfo | Schema information object. | Yes |
| versionInfo | VersionInfo | Schema version information object. | Yes |
| compatibility | Compatibility | Schema compatibility applied. | Yes |
| timestamp | long | Timestamp when the schema was added. | Yes |
| schemaString | string | Schema as json string for serialization formats that registry service understands. | No |
| Name | Type | Description | Required |
|---|---|---|---|
| history | [ GroupHistoryRecord ] | Chronological list of Group History records. | No |
Map of Group names to versionInfos in the group. This is for all the groups where the schema is registered.
| Name | Type | Description | Required |
|---|---|---|---|
| groups | object | Version for the schema in the group. | Yes |