Skip to content

Container Services

Service Host Entry

Service Metadata

Service Resources

Service SSL


List all container services

GET /api/container_services

OAuth authorization required: project_read

View Schema
  • container_services: Array
    • id: Integer
    • name: String
    • default_domain: String
    • public_ip: String
    • command: String
    • is_load_balancer: Boolean
    • has_domain_management: Boolean
    • container_image_id: Integer
    • current_state: String
    • auto_scale: Boolean
    • auto_scale_horizontal: Boolean
    • auto_scale_max: Boolean
    • labels: Object
    • created_at: DateTime
    • updated_at: DateTime
    • project: Object
      • id: Integer
      • name: String
    • package: Object
      • label: String
      • cpu: Decimal
      • memory: Integer
      • storage: Integer
      • bandwidth: Integer
      • local_disk: Integer
      • backup: Integer
      • memory_swap: Integer
      • memory_swappiness: Integer
    • has_sftp: Boolean
    • ingress_rules: Array<Integer>
    • product_id: Integer
    • bastions: Array<Integer>
    • domains: Array<Integer>
    • deployed_containers: Integer
    • node_status: Object | Status of the nodes running the service's containers (with none deployed yet, its availability zone's nodes). See Node status.
    • help: Object
      • general: String
      • ssh: String
      • remote: String
      • domain: String
    • links: Object
      • project: 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: Object
    • id: Integer
    • name: String
    • default_domain: String
    • public_ip: String
    • command: String
    • is_load_balancer: Boolean
    • has_domain_management: Boolean
    • container_image_id: Integer
    • current_state: String
    • auto_scale: Boolean
    • auto_scale_horizontal: Boolean
    • auto_scale_max: Boolean
    • labels: Object
    • created_at: DateTime
    • updated_at: DateTime
    • project: Object
      • id: Integer
      • name: String
    • package: Object
      • label: String
      • cpu: Decimal
      • memory: Integer
      • storage: Integer
      • bandwidth: Integer
      • local_disk: Integer
      • backup: Integer
      • memory_swap: Integer
      • memory_swappiness: Integer
    • has_sftp: Boolean
    • ingress_rules: Array<Integer>
    • product_id: Integer
    • bastions: Array<Integer>
    • domains: Array<Integer>
    • deployed_containers: Integer
    • node_status: Object | Status of the nodes running the service's containers (with none deployed yet, its availability zone's nodes). See Node status.
    • help: Object
      • general: String
      • ssh: String
      • remote: String
      • domain: String
    • links: Object
      • project: 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: Object
    • name: String
    • scale: Integer
    • package_id: Integer
    • master_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

{
    "container_service": {
        "product_id": 2
    }
}

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

{
    "container_service": {
        "qty": 2
    }
}

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: String
    • authorization: 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 | true if any container's action waits for maintenance to end.
  • code: String | node_maintenance when deferred is true, otherwise null.
  • event_ids: Array<Integer>
  • containers: Array
    • id: Integer
    • event_id: Integer
    • result: 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
{
    "deferred": true,
    "code": "node_maintenance",
    "event_ids": [4102, 4103],
    "containers": [
        { "id": 88, "event_id": 4102, "result": "deferred" },
        { "id": 89, "event_id": 4103, "result": "queued" }
    ]
}

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 ago
  • period_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"
    ]
]