Container Services¶
List all container services¶
GET /api/container_services
OAuth authorization required: project_read
View Schema
container_services: Arrayid: Integername: Stringdefault_domain: Stringpublic_ip: Stringcommand: Stringis_load_balancer: Booleanhas_domain_management: Booleancontainer_image_id: Integercurrent_state: Stringauto_scale: Booleanauto_scale_horizontal: Booleanauto_scale_max: Booleanlabels: Objectcreated_at: DateTimeupdated_at: DateTimeproject: Objectid: Integername: String
package: Objectlabel: Stringcpu: Decimalmemory: Integerstorage: Integerbandwidth: Integerlocal_disk: Integerbackup: Integermemory_swap: Integermemory_swappiness: Integer
has_sftp: Booleaningress_rules:Array<Integer>product_id: Integerbastions:Array<Integer>domains:Array<Integer>deployed_containers: Integernode_status: Object | Status of the nodes running the service's containers (with none deployed yet, its availability zone's nodes). See Node status.help: Objectgeneral: Stringssh: Stringremote: Stringdomain: String
links: Objectproject: String (url)bastions: String (url)containers: String (url)events: String (url)ingress_rules: String (url)metadata: String (url)logs: String (url)products: String (url)
View Container Service¶
GET /api/container_services/{id}
OAuth authorization required: project_read
View Schema
container_service: Objectid: Integername: Stringdefault_domain: Stringpublic_ip: Stringcommand: Stringis_load_balancer: Booleanhas_domain_management: Booleancontainer_image_id: Integercurrent_state: Stringauto_scale: Booleanauto_scale_horizontal: Booleanauto_scale_max: Booleanlabels: Objectcreated_at: DateTimeupdated_at: DateTimeproject: Objectid: Integername: String
package: Objectlabel: Stringcpu: Decimalmemory: Integerstorage: Integerbandwidth: Integerlocal_disk: Integerbackup: Integermemory_swap: Integermemory_swappiness: Integer
has_sftp: Booleaningress_rules:Array<Integer>product_id: Integerbastions:Array<Integer>domains:Array<Integer>deployed_containers: Integernode_status: Object | Status of the nodes running the service's containers (with none deployed yet, its availability zone's nodes). See Node status.help: Objectgeneral: Stringssh: Stringremote: Stringdomain: String
links: Objectproject: String (url)bastions: String (url)containers: String (url)events: String (url)ingress_rules: String (url)metadata: String (url)logs: String (url)products: String (url)
Update a container service¶
PATCH /api/container_services/{id}
OAuth authorization required: project_write
Schema
container_service: Objectname: Stringscale: Integerpackage_id: Integermaster_domain_id: Integer | ID of domain that you want to be default.
Delete a container service¶
DELETE /api/container_services/{id}
OAuth authorization required: project_write
Resize Service¶
Initiate a resize event for a ContainerService
POST /api/container_services/{container-service-id}/resize
OAuth authorization required: project_write
Schema
product_id: Integer | New plan
Example
Scale Service¶
Initiate a scale event for a ContainerService
POST /api/container_services/{container-service-id}/scale
OAuth authorization required: project_write
Schema
qty: Integer | The total number of containers this service should have #
Example
Responds with 202 Accepted and an empty body; the scale runs in the background.
Adding containers needs a node in the service's availability zone that can take them. When there is none because the zone's nodes are in maintenance or offline, nothing is changed and the response is 409 Conflict with errors, code (node_maintenance or node_offline), and the availability zone's node_status. This previously returned 202. Scaling down is never refused this way. See Refused and deferred actions.
Power Management¶
Perform a power action on all containers belonging to a service
PUT /api/container_services/{container-service-id}/power/{action}
OAuth authorization required: project_write
Schema
action:String<start,stop,restart,rebuild>callback: Object | Optional. Called when each container's event finishes; for a deferred action, that is when it finally runs. See API callbacks.url: Stringauthorization: String
Responds with 202 Accepted and the outcome for each container. If any container's node is in maintenance, its action is deferred and runs once maintenance ends; deferred is then true and code is node_maintenance. A later power request for the same container replaces a waiting one, and the replaced request's callback fires with status: "cancelled" and code: "superseded". See Refused and deferred actions.
When the service has containers and every one of them is refused because its node is offline, the response is 409 Conflict with errors, code: "node_offline", and the service's node_status. This previously returned 202. A service with no containers responds 202 Accepted with an empty containers list.
Response
deferred: Boolean |trueif any container's action waits for maintenance to end.code: String |node_maintenancewhendeferredistrue, otherwisenull.event_ids:Array<Integer>containers: Arrayid: Integerevent_id: Integerresult:String<queued,deferred,in_progress,refused_offline,failed>|in_progress: another action was already running, so this one was canceled.refused_offline: the node is offline (or the container has no node), so this one was canceled.
Example
Logs¶
View Recent Logs
GET /api/container_services/{id}/logs
OAuth authorization required: project_read
Schema
limit: Integer | How many lines to include?period_start: Integer | Log date range (start). As an integer, time since epoch. Default: 1 day agoperiod_end: Integer | Log date range (end). As an integer, time since epoch. Default: Now
Returns an Array of Arrays containing: Timestamp, container name, log entry
Example
[
[
1612904254.9995728,
"mystifying-poincare61-104",
"t=2021-02-09T20:57:34+0000 lvl=info msg=\\"HTTP Server Listen\\" logger=http.server address=[::]:3000 protocol=http subUrl= socket="
],
[
1612904254.991145,
"mystifying-poincare61-104",
"t=2021-02-09T20:57:34+0000 lvl=info msg=\\"Registering plugin\\" logger=plugins id=input"
],
[
1612904254.8895183,
"mystifying-poincare61-104",
"t=2021-02-09T20:57:34+0000 lvl=info msg=\\"Starting plugin search\\" logger=plugins"
]
]