接口功能介绍
调用该接口查询ECI实例详细信息
接口约束
无
URI
POST /eci/api/v1/containers/describeContainerGroups
路径参数
无
Query参数
无
请求参数
请求头header参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| regionId | 是 | String | 区域ID | bb9fdb42056f11eda1610242ac110002 | |
请求体body参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| containerGroupIds | 否 | String | 通过ECI容器实例ID查询,当查询多个实例时,采用,分割多个实例ID | eci-d4nr3seelxi2zo8u,eci-vcl0ytww2hd6ahj6 | |
| containerGroupName | 否 | String | 通过ECI容器实例名字查询 | test | |
| limit | 否 | Integer | 限定此次返回资源的数量,不传或传值为0则使用默认值,默认值为20 | 5 | |
| status | 否 | String | 通过ECI容器实例状态查询 | Running | |
| tags | 否 | Array of Objects | 通过ECI实例的标签查询 | | tag |
| vSwitchId | 否 | String | 通过ECI实例的子网ID查询,该参数暂不支持 | subnet-y9n723knrg | |
| nextToken | 否 | String | 下一个查询开始的 Token,NextToken 为空表示没有下一个 | 1719493729.2.9 | |
| 表 tag | | | | | |
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| key | 否 | String | Tag标识的Key | tagKey | |
| value | 否 | String | Tag标识的Value | tagValue | |
响应参数
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| statusCode | Integer | 请求成功(200)或失败(非200) | 200 | |
| error | String | 错误码,三段式 | ECI.Openapi.StatusReasonInternalError | |
| message | String | 错误信息描述 | Internal error occurred | |
| returnObj | Object | 返回信息 | | returnObj |
| 表 returnObj | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| requestId | String | 请求ID | a4f0f36e-7e75-4045-a73a-a2507b26 | |
| nextToken | String | 下一个查询开始的Token | 1719493729.2.9 | |
| totalCount | Integer | 查询到的ECI实例数量 | 2 | |
| containerGroups | Array of Objects | ECI容器组信息 | | containerGroup |
| 表 containerGroup | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| cpu | Float | ECI容器实例CPU大小 | 1 | |
| memory | Float | ECI容器实例Memory大小 | 2 | |
| gpu | Float | ECI容器实例GPU卡数 | 1 | |
| vpcId | String | ECI容器实例所在VpcId | vpc-ctt6yag121 | |
| vSwitchId | String | ECI容器实例所在的子网ID | subnet-y9n723knrg | |
| securityGroupId | String | ECI容器实例所在的安全组ID | sg-5bvqyvrmch | |
| containers | Array of Objects | 容器信息 | | container |
| restartPolicy | String | ECI容器组的重启策略。 | Always/OnFailure/Never | |
| tags | Array of Objects | ECI实例的标签 | | tag |
| containerGroupId | String | ECI容器实例的ID | eci-d4nr3seelxi2zo8u | |
| status | String | ECI容器实例的状态 | Running | |
| intranetIp | String | ECI容器实例的IP | 192.168.0.16 | |
| internetIp | String | ECI容器实例的公网IP | 100.126.12.206 | |
| ipv6Address | String | ECI容器实例的IPV6 | fc00:100:4009:9602:1b53:2487:7899:e81a | |
| creationTime | String | ECI容器实例的创建时间 | 2024-01-08T15:00:00Z | |
| succeededTime | String | ECI容器实例的创建时间 | 2024-01-08T15:00:00Z | |
| failedTime | String | ECI容器实例的执行失败的时间 | 2024-01-08T15:00:00Z | |
| vmId | String | ECI容器实例所在的虚机ID | 37d213df-7ceb-b3c0-1cd1-8ea7eb594b5e | |
| tenantEniInstanceId | String | ECI容器实例的网卡ID | port-fusq04f7d8 | |
| containerGroupName | String | ECI容器实例的名字 | eci-vh8az8 | |
| 表 tag | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| key | String | Tag标识的Key | tagKey | |
| value | String | Tag标识的Value | tagValue | |
| 表 container | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| name | String | 容器名 | test | |
| image | String | 容器镜像 | nginx:latest | |
| imagePullPolicy | String | 容器镜像拉取策略 | Always | |
| cpu | Float | 容器CPU大小 | 1 | |
| memory | Float | 容器Memory大小 | 2 | |
| gpu | Float | 容器GPU卡数 | 1 | |
| command | Array of Strings | 容器启动命令 | /bin/sh | |
| args | Array of Strings | 容器启动参数 | []string{"-c","/app"} | |
| ports | Array of Objects | 容器端口 | | port |
| environmentVar | Array of Objects | 容器环境变量 | | environmentVar |
| livenessProbe | Object | 容器存活探针 | | livenessProbe |
| readinessProbe | Object | 容器就绪探针 | | readinessProbe |
| lifecycle | Array of Objects | 生命周期 | | lifecycle |
| previousState | Array of Objects | 之前状态 | | state |
| currentState | Array of Objects | 当前状态 | | state |
| 表 port | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| name | String | 容器端口名 | xxx | |
| port | Integer | 容器端口号 | 80 | |
| protocol | String | 容器端口协议 | TCP/UDP | |
| 表 environmentVar | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| key | String | 容器环境变量名 | product | |
| value | String | 容器环境变量值 | eci | |
| 表 livenessProbe | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| exec | Object | 命令行 | | exec |
| httpGet | Object | Http请求 | | httpGet |
| tcpSocket | Object | TCPSocket | | tcpSocket |
| initialDelaySeconds | Integer | 执行第一次探活判断操作需要等待的时间 | 1 | |
| timeoutSeconds | Integer | 执行一次探活判断操作的超时时间 | 1 | |
| periodSeconds | Integer | 执行一次探活判断操作的间隔时间 | 1 | |
| successThreshold | Integer | 探活判断多少次判定容器存活正常 | 1 | |
| failureThreshold | Integer | 探活判断多少次判定容器未存活异常 | 1 | |
| 表 readinessProbe | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| exec | Object | 命令行 | | exec |
| httpGet | Object | Http请求 | | httpGet |
| tcpSocket | Object | TCPSocket | | tcpSocket |
| initialDelaySeconds | Integer | 执行第一次就绪判断操作需要等待的时间 | 1 | |
| timeoutSeconds | Integer | 执行一次就绪判断操作的超时时间 | 1 | |
| periodSeconds | Integer | 执行一次就绪判断操作的间隔时间 | 1 | |
| successThreshold | Integer | 就绪判断多少次判定容器存活正常 | 1 | |
| failureThreshold | Integer | 就绪判断多少次判定容器未存活异常 | 1 | |
| 表 exec | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| command | Array of Strings | 命令 | []string{"/bin/sh", "-c", "/exec"} | |
| 表 httpGet | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| scheme | String | 协议 | HTTPS/HTTP | |
| port | Integer | 端口 | 80 | |
| path | String | URL路径 | /healthz | |
| 表 tcpSocket | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| port | Integer | 端口 | 80 | |
| 表 lifecycle | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| lifecyclePostStartHandlerExec | Array of Strings | 容器启动后执行的命令,如果执行失败会重启容器 | []string{"curl", "localhost:80"} | |
| lifecyclePreStopHandlerExec | Array of Strings | 容器停止前执行的命令,如果执行失败会重启容器 | []string{"curl", "localhost:80"} | |
| 表 state | | | | |
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|
| startTime | String | 容器运行开始时间 | 2024-01-08T15:00:00Z | |
| finishTime | String | 容器运行结束时间 | 2024-01-08T15:00:00Z | |
| state | String | 容器状态,Waiting: 等待启动中; Running: 运行中; Terminated: 运行失败 | Running | |
| message | String | 容器状态信息 | Back-off 5m0s restarting failed | |
| signal | Integer | 容器状态信号 | 1 | |
| exitCode | Integer | 容器运行退出码 | 1 | |
| reason | String | 原因 | Completed | |
枚举参数
无
请求示例
请求url
https://eci-global.ctapi.ctyun.cn/eci/api/v1/containers/describeContainerGroups
请求头header
{
regionId: bb9fdb42056f11eda1610242ac110002
}
请求体body
{
"containerGroupIds" : "eci-d4nr3seelxi2zo8u",
"status": "Running"
}
响应示例
{
"statusCode": 200,
"returnObj": {
"requestId": "3b768b0b-f8b9-44d0-a2f0-1cad35e7",
"totalCount": 1,
"nextToken": "",
"containerGroups": [
{
"containerGroupId": "eci-d4nr3seelxi2zo8u",
"containerGroupName": "eci-vh8az8",
"intranetIp": "192.168.0.16",
"status": "Running",
"cpu": 1,
"memory": 2,
"restartPolicy": "Always",
"vpcId": "vpc-ctt6yag121",
"vSwitchId": "subnet-y9n723knrg",
"securityGroupId": "sg-5bvqyvrmch",
"tags": [],
"containers": [
{
"name": "container-1",
"image": "registry-vpc-crs-huadong1.ctyun.cn/x-eci/nginx:latest",
"imagePullPolicy": "Always",
"ports": [],
"restartCount": 1,
"ready": true,
"currentState": {
"state": "Running",
"startTime": "2024-01-08T16:01:45+08:00"
},
"previousState": {
"reason": "Completed",
"state": "Terminated",
"finishTime": "2024-01-08T16:01:45+08:00"
},
"command": null,
"args": null,
"environmentVar": [],
"volumeMount": null,
"lifecyclePostStartHandlerExec": null,
"lifecyclePreStopHandlerExec": null
}
],
"tenantEniInstanceId": "port-fusq04f7d8",
"volumes": [],
"vmId": "37d213df-7ceb-b3c0-1cd1-8ea7eb594b5e",
"creationTime": "2024-01-08T15:06:45+08:00"
}
]
}
}
状态码
请参考 状态码
错误码
请参考 错误码