Service Endpoints

FelixGV edited this page Nov 12, 2014 · 8 revisions

Introduction

This sections describes the various REST endpoints which can be accessed once the service is running.

Although each endpoint is described below, the actual code can be located within the RESTRepositoryClient class.

Write Operations

Registering a schema in the Schema Repo is currently a two step process: create subject first, then register a schema into it.

For write operations, the content types are important to specify correctly, as described below. Moreover, these write operations require using PUT, not POST.

PUT a new subject

Description: A Subject is a collection of mutually compatible Schemas. By using Subjects to organize schemas we can interact with them more effectively.

This endpoint also supports passing some arbitrary key/value metadata in the form's content to populate the subject's config.

Endpoint:

/some_subject_name      // this should change based on your subject choice

Command:

curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" http://localhost:2876/schema-repo/some_subject_name

Response:


PUT a schema within an existing subject

Description: This is where we attempt to create a schema which is given an ID. We also provide schema literals.

Endpoint:

/some_subject_name/register

Command:

curl -X PUT -H "Content-Type: text/plain" --data "schema literal for this subject" http://localhost:2876/schema-repo/some_subject_name/register

Response:


Read Operations

Read operations are requested with GET.

GET a list of all existing subjects

Description: Gets a basic list of all registered subjects within the response body. When invoked on an empty Schema Repo, this will return a 200 response with an empty body.

Endpoint:

/

Command:

curl -X GET http://localhost:2876/schema-repo/

Response:

Response header

Status Code: 200 OK
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

Response Body
   
some_subject_name

GET all currently registered schemas for a subject

Description: This will provide a collection of registered schemas for any given subject container. Initially it will return nothing within a 200 at first... which is absolutely fine.

Endpoint:

/some_subject_name/all

Command:

curl -X GET http://localhost:2876/schema-repo/some_subject_name/all

Response:

Status Code: 200 OK
Content-Length: 0
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)

GET the list of all schema IDs and schema literals for an existing subject

Description:

Endpoint:

/some_subject_name/all

Command:

curl -X GET http://localhost:2876/schema-repo/some_subject_name/all

Response:

Response Header
Status Code: 200 OK
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

Response Body
0	schema literal for this subject

GET a Subject's configuration

Description: Simply returns any specific configuration associated with a defined Subject.

Endpoint:

/some_subject_name/config

Command:

curl -X GET http://localhost:2876/schema-repo/some_subject_name/config

Response:

Response Header
Status Code: 200 OK
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

Response Body
#Tue Nov 11 10:44:32 PST 2014

GET the most recent Schema for a particular Subject

Description: Simply returns the most recently registered Schema for any defined Subject.

Endpoint:

/some_subject_name/latest

Command:

curl -X GET http://localhost:2876/schema-repo/some_subject_name/latest

Response:

Response Header
Status Code: 200 OK
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

Response Body
#Tue Nov 11 10:44:32 PST 2014

GET a specific Schema literal (by ID) for a particular Subject

Description: Simply returns the schema registered with this particular ID

Endpoint:

/some_subject_name/id/${schemaId}

Command:

curl -X GET http://localhost:2876/schema-repo/test_schemas/id/0

Response:

Response Header
Status Code: 200 OK
Content-Type: text/plain
Server: Jetty(8.y.z-SNAPSHOT)
Transfer-Encoding: chunked

Response Body
0	schema literal for this subject

/register_if_latest

TODO

/schema

TODO

/integral

TODO

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.