查询容器实例详情
此接口用于查询某个容器实例的详细信息。
接口描述
通信协议:HTTP
URL: GET /api/v1/container/:id
传参方式: path
请求参数
字段名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
id | string | 是 | 容器实例主键 ID |
响应参数
响应参数的 data 字段类型为 Container。
Container
字段名 | 类型 | 说明 |
---|---|---|
id | string | 容器 ID,SylixOS 下容器 ID 与 Name 一致 |
taskId | string | 容器的主键 ID,对应容器创建任务的 ID |
name | string | 容器名称 |
status | enum | 容器的状态, null 为未知 created: 已创建 running: 运行中 exited: 已退出 paused: 暂停中 |
uptime | number | 容器自启动以来过去的秒数 |
startedTime | string | 容器的启动时间 |
createdTime | string | 容器的创建时间 |
taskCreatedTime | string | 容器创建任务的创建时间,暂用于列表排序 |
deployStatus | enum | 容器创建任务的状态 deploying: 部署中 failure: 失败 success: 成功 |
failedMessage | string | 容器创建任务失败时,对应的失败原因 |
restartCnt | number | 容器自发的重启次数 |
deployNum | number | 容器的部署次数 |
cpuUsage | CPU | 容器的实时 CPU 使用率 |
memoryLimit | number | 容器内存使用上限, 单位 bytes |
memoryUsage | number | 当前容器已使用的内存,单位 bytes |
memoryMaxUsage | number | 当前容器使用的最大内存,单位 bytes |
sizeUsage | number | 当前容器的磁盘使用大小 |
sizeLimit | number | 当前容器的磁盘使用上限 |
serviceId | string | 所属的服务 ID |
serviceName | string | 服务名称 |
nodeId | string | 所在节点 ID |
address | string | 所在节点的 IP 地址和端口号 |
nodeName | string | 所在节点名称 |
nodeArch | string | 所在节点架构 |
imageId | string | 所用镜像 ID |
imageName | string | 所用镜像名称 |
imageVersion | string | 所用镜像版本 |
imageOS | string | 所用镜像 OS |
imageArch | string | 所用镜像架构 |
CPU
字段名 | 类型 | 说明 |
---|---|---|
total | number | 总的 CPU 使用率, 10 即代表 10% |
cores | number[ ] | 每一核的 CPU 使用率 |
请求示例
curl --location --request GET 'http://localhost:3001/api/v1/container/45585e4f1036170505304759688b7a104'
响应示例
{
"status": 200,
"message": "success",
"fieldErrors": null,
"data": {
"id": "instance_uZ5vO5plwE-MRSNe",
"taskId": "45585e4f1036170505304759688b7a104",
"name": "instance_uZ5vO5plwE-MRSNe",
"status": "exited",
"uptime": 0,
"startedTime": "2000-01-03T00:59:38.857Z",
"createdTime": "2000-01-03T00:59:37.771Z",
"taskCreatedTime": 1705053047607,
"deployStatus": "success",
"failedMessage": null,
"restartCnt": 0,
"deployNum": 0,
"cpuUsage": {
"total": 0,
"cores": [
0
]
},
"memoryLimit": 536870912,
"memoryUsage": 0,
"memoryMaxUsage": 274432,
"sizeUsage": 0,
"sizeLimit": 2147483648,
"serviceId": "f556fc2b1039170505213312164f0377d",
"serviceName": "service-a-111-1",
"nodeId": "29f36b9010121705040468139db0aa7c0",
"address": "192.168.64.111",
"nodeName": "192.168.64.111",
"nodeArch": "arm64",
"imageId": "8b3b82f710041699609792816001bfd4f",
"imageName": "image",
"imageVersion": "2.0.0",
"imageOS": "sylixos",
"imageArch": "arm64"
}
}
错误码
具体请参见 错误码说明。