- Method: GET
- URI: /apps
- Format: json
Returns 200 in case of success, and json in the body of the response containing the app list.
Example:
GET /apps HTTP/1.1
Content-Length: 82
[{"Ip":"10.10.10.10","Name":"app1","Units":[{"Name":"app1/0","State":"started"}]}]
- Method: GET
- URI: /apps/:appname
- Format: json
Returns 200 in case of success, and a json in the body of the response containing the app content.
Example:
GET /apps/myapp HTTP/1.1
Content-Length: 284
{"Name":"app1","Framework":"php","Repository":"[email protected]:php.git","State":"dead", "Units":[{"Ip":"10.10.10 .10","Name":"app1/0","State":"started"}, {"Ip":"9.9.9.9","Name":"app1/1","State":"started"}, {"Ip":"","Name":"app1/2","Stat e":"pending"}],"Teams":["tsuruteam","crane"]}
- Method: DELETE
- URI: /apps/:appname
Returns 200 in case of success.
Example:
DELETE /apps/myapp HTTP/1.1
- Method: POST
- URI: /apps
- Format: json
Returns 200 in case of success, and json in the body of the response containing the status and the url for git repository.
Example:
POST /apps HTTP/1.1
{"status":"success", "repository_url":"[email protected]:ble.git"}
- Method: GET
- URI: /apps/<appname>/restart
Returns 200 in case of success.
Example:
GET /apps/myapp/restart HTTP/1.1
- Method: GET
- URI: /apps/<appname>/env
Returns 200 in case of success, and json in the body returning a dictionary with environment names and values..
Example:
GET /apps/myapp/env HTTP/1.1
[{"name": "DATABASE_HOST", "value": "localhost", "public": true}]
- Method: POST
- URI: /apps/<appname>/env
Returns 200 in case of success.
Example:
POST /apps/myapp/env HTTP/1.1
- Method: DELETE
- URI: /apps/<appname>/env
Returns 200 in case of success.
Example:
DELETE /apps/myapp/env HTTP/1.1
- Method: PUT
- URI: /swap?app1=appname&app2=anotherapp
Returns 200 in case of success.
Example:
PUT /swap?app1=myapp&app2=anotherapp
- Method: GET
- URI: /services
- Format: json
Returns 200 in case of success.
Example:
GET /services HTTP/1.1
Content-Length: 67
{"service": "mongodb", "instances": ["my_nosql", "other-instance"]}
- Method: POST
- URI: /services
- Format: yaml
- Body: a yaml with the service metadata.
Returns 200 in case of success. Returns 403 if the user is not a member of a team. Returns 500 if the yaml is invalid. Returns 500 if the service name already exists.
Example:
POST /services HTTP/1.1
Body:
`id: some_service
endpoint:
production: someservice.com`
- Method: DELETE
- URI: /services/<servicename>
Returns 204 in case of success. Returns 403 if user has not access to the server. Returns 403 if service has instances. Returns 404 if service is not found.
Example:
DELETE /services/mongodb HTTP/1.1
- Method: PUT
- URI: /services
- Format: yaml
- Body: a yaml with the service metadata.
Returns 200 in case of success. Returns 403 if the user is not a member of a team. Returns 500 if the yaml is invalid. Returns 500 if the service name already exists.
Example:
PUT /services HTTP/1.1
Body:
`id: some_service
endpoint:
production: someservice.com`
- Method: GET
- URI: /services/<servicename>
- Format: json
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
GET /services/mongodb HTTP/1.1
[{"Name": "my-mongo", "Teams": ["myteam"], "Apps": ["myapp"], "ServiceName": "mongodb"}]
- Method: GET
- URI: /services/<servicename>/doc
- Format: text
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
GET /services/mongodb/doc HTTP/1.1
Mongodb exports the ...
- Method: PUT
- URI: /services/<servicename>/doc
- Format: text
- Body: text with the documentation
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
PUT /services/mongodb/doc HTTP/1.1
Body: Mongodb exports the ...
- Method: PUT
- URI: /services/<servicename>/<teamname>
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
PUT /services/mongodb/cobrateam HTTP/1.1
- Method: DELETE
- URI: /services/<servicename>/<teamname>
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
DELETE /services/mongodb/cobrateam HTTP/1.1
- Method: POST
- URI: /services/instances
- Body: {"name": "mymysql": "service_name": "mysql"}
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
POST /services/instances HTTP/1.1
{"name": "mymysql": "service_name": "mysql"}
- Method: DELETE
- URI: /services/instances/<serviceinstancename>
Returns 200 in case of success. Returns 404 if the service does not exists.
Example:
DELETE /services/instances/mymysql HTTP/1.1
- Method: PUT
- URI: /services/instances/<serviceinstancename>/<appname>
- Format: json
Returns 200 in case of success, and json with the environment variables to be exported in the app environ. Returns 403 if the user has not access to the app. Returns 404 if the application does not exists. Returns 404 if the service instance does not exists.
Example:
PUT /services/instances/mymysql/myapp HTTP/1.1
Content-Length: 29
{"DATABASE_HOST":"localhost"}
- Method: DELETE
- URI: /services/instances/<serviceinstancename>/<appname>
Returns 200 in case of success. Returns 403 if the user has not access to the app. Returns 404 if the application does not exists. Returns 404 if the service instance does not exists.
Example:
DELETE /services/instances/mymysql/myapp HTTP/1.1
- Method: GET
- URI: /services/instances
- Format: json
Returns 200 in case of success and a json with the service list.
Example:
GET /services/instances HTTP/1.1
Content-Length: 52
[{"service": "redis", "instances": ["redis-globo"]}]
- Method: GET
- URI: /services/instances/<serviceinstancename>
- Format: json
Returns 200 in case of success and a json with the service instance data. Returns 404 if the service instance does not exists.
Example:
GET /services/instances/mymysql HTTP/1.1
Content-Length: 71
{"name": "mongo-1", "servicename": "mongodb", "teams": [], "apps": []}
- Method: GET
- URI: /services/instances/<serviceinstancename>/status
Returns 200 in case of success.
Example:
GET /services/instances/mymysql/status HTTP/1.1
- Method: GET
- URI: /quota/<user>
- Format: json
Returns 200 in case of success, and json with the quota info.
Example:
GET /quota/wolverine HTTP/1.1
Content-Length: 29
{"items": 10, "available": 2}
- Method: GET
- URI: /healers
- Format: json
Returns 200 in case of success, and json in the body with a list of healers.
Example:
GET /healers HTTP/1.1
Content-Length: 35
[{"app-heal": "http://healer.com"}]
- Method: GET
- URI: /healers/<healer>
Returns 200 in case of success.
Example:
GET /healers/app-heal HTTP/1.1
- Method: GET
- URI: /platforms
- Format: json
Returns 200 in case of success, and json in the body with a list of platforms.
Example:
GET /platforms HTTP/1.1
Content-Length: 67
[{Name: "python"},{Name: "java"},{Name: "ruby20"},{Name: "static"}]
- Method: POST
- URI: /users
- Body: {"email":"[email protected]","password":"123456"}
Returns 200 in case of success. Returns 400 if the json is invalid. Returns 400 if the email is invalid. Returns 400 if the password characters length is less than 6 and greater than 50. Returns 409 if the email already exists.
Example:
POST /users HTTP/1.1
Body: `{"email":"[email protected]","password":"123456"}`
- Method: POST
- URI: /users/<email>/password?token=token
Returns 200 in case of success. Returns 404 if the user is not found.
The token parameter is optional.
Example:
POST /users/[email protected]/password?token=1234 HTTP/1.1
- Method: POST
- URI: /users/<email>/tokens
- Body: {"password":"123456"}
Returns 200 in case of success. Returns 400 if the json is invalid. Returns 400 if the password is empty or nil. Returns 404 if the user is not found.
Example:
POST /users/[email protected]/tokens HTTP/1.1
{"token":"e275317394fb099f62b3993fd09e5f23b258d55f"}
- Method: DELETE
- URI: /users/tokens
Returns 200 in case of success.
Example:
DELETE /users/tokens HTTP/1.1
- Method: PUT
- URI: /users/password
- Body: {"old":"123456","new":"654321"}
Returns 200 in case of success. Returns 400 if the json is invalid. Returns 400 if the old or new password is empty or nil. Returns 400 if the new password characters length is less than 6 and greater than 50. Returns 403 if the old password does not match with the current password.
Example:
PUT /users/password HTTP/1.1
Body: `{"old":"123456","new":"654321"}`
- Method: DELETE
- URI: /users
Returns 200 in case of success.
Example:
DELETE /users HTTP/1.1
- Method: POST
- URI: /users/keys
- Body: {"key":"my-key"}
Returns 200 in case of success.
Example:
POST /users/keys HTTP/1.1
Body: `{"key":"my-key"}`
- Method: DELETE
- URI: /users/keys
- Body: {"key":"my-key"}
Returns 200 in case of success.
Example:
DELETE /users/keys HTTP/1.1
Body: `{"key":"my-key"}`
- Method: GET
- URI: /teams
- Format: json
Returns 200 in case of success, and json in the body with a list of teams.
Example:
GET /teams HTTP/1.1
Content-Length: 22
[{"name": "teamname"}]
- Method: GET
- URI: /teams/<teamname>
- Format: json
Returns 200 in case of success, and json in the body with the info about a team.
Example:
GET /teams/teamname HTTP/1.1
{"name": "teamname", "users": ["[email protected]"]}
- Method: POST
- URI: /teams
Returns 200 in case of success.
Example:
POST /teams HTTP/1.1
{"name": "teamname"}
- Method: DELETE
- URI: /teams/<teamname>
Returns 200 in case of success.
Example:
DELELE /teams/myteam HTTP/1.1
- Method: PUT
- URI: /teams/<teanmaname>/<username>
Returns 200 in case of success.
Example:
PUT /teams/myteam/myuser HTTP/1.1
- Method: DELETE
- URI: /teams/<teanmaname>/<username>
Returns 200 in case of success.
Example:
DELETE /teams/myteam/myuser HTTP/1.1
- Method: POST
- URI: /tokens
- Format: json
Returns 200 in case of success, with the token in the body.
Example:
POST /tokens HTTP/1.1
{
"Token": "sometoken",
"Creation": "2001/01/01",
"Expires": 1000,
"AppName": "appname",
}