diff --git a/apiary.apib b/apiary.apib index 4a0314b..27b4ba1 100644 --- a/apiary.apib +++ b/apiary.apib @@ -3,44 +3,176 @@ FORMAT: 1A # cluster-deployer API For *Totem Cluster Deployer*. -# Group Deployment -Notes related resources of the **Notes API** +# Root API [/] +## Fetch Root API [GET] ++ Request + + Header + + Accept: application/vnd.deployer.root.v1+json ++ Response 200 (application/vnd.deployer.root.v1+json) + + Header -## Deployment Collection [/deployments] -### List all Deployments [GET] -+ Response 200 (application/json) + Access-Control-Allow-Origin: * + Link: ; rel="describedBy" - [{ - "id": 1, "title": "Jogging in park" - }, { - "id": 2, "title": "Pick-up posters from post-office" - }] + + Body + + { + "version": "0.2.2" + } + + + Schema + + { + "$schema": "http://json-schema.org/draft-04/hyper-schema#", + "id": "#root-v1", + "links": [ + { + "href": "http://localhost:9000", + "mediaType": "application/vnd.deployer.root-v1+json", + "method": "GET", + "rel": "self" + }, + { + "href": "/apps", + "mediaType": "application/vnd.deployer.task.v1+json, application/vnd.deployer.app.version.v1+json", + "method": "POST", + "rel": "app-version-create", + "title": "Deploy new application version" + }, + { + "href": "/apps", + "mediaType": "application/vnd.deployer.app.version-list.v1+json", + "method": "POST", + "rel": "app-list", + "title": "Lists deployed applications" + }, + { + "href": "/health", + "mediaType": "application/vnd.deployer.health-v1+json", + "method": "GET", + "rel": "health", + "title": "Healthcheck for deployer" + }, + { + "href": "/tasks/{task_id}", + "mediaType": "application/vnd.deployer.task.v1+json", + "method": "GET", + "rel": "tasks", + "title": "Gets task status and results" + }, + { + "href": "/recovery", + "mediaType": "application/vnd.deployer.health-v1+json", + "method": "post", + "rel": "recovery", + "title": "Provides API for bulk recovery of deployments" + } + ], + "properties": { + "version": { + "type": "string" + } + }, + "title": "HyperSchema for root API", + "type": "object" + } + +## Group Schema +## Schema Collection [/schemas] +### Fetch schema list [GET] ++ Request + + Header + + Accept: application/json ++ Response 200 (application/json) -### Create a Deployment [POST] -+ Request (application/json) + + Header - { "title": "Buy cheese and bread for breakfast." } + Access-Control-Allow-Origin: * -+ Response 201 (application/json) + + Body - { "id": 3, "title": "Buy cheese and bread for breakfast." } + [ + "app-version-v1", + "recovery-v1", + "health-v1", + "root-v1", + "app-version-create-v1" + ] -## Note [/notes/{id}] -A single Note object with all its details +## Schema Resource [/schemas/{name}] + Parameters - + id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value. + + name: root-v1 (required, string) - Schema name -### Retrieve a Note [GET] -+ Response 200 (application/json) +### Fetch schema [GET] ++ Request + + Header + + Accept: application/json ++ Response 200 (application/json) + Header - X-My-Header: The Value + Access-Control-Allow-Origin: * + Body + + + { + "$schema": "http://json-schema.org/draft-04/hyper-schema#", + "id": "#root-v1", + "links": [ + { + "href": "http://localhost:9000", + "mediaType": "application/vnd.deployer.root-v1+json", + "method": "GET", + "rel": "self" + }, + { + "href": "/apps", + "mediaType": "application/vnd.deployer.task.v1+json, application/vnd.deployer.app.version.v1+json", + "method": "POST", + "rel": "app-version-create", + "title": "Deploy new application version" + }, + { + "href": "/apps", + "mediaType": "application/vnd.deployer.app.version-list.v1+json", + "method": "POST", + "rel": "app-list", + "title": "Lists deployed applications" + }, + { + "href": "/health", + "mediaType": "application/vnd.deployer.health-v1+json", + "method": "GET", + "rel": "health", + "title": "Healthcheck for deployer" + }, + { + "href": "/tasks/{task_id}", + "mediaType": "application/vnd.deployer.task.v1+json", + "method": "GET", + "rel": "tasks", + "title": "Gets task status and results" + }, + { + "href": "/recovery", + "mediaType": "application/vnd.deployer.health-v1+json", + "method": "post", + "rel": "recovery", + "title": "Provides API for bulk recovery of deployments" + } + ], + "properties": { + "version": { + "type": "string" + } + }, + "title": "HyperSchema for root API", + "type": "object" + } - { "id": 2, "title": "Pick-up posters from post-office" } -### Remove a Note [DELETE] -+ Response 204