Containers¶
View Container¶
GET /api/containers/{id}
OAuth authorization required: projects_read
Schema
containers: Arrayid: Integername: Stringreq_state:String<running,stopped>stats: Objectcpu: Decimalmem: Decimal
current_state:String<migrating,starting,stopping,working,alert,resource_usage,online,offline>local_ip: Stringpublic_ip: Stringcreated_at: DateTimeupdated_at: DateTimeingress_rules: Arrayingress_rule: Objectid: Integerport: Integerport_nat: Integerproto:String<http,tcp,tls,udp>external_access: Booleanbackend_ssl: Booleantcp_proxy_opt:String<none,send-proxy,send-proxy-v2,send-proxy-v2-ssl,send-proxy-v2-ssl-cn>redirect_ssl: Booleanrestrict_cf: Boolean | If true, only allow CloudFlaretcp_lb: Booleancreated_at: Booleanupdated_at: Booleancontainer_service_id: Integerload_balancer_rule_id: Integerinternal_load_balancer_id: Integerload_balanced_rules: Arraylinks: Objectdomains: String (url)
Power Control¶
PUT /api/containers/{container-id}/power/{action}
OAuth authorization required: projects_write
action: String<start,stop,restart,rebuild>
Container Logs¶
GET /api/containers/{id}/logs
OAuth authorization required: projects_read
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"
]
]
Container Processes¶
View processes inside of a container
GET /api/containers/{container-id}/container_processes
OAuth authorization required: projects_read
Schema Returns an Array of Objects containing:
UID: StringPID: IntegerPPID: IntegerC: IntegerSTIME: StringTTY: StringTIME: stringCMD: String
Container Resource Usage¶
Both the time, and date/memory label and format, will be formatted to match your API user's timezone and locale.
CPU Usage¶
GET /api/containers/{container-id}/metrics/cpu
OAuth authorization required: projects_read
Schema
stats: Array
Memory Usage¶
GET /api/containers/{container-id}/metrics/memory
OAuth authorization required: projects_read
Schema
stats: Array