Environment endpoints¶
- GET /api/environment/(string environmentID)¶
Get details about the environment, including existing services
- Request JSON Object:
build (boolean) – (optional) option for trigger building (default true)
Example response
HTTP/1.1 200 OK { "id":"[environment-id]", "rid":"[repository-id]", "gitRef": { "name":"develop", "type":"branch" } "status":"built", "weburl":"[webproxy_url]", "aliases":{ "[alias]":"[env_alias_address]" } "buildTime":1234, "createdAt":[datetime], "ttl":120, "builtAt":[datetime], "size":1234, "services":[ "id":"[service-id]", "name":"web" ] }
- Response JSON Object:
weburl (string) – Environment accessible URL
status (string) – Environment status (
empty
|created
|building
|built
)createdAt (integer) – Datetime when environment was created
buildTime (integer) – Environment build process duration, in seconds
buildAt (integer) – Datetime when environment finished last build process
ttl (integer) – Time to life, its omitted if zero
size (integer) – Environment size in bytes
aliases (dict) – Environment aliases
- PUT /api/environment/(string environmentID)¶
Create the environment. The object itself previously exists, this method setup all the services according to config. The status of the environment will go from empty to created.
- Query Parameters:
build – Option for create and build an environment (default to true)
ttl – Option for set a custom time to live
- Request JSON Object:
build (string) – Option for create and build an environment (default to true)
ttl (integer) – Option for set a custom time to live
- DELETE /api/environment/(string environmentID)¶
Delete the environment. It wont delete the object but it will remove all the resources related, like services. The status of the environment will be set to empty except if there are more environments with the same git reference (clones).
- POST /api/environment/(string environmentID)/build¶
Trigger the build process. To get the logs refer to other endpoint.
- POST /api/environment/(string environmentID)/rebuild¶
Deletes (if not deleted), creates and build a given environment
- GET /api/environment/(string environmentID)/build/logs¶
Get a WebSocket stream in real-time of the build process.
- POST /api/environment/(string environmentID)/ttl¶
Update a running environment TTL
- Response JSON Object:
ttl (integer) – New TTl to set