From 03120444f537567dbfd5ab24f2ed5c17fa0872ae Mon Sep 17 00:00:00 2001 From: Sukrit Khera Date: Sun, 26 Jul 2015 16:52:51 -0700 Subject: [PATCH 1/2] Initial deployer api --- apiary.apib | 180 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 156 insertions(+), 24 deletions(-) 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 From b9f76c29fdefa0f61619ed4c041f96dc2d92d421 Mon Sep 17 00:00:00 2001 From: Sukrit Khera Date: Tue, 28 Jul 2015 03:35:25 -0700 Subject: [PATCH 2/2] Comment out urllib3for now (docker build failures) Comment out urllib3for now (docker build failures) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 16dae92..5eded26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ python-etcd==0.3.2 elasticsearch==1.2.0 future==0.14.1 pytz==2015.4 -urllib3==1.10.4 +# urllib3==1.10.4 https://github.com/totem/fleet-py/archive/master.tar.gz https://github.com/totem/yoda-py/archive/develop.tar.gz https://github.com/totem/flask-hyperschema/archive/master.tar.gz