-
Notifications
You must be signed in to change notification settings - Fork 23
REST documentation
REST APIs for Pravega Schema Registry.
Version : 0.0.1
License : Apache 2.0
License URL : http://www.apache.org/licenses/LICENSE-2.0
Terms of service : null
BasePath : /v1
Schemes : HTTP
- Group : Group related APIs
- Schemas : Schema related APIs
Create a new Group
Type | Name | Description | Schema |
---|---|---|---|
Query |
namespace optional |
Namespace in which to create group | string |
Body |
CreateGroupRequest required |
The Group configuration | CreateGroupRequest |
Name | Description | Schema |
---|---|---|
groupName required |
Example : "string"
|
string |
groupProperties required |
Example : "[groupproperties](#groupproperties)"
|
GroupProperties |
HTTP Code | Description | Schema |
---|---|---|
201 | Successfully added group | No Content |
409 | Group with given name already exists | No Content |
500 | Internal server error while creating a Group | No Content |
application/json
- Group
/groups
{
"groupName" : "string",
"groupProperties" : {
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaValidationRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
},
"allowMultipleTypes" : true,
"properties" : {
"string" : "string"
}
}
}
List all groups within the namespace. If namespace is not specified, All groups in default namespace are listed.
Type | Name | Description | Schema |
---|---|---|---|
Query |
continuationToken optional |
Continuation token | string |
Query |
limit optional |
The numbers of items to return | integer |
Query |
namespace optional |
Namespace in which to look up groups | string |
HTTP Code | Description | Schema |
---|---|---|
200 | List of all groups | ListGroupsResponse |
500 | Internal server error while fetching the list of Groups | No Content |
application/json
- Group
/groups
{
"groups" : {
"string" : "[groupproperties](#groupproperties)"
},
"continuationToken" : "string"
}
Fetch the properties of an existing Group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Found Group properties | GroupProperties |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching Group details | No Content |
application/json
- Group
/groups/string
{
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaValidationRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
},
"allowMultipleTypes" : true,
"properties" : {
"string" : "string"
}
}
Delete a Group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the Group | No Content |
500 | Internal server error while deleting the Group | No Content |
- Group
/groups/string
Adds a new codecType to the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
codecType required |
The codecType | string |
HTTP Code | Description | Schema |
---|---|---|
201 | Successfully added codecType to group | No Content |
404 | Group not found | No Content |
500 | Internal server error while registering codectype to a Group | No Content |
application/json
- Group
/groups/string/codecTypes
{ }
Get codecTypes for the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Found CodecTypes | CodecTypesList |
404 | Group or encoding id with given name not found | No Content |
500 | Internal server error while fetching codecTypes registered | No Content |
application/json
- Group
/groups/string/codecTypes
{
"codecTypes" : [ "string" ]
}
Get an encoding id that uniquely identifies a schema version and codec type pair.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
GetEncodingIdRequest required |
Get schema corresponding to the version | GetEncodingIdRequest |
Name | Description | Schema |
---|---|---|
codecType required |
Example : "string"
|
string |
versionInfo required |
Example : "[versioninfo](#versioninfo)"
|
VersionInfo |
HTTP Code | Description | Schema |
---|---|---|
200 | Found Encoding | EncodingId |
404 | Group with given name or version not found | No Content |
412 | Codec type not registered | No Content |
500 | Internal server error while getting encoding id | No Content |
application/json
application/json
- Group
/groups/string/encodings
{
"versionInfo" : {
"type" : "string",
"version" : 0,
"ordinal" : 0
},
"codecType" : "string"
}
{
"encodingId" : 0
}
Get the encoding information corresponding to the encoding id.
Type | Name | Description | Schema |
---|---|---|---|
Path |
encodingId required |
Encoding id that identifies a unique combination of schema and codec type | integer (int32) |
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Found Encoding | EncodingInfo |
404 | Group or encoding id with given name not found | No Content |
500 | Internal server error while getting encoding info corresponding to encoding id | No Content |
application/json
- Group
/groups/string/encodings/0
{
"schemaInfo" : {
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
},
"versionInfo" : {
"type" : "string",
"version" : 0,
"ordinal" : 0
},
"codecType" : "string"
}
Fetch the history of schema evolution of a Group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Found Group history | GroupHistory |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching Group history | No Content |
application/json
- Group
/groups/string/history
{
"history" : [ {
"schemaInfo" : {
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
},
"version" : {
"type" : "string",
"version" : 0,
"ordinal" : 0
},
"validationRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
},
"timestamp" : 0,
"schemaString" : "string"
} ]
}
update schema validation rules of an existing Group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
UpdateValidationRulesRequest required |
update group policy | UpdateValidationRulesRequest |
Name | Description | Schema |
---|---|---|
previousRules optional |
Example : "[schemavalidationrules](#schemavalidationrules)"
|
SchemaValidationRules |
validationRules required |
Example : "[schemavalidationrules](#schemavalidationrules)"
|
SchemaValidationRules |
HTTP Code | Description | Schema |
---|---|---|
200 | Updated schema validation policy | No Content |
404 | Group with given name not found | No Content |
409 | Write conflict | No Content |
500 | Internal server error while updating Group's schema validation rules | No Content |
application/json
- Group
/groups/string/rules
{
"validationRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
},
"previousRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
}
}
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.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Query |
type optional |
Type of object | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Latest schemas for all objects identified by SchemaInfo#type under the group | SchemaVersionsList |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching Group's latest schemas | No Content |
application/json
- Group
/groups/string/schemas
{
"schemas" : [ {
"schemaInfo" : {
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
},
"version" : {
"type" : "string",
"version" : 0,
"ordinal" : 0
}
} ]
}
Adds a new schema to the group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
schemaInfo required |
Add new schema to group | SchemaInfo |
HTTP Code | Description | Schema |
---|---|---|
201 | Successfully added schema to the group | VersionInfo |
404 | Group not found | No Content |
409 | Incompatible schema | No Content |
417 | Invalid serialization format | No Content |
500 | Internal server error while adding schema to group | No Content |
application/json
application/json
- Group
/groups/string/schemas/versions
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
{
"type" : "string",
"version" : 0,
"ordinal" : 0
}
Get all schema versions for the group
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Query |
type optional |
Type of object the schema describes. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Versioned history of schemas registered under the group | SchemaVersionsList |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching Group schema versions | No Content |
application/json
- Group
/groups/string/schemas/versions
{
"schemas" : [ {
"schemaInfo" : {
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
},
"version" : {
"type" : "string",
"version" : 0,
"ordinal" : 0
}
} ]
}
Checks if given schema can be used for reads subject to compatibility policy in the schema validation rules.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
schemaInfo required |
Checks if schema can be used to read the data in the stream based on compatibility rules. | SchemaInfo |
HTTP Code | Description | Schema |
---|---|---|
200 | Response to tell whether schema can be used to read existing schemas | CanRead |
404 | Group with given name not found | No Content |
500 | Internal server error while checking schema for readability | No Content |
application/json
application/json
- Group
/groups/string/schemas/versions/canRead
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
{
"compatible" : true
}
Get the version for the schema if it is registered. It does not automatically register the schema. To add new schema use addSchema
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
schemaInfo required |
Get schema corresponding to the version | SchemaInfo |
HTTP Code | Description | Schema |
---|---|---|
200 | Schema version | VersionInfo |
404 | Group with given name not found | No Content |
500 | Internal server error fetching version for schema | No Content |
application/json
application/json
- Group
/groups/string/schemas/versions/find
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
{
"type" : "string",
"version" : 0,
"ordinal" : 0
}
Checks if given schema is compatible with schemas in the registry for current policy setting.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
Body |
ValidateRequest required |
Checks if schema is valid with respect to supplied validation rules | ValidateRequest |
Name | Description | Schema |
---|---|---|
schemaInfo required |
Example : "[schemainfo](#schemainfo)"
|
SchemaInfo |
validationRules optional |
Example : "[schemavalidationrules](#schemavalidationrules)"
|
SchemaValidationRules |
HTTP Code | Description | Schema |
---|---|---|
200 | Schema validation response | Valid |
404 | Group with given name not found | No Content |
500 | Internal server error while trying to validate schema | No Content |
application/json
application/json
- Group
/groups/string/schemas/versions/validate
{
"schemaInfo" : {
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
},
"validationRules" : {
"rules" : {
"string" : "[schemavalidationrule](#schemavalidationrule)"
}
}
}
{
"valid" : true
}
Get schema from the version ordinal that uniquely identifies the schema in the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Path |
versionOrdinal required |
Version ordinal | integer (int32) |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Schema corresponding to the version | SchemaInfo |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching schema from version | No Content |
application/json
- Group
/groups/string/schemas/versions/0
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
Delete schema identified by version from the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Path |
versionOrdinal required |
Version ordinal | integer (int32) |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
204 | Schema corresponding to the version | No Content |
404 | Group with given name not found | No Content |
500 | Internal server error while deleting schema from group | No Content |
application/json
- Group
/groups/string/schemas/versions/0
Get schema from the version ordinal that uniquely identifies the schema in the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Path |
type required |
Schema type from SchemaInfo#type or VersionInfo#type | string |
Path |
version required |
Version number | integer (int32) |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
200 | Schema corresponding to the version | SchemaInfo |
404 | Group with given name not found | No Content |
500 | Internal server error while fetching schema from version | No Content |
application/json
- Group
/groups/string/schemas/string/versions/0
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
Delete schema version from the group.
Type | Name | Description | Schema |
---|---|---|---|
Path |
groupName required |
Group name | string |
Path |
type required |
Schema type from SchemaInfo#type or VersionInfo#type | string |
Path |
version required |
Version number | integer (int32) |
Query |
namespace optional |
Namespace in which to lookup group. If no namespace is specified, default namespace is used. | string |
HTTP Code | Description | Schema |
---|---|---|
204 | Schema corresponding to the version | No Content |
404 | Group with given name not found | No Content |
500 | Internal server error while deleting schema from group | No Content |
application/json
- Group
/groups/string/schemas/string/versions/0
Gets a map of groups to version info where the schema if it is registered. SchemaInfo#properties is ignored while comparing the schema.
Type | Name | Description | Schema |
---|---|---|---|
Query |
namespace optional |
Namespace in which to lookup schemas used in groups. If no namespace is specified, default namespace is used. | string |
Body |
schemaInfo required |
Get schema references for the supplied schema | SchemaInfo |
HTTP Code | Description | Schema |
---|---|---|
200 | Schema version | AddedTo |
404 | Schema not found | No Content |
500 | Internal server error while fetching Schema references | No Content |
application/json
application/json
- Schemas
/schemas/addedTo
{
"type" : "string",
"serializationFormat" : {
"serializationFormat" : "string",
"customTypeName" : "string"
},
"schemaData" : "string",
"properties" : {
"string" : "string"
}
}
{
"groups" : {
"string" : "[versioninfo](#versioninfo)"
}
}
Map of Group names to group properties. For partially created groups, the group properties may be null.
Name | Type | Description | Required |
---|---|---|---|
groups | object | Map of Group ids to Group Properties | Yes |
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 |
schemaValidationRules | SchemaValidationRules | Validation rules 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 Serialization Format, use serializationFormat.Custom and supply customTypeName.
Name | Type | Description | Required |
---|---|---|---|
serializationFormat | string | Yes | |
customTypeName | string | No |
Serialization Format enum:
- Avro
- Protobuf
- Json
- Any
- Custom
Schema information object that encapsulates various properties of a schema.
Name | Type | Description | Required |
---|---|---|---|
type | string | Type of object described by this 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 object described by schema identified by this version. This is the name used in SchemaInfo#type. | Yes |
version | integer | Version number that uniquely identifies the schema version among all schemas in the group that share the same type. | Yes |
ordinal | integer | Version ordinal that uniquely identifies the position of the corresponding schema across all schemas in the group. | Yes |
Object that encapsulates SchemaInfo and its corresponding VersionInfo objects.
Name | Type | Description | Required |
---|---|---|---|
schemaInfo | SchemaInfo | Schema information. | Yes |
version | 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 pair.
Name | Type | Description | Required |
---|---|---|---|
encodingId | integer | encoding id generated by service. | Yes |
Encoding information object that resolves the schema version and codec 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 object. | Yes |
Schema Compatibility validation rule.
Name | Type | Description | Required |
---|---|---|---|
name | string | Name is used to identify the type of SchemaValidationRule. For Compatibility rule the name should be "Compatibility". | Yes |
policy | string | Compatibility policy enum. | Yes |
backwardTill | VersionInfo | Version for backward till if policy is BackwardTill or BackwardAndForwardTill. | No |
forwardTill | VersionInfo | Version for forward till if policy is ForwardTill or BackwardAndForwardTill. | No |
Policy enum:
- AllowAny
- DenyAll
- Backward
- Forward
- ForwardTransitive
- BackwardTransitive
- BackwardTill
- ForwardTill
- BackwardAndForwardTill
- Full
- FullTransitive
Schema validation rules to be applied for new schema addition. Currently only one rule is supported - Compatibility.
Name | Type | Description | Required |
---|---|---|---|
rules | object | SchemaValidationRule | No |
Schema validation rule base class.
Name | Type | Description | Required |
---|---|---|---|
rule | Specific schema validation rule. The only rule we have presently is Compatibility. The "name" is used to identify specific Rule type. The only rule supported in this is Compatibility. | Yes |
Only rule supported currently is Compatibility.
{
"Compatibility" : {
"rule": {
"name" : "Compatibility",
"policy":[CompatibilityPolicyEnum](#compatibilitypolicyenum),
"backwardTill" : [VersionInfo](#versioninfo),
"forwardTill" : [VersionInfo](#versioninfo),
}
}
}
Response object for listCodecTypes.
Name | Type | Description | Required |
---|---|---|---|
codecTypes | [ String ] | List of codecTypes. These are expressed as MIME types | 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 validation rules. | Yes |
Response object for canRead api.
Name | Type | Description | Required |
---|---|---|---|
compatible | boolean | Whether given schema is compatible and can be used for reads. Compatibility 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 rules used for schema validation.
Name | Type | Description | Required |
---|---|---|---|
schemaInfo | SchemaInfo | Schema information object. | Yes |
version | VersionInfo | Schema version information object. | Yes |
validationRules | SchemaValidationRules | Schema validation rules 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 |