- 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-Legth: 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-Legth: 284
{"Name":"app1","Framework":"php","Repository":"git@git.com: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 hte response containing the statusn and the url for git repository.
Example:
POST /apps HTTP/1.1
{"status":"success", "repository_url":"git@tsuru.plataformas.glb.com: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 enviroment names and values..
Example:
GET /apps/myapp/env HTTP/1.1
{"DATABASE_HOST":"localhost"}
- 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-Legth: 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: 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-Legth: 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-Legth: 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-Legth: 67
[{Name: "python"},{Name: "java"},{Name: "ruby20"},{Name: "static"}]
- Method: POST
- URI: /users
- Body: {“email”:”nobody@globo.com”,”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":"nobody@globo.com","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/user@email.com/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/user@email.com/tokens HTTP/1.1
- 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-Legth: 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": ["user@email.com"]}
- 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