调用DescribeContainerGroups批量获取ECI实例(即容器组)信息。

接口说明

当ECI实例运行终止后,底层计算资源将会被回收,实例信息的保留情况如下:

  • 对于运行成功终止的ECI实例,保留最近运行成功的100个实例信息(所有地域总和),其余实例信息将被清理。
  • 对于运行失败终止的ECI实例,实例信息仅保留24小时,之后将被清理。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeContainerGroups

系统规定参数。取值:DescribeContainerGroups

RegionId String cn-hangzhou

实例所属的地域ID。

ZoneId String cn-hangzhou-h

实例所属的可用区。空表示由系统选择,默认值:空。

VSwitchId String vsw-bp1jrgfqqy54kg5hc****

实例所属的虚拟交换机ID。

NextToken String d78f2dd8-5979-42fe-****-b16db43be5bc

下一个查询开始的Token,NextToken为空表示没有下一个。

说明 首次查询时无需设置该参数,后续查询的Token从返回结果中获取。
Limit Integer 20

限定此次返回资源的数量。如果不设定,默认返回20个,最大不能超过20个。

说明 返回结果可能小于指定的数量,但不会多于指定的数量。
Tag.N.Key String name

实例标签键。

Tag.N.Value String test

实例标签值。

ContainerGroupIds String ["eci-bp17gw49eu09yiwm****", "eci-bp19aq49du01abcm****", "eci-2zegym1qhbmdfr1s****"]

实例ID序列。最多20个,字符串需按照JSON格式传入。

ContainerGroupName String test

实例名称。

Status String Running

实例状态列表,可参考ContainerGroup结构体定义。

ResourceGroupId String rg-aekzh43v*****

所属资源组ID。如果创建实例时没有指定资源组,实例将自动加入账号下的默认资源组。

返回数据

名称 类型 示例值 描述
ContainerGroups Array of ContainerGroup

实例信息列表。

ContainerGroupId String eci-bp1jrgfqqy54kg5hc****

实例ID。

ContainerGroupName String test

实例名称。

Containers Array of Container

实例包含的容器列表。

Args List ["hello"]

容器启动参数。

Commands List [/bin/sh echo]

容器启动命令。

Cpu Float 2.0

容器的vCPU大小。

CurrentState Struct

容器当前状态。

DetailStatus String working

容器状态详情。

ExitCode Integer 0

容器运行退出码。

FinishTime String 2018-08-02T15:00:00Z

容器运行结束时间。

Message String Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)

容器状态信息。

Reason String Started

容器状态Reason。

Signal Integer 1

容器状态信号。

StartTime String 2019-12-19T12:05:02Z

容器运行开始时间。

State String Terminated

容器状态,可能值:

  • Waiting
  • Running
  • Terminated
EnvironmentVars Array of EnvironmentVar

环境变量。

Key String PATH

环境变量名。

Value String /usr/bin/

环境变量值。

ValueFrom Struct

环境变量值的来源。 如果值不为空,则无法使用。

FieldRef Struct

指定字段。

FieldPath String status.podIP

字段的路径。

Gpu Integer 1

GPU个数。

Image String mysql

容器镜像。

ImagePullPolicy String Always

镜像拉取策略。

LivenessProbe Struct

存活探针。

Execs List ["/bin/sh", "-c", "echo Hello world > /usr/share/message"]

执行命令。

FailureThreshold Integer 3

从上次检查成功后认定检查失败的检查次数阈值(必须是连续失败),默认为3。

HttpGet Struct

HttpGet。

Path String /usr/nginx/

HttpGet检测的路径。

Port Integer 80

HttpGet检测的端口。

Scheme String HTTP

HTTP或HTTPS。

InitialDelaySeconds Integer 10

检查开始执行的时间,以容器启动完成为起点计算。

PeriodSeconds Integer 5

检查执行的周期,默认为10秒,最小为1秒。

SuccessThreshold Integer 1

从上次检查失败后重新认定检查成功的检查次数阈值(必须是连续成功),默认为1。当前必须为1。

TcpSocket Struct

TcpSocket。

Host String 1.2.3.4

主机名。

Port Integer 80

端口号。

TimeoutSeconds Integer 10

检查超时的时间,默认为1秒,最小为1秒。

Memory Float 2.0

容器内存大小。

Name String nginx

容器名称。

Ports Array of Port

暴露端口和协议。

Port Integer 8080

端口号。可能值:1~65535。

Protocol String TCP

协议类型。

PreviousState Struct

上一次状态。

DetailStatus String working

状态详情。

ExitCode Integer 0

容器运行退出码。

FinishTime String 2018-08-02T15:00:00Z

容器运行结束时间。

Message String Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)

容器状态信息。

Reason String Completed

容器状态 Reason。

Signal Integer 1

容器状态信号。

StartTime String 2018-08-02T15:00:00Z

容器运行开始时间。

State String Terminated

容器状态。可能值:

  • Waiting
  • Running
  • Terminated
ReadinessProbe Struct

就绪探针。

Execs List ["/bin/sh", "-c", "echo Hello world > /usr/share/message"]

容器内检测的命令。

FailureThreshold Integer 3

从上次检查成功后认定检查失败的检查次数阈值(必须是连续失败),默认为3。

HttpGet Struct

HttpGet。

Path String /usr/local

HttpGet检测的路径。

Port Integer 8080

HttpGet检测的端口号。

Scheme String HTTP

HTTP/HTTPS。

InitialDelaySeconds Integer 5

检查开始执行的时间,以容器启动完成为起点计算。

PeriodSeconds Integer 1

检查执行的周期,默认为10秒,最小为1秒。

SuccessThreshold Integer 1

从上次检查失败后重新认定检查成功的检查次数阈值(必须是连续成功),默认为1。当前必须为1。

TcpSocket Struct

TcpSocket。

Host String 1.2.3.4

Host。

Port Integer 8888

端口号。

TimeoutSeconds Integer 5

检查超时的时间,默认为1秒,最小为1秒。

Ready Boolean true

指定容器是否已通过其就绪探针。

RestartCount Integer 0

重启次数。

SecurityContext Struct

实例运行的安全上下文。

Capability Struct

容器的默认功能集。目前仅支持Cpu/Memory。

Adds List [NET_ADMIN]

枚举值,目前仅支持:NET_ADMIN。

ReadOnlyRootFilesystem Boolean true

是否只读根文件系统,目前仅支持True。

RunAsUser Long 1000

用于运行容器进程入口点的UID。

Stdin Boolean true

此容器是否应在容器运行时为标准输入分配缓冲区。如果未设置,则容器中标准输入的读取值将导致EOF。默认为false。

StdinOnce Boolean true

当标准输入为true时,标准输入流将在多个附加会话中保持开启状态。如果StdinOnce设为true,标准输入在容器开启时被打开,在首个客户端附加到标准输入之前都为空,然后会一直保持开启状态,接收数据,直到客户端连接断开,此时标准输入被关闭,在容器重启前一直保持关闭状态。

Tty Boolean false

是否开启交互。

VolumeMounts Array of VolumeMount

挂载数据卷。

MountPath String /usr/share/

挂载目录,容器的挂载目录下的内容被Volume的内容直接覆盖。

MountPropagation String None

数据卷的挂载传播设置。挂载传播允许将Container挂载的卷共享到同一Pod中的其他Container,甚至可以共享到同一节点上的其他Pod。可能值:

  • None:该卷不感知任何后续在此卷或其子目录上执行的挂载操作。
  • HostToCotainer:该卷将会感知到后续在此卷或其子目录上的挂载操作。
  • Bidirectional:和HostToCotainer类似,能感知挂载操作。另外,该卷将被传播回主机和使用同一卷的所有Pod的所有容器。
Name String test-empty

数据卷名称。

ReadOnly Boolean false

是否只读。

WorkingDir String /usr/local/nginx

工作目录。

Cpu Float 2.0

实例级别vCPU大小。

CreationTime String 2018-08-02T15:00:00Z

接到请求后的系统创建时间。UTC时间,RFC3339标准。

Discount Integer 9

折扣。

DnsConfig Struct

DNS配置信息。

NameServers List [10.2.*.*]

DNS服务器IP地址列表。

Options Array of Option

对象选项列表,每个对象由Name和Value(可选)构成。

Name String name

对象变量名。

Value String value

对象变量值。

Searches List [svc.local.kubenetes]

DNS搜索域列表。

EciSecurityContext Struct

容器组运行的安全上下文。

Sysctls Array of Sysctl

系统信息。

Name String kernel.msgmax

变量名。

Value String 65536

变量值。

EniInstanceId String eni-bp14rzqi6fd8satm****

弹性网卡ID。

EphemeralStorage Integer 20

临时存储空间大小。单位为:GiB。

Events Array of Event

事件信息,上限 50。

Count Integer 20

事件数量。

FirstTimestamp String 2018-08-02T15:00:00Z

事件起始时间。

LastTimestamp String 2018-08-02T15:00:00Z

事件结束时间。

Message String Started container

事件消息。

Name String test-xxx

事件的归属对象名。

Reason String Created

事件名。

Type String Normal

事件类型,可能值:

  • Normal
  • Warning
ExpiredTime String 2018-08-02T15:00:00Z

由于帐户欠费导致实例运行失败的时间。UTC时间,RFC3339标准。

FailedTime String 2018-08-02T15:00:00Z

实例运行失败的时间。UTC时间,RFC3339标准。

HostAliases Array of HostAliase

自定义实例内一个容器的Hostname映射。

Hostnames List ['hehe.com', 'haha.com']

主机名。

Ip String 42.101.1.10

IP地址。

InitContainers Array of Container

Init容器列表。

Args List ['hello world']

启动参数。

Command List [/bin/sh echo]

启动命令。

Cpu Float 1.0

vCPU大小。

CurrentState Struct

当前状态。

DetailStatus String working

状态详情。

ExitCode Integer 0

容器退出码。

FinishTime String 2018-08-02T15:00:00Z

容器运行结束时间。

Message String Created container

事件消息。

Reason String Started

容器状态 Reason。

Signal Integer 1

容器状态信号。

StartTime String 2018-08-02T15:00:00Z

容器运行开始时间。

State String Running

容器状态,枚举值:Waiting,Running,Terminated。

EnvironmentVars Array of EnvironmentVar

环境变量。

Key String PATH

环境变量名。

Value String /usr/local/bin

环境变量值。

ValueFrom Struct

环境变量值的来源。 如果值不为空,则无法使用。

FieldRef Struct

指定的字段。

FieldPath String status.podIP

指定的版本中选择字段的路径。目前只支持 status.podIP

Gpu Integer 1

GPU个数。

Image String nginx

镜像。

ImagePullPolicy String Always

镜像拉取策略。

Memory Float 2.0

内存大小。

Name String Init-xxx

容器名称。

Ports Array of Port

暴露端口和协议。

Port Integer 8888

端口号。可能值:1~65535。

Protocol String TCP

协议类型。

PreviousState Struct

上一次状态。

DetailStatus String working

状态详情。

ExitCode Integer 0

容器运行退出码。

FinishTime String 2019-12-24T05:35:44Z

容器运行结束时间。

Message String Started container

容器状态信息。

Reason String completed

容器状态 Reason。

Signal Integer 1

容器状态信号。

StartTime String 2019-12-24T05:35:44Z

容器运行开始时间。

State String Terminated

容器状态,枚举值:Waiting,Running,Terminated。

Ready Boolean true

指定容器是否已通过其就绪探针。

RestartCount Integer 5

重启次数。

SecurityContext Struct

容器运行的安全上下文。

Capability Struct

容器的默认功能集。目前仅支持Cpu/Memory。

Adds List NET_ADMIN

枚举值,目前仅支持:NET_ADMIN。

ReadOnlyRootFilesystem Boolean true

是否只读根文件系统,目前仅支持True。

RunAsUser Long 1557

用于运行容器进程入口点的UID。

VolumeMounts Array of VolumeMount

数据卷挂载。

MountPath String /usr/share/

挂载目录,容器的挂载目录下的内容被Volume的内容直接覆盖。

MountPropagation String None

数据卷的挂载传播设置。挂载传播允许将Container挂载的卷共享到同一Pod中的其他Container,甚至可以共享到同一节点上的其他Pod。可能值:

  • None:该卷不感知任何后续在此卷或其子目录上执行的挂载操作。
  • HostToCotainer:该卷将会感知到后续在此卷或其子目录上的挂载操作。
  • Bidirectional:和HostToCotainer类似,能感知挂载操作。另外,该卷将被传播回主机和使用同一卷的所有Pod的所有容器。
Name String test-empty

数据卷名称,同 Volume 中的 Name。

ReadOnly Boolean false

默认值为False。

WorkingDir String /usr/test

工作目录。

InstanceType String ecs.g5.large

指定的ECS实例规格。

InternetIp String 21.3.43.4

公网IP。

IntranetIp String 10.21.1.1

内网IP。

Ipv6Address String CDCD:0000:0000:0000:8475:1111:3900:2020=CDCD::8475:1111:3900:2020

IPv6地址。

Memory Float 4.0

实例级别内存大小。

RamRoleName String ram:PassRole

实例RAM角色名称,ECI与ECS共用实例RAM角色,具体操作,请参见通过API使用实例RAM角色

RegionId String cn-hangzhou

实例所属的地域ID。

ResourceGroupId String rg-8db03793gfrz****

资源组ID。

RestartPolicy String Never

容器组的重启策略。

SecurityGroupId String sg-bp12ujq5zpxuyjfo3o8r

安全组ID。

SpotStrategy String NoSpot

实例的抢占策略。取值范围:

  • NoSpot(默认):正常按量付费实例。
  • SpotWithPriceLimit:设置上限价格的抢占式实例。
  • SpotAsPriceGo:系统自动出价,跟随当前市场实际价格。
Status String Running

实例状态,可能值:Pending、Running、Succeeded、Failed、Scheduling、ScheduleFailed。

SucceededTime String 2019-12-11T04:33:42Z

容器全部成功退出后的时间。UTC时间,RFC3339标准。

Tags Array of Label

实例的标签键值对。

Key String name

标签键。

Value String test-xh

标签值。

TenantEniInstanceId String i-xxx

该参数未开放使用。

TenantEniIp String 10.10.*.*

该参数未开放使用。

TenantSecurityGroupId String sg-xxx

该参数未开放使用。

TenantVSwitchId String vsw-xxx

该参数未开放使用。

VSwitchId String vsw-bp1vzjjflab6wvjox****

虚拟交换机ID。

Volumes Array of Volume

数据卷信息。

ConfigFileVolumeConfigFileToPaths Array of ConfigFileVolumeConfigFileToPath

配置文件路径列表。

Content String hello world

配置文件内容 (32KB)。

Path String /usr/bin/

相对文件路径。

DiskVolumeDiskId String d-xxxx

DiskVolume的ID。

DiskVolumeFsType String xfs

数据卷类型。

FlexVolumeDriver String flexvolume

用于FlexVolume的驱动程序名称。

FlexVolumeFsType String ntfs

挂载的文件系统类型,默认取决于FlexVolume的script。

FlexVolumeOptions String [nolock,tcp,noresvport]

FlexVolume对象选项列表。

NFSVolumePath String /eci

NFS数据卷路径。

NFSVolumeReadOnly Boolean false

是否只读。

NFSVolumeServer String 0eafxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com

NFS服务器地址。

Name String test-empty

数据卷名称。

Type String EmptyDirVolume

数据卷类型,可能值:

  • EmptyDirVolume
  • NFSVolume
  • ConfigFileVolume
  • FlexVolume
VpcId String vpc-1vzjjflab6wvjox****

实例所属的VPC ID。

ZoneId String cn-hangzhou-h

实例所属的可用区。

TotalCount Integer 19

实例数量。

NextToken String d78f2dd8-5979-42fe-****-b16db43be5bc

下一个查询开始的Token。

RequestId String 89945DD3-9072-47D0-A318-353284CFC7B3

请求ID,唯一标识。

示例

请求示例

https://eci.aliyuncs.com/?Action=DescribeContainerGroups
&RegionId=cn-hangzhou
&<公共请求参数>

正常返回示例

XML格式

<DescribeContainerGroupsResponse>
      <TotalCount>19</TotalCount>
      <NextToken>d78f2dd8-5979-42fe-****-b16db43be5bc</NextToken>
      <RequestId>89945DD3-9072-47D0-A318-353284CFC7B3</RequestId>
      <ContainerGroups>
            <Discount>9</Discount>
            <ResourceGroupId>rg-8db03793gfrz****</ResourceGroupId>
            <Memory>4.0</Memory>
            <Cpu>2.0</Cpu>
            <TenantSecurityGroupId>sg-xxx</TenantSecurityGroupId>
            <FailedTime>2018-08-02T15:00:00Z</FailedTime>
            <IntranetIp>10.21.1.1</IntranetIp>
            <ContainerGroupName>test</ContainerGroupName>
            <RamRoleName>ram:PassRole</RamRoleName>
            <InternetIp>21.3.43.4</InternetIp>
            <ExpiredTime>2018-08-02T15:00:00Z</ExpiredTime>
            <InstanceType>ecs.g5.large</InstanceType>
            <SpotStrategy>NoSpot</SpotStrategy>
            <Ipv6Address>CDCD:0000:0000:0000:8475:1111:3900:2020=CDCD::8475:1111:3900:2020</Ipv6Address>
            <TenantEniIp>10.10.*.*</TenantEniIp>
            <Status>Running</Status>
            <ZoneId>cn-hangzhou-h</ZoneId>
            <SucceededTime>2019-12-11T04:33:42Z</SucceededTime>
            <SecurityGroupId>sg-bp12ujq5zpxuyjfo3o8r</SecurityGroupId>
            <VSwitchId>vsw-bp1vzjjflab6wvjox****</VSwitchId>
            <RestartPolicy>Never</RestartPolicy>
            <TenantEniInstanceId>i-xxx</TenantEniInstanceId>
            <TenantVSwitchId>vsw-xxx</TenantVSwitchId>
            <VpcId>vpc-1vzjjflab6wvjox****</VpcId>
            <EniInstanceId>eni-bp14rzqi6fd8satm****</EniInstanceId>
            <CreationTime>2018-08-02T15:00:00Z</CreationTime>
            <ContainerGroupId>eci-bp1jrgfqqy54kg5hc****</ContainerGroupId>
            <RegionId>cn-hangzhou</RegionId>
            <EphemeralStorage>20</EphemeralStorage>
            <Containers>
                  <RestartCount>0</RestartCount>
                  <Ready>true</Ready>
                  <WorkingDir>/usr/local/nginx</WorkingDir>
                  <ImagePullPolicy>Always</ImagePullPolicy>
                  <Memory>2.0</Memory>
                  <Tty>false</Tty>
                  <Cpu>2.0</Cpu>
                  <Image>mysql</Image>
                  <Gpu>1</Gpu>
                  <StdinOnce>true</StdinOnce>
                  <Stdin>true</Stdin>
                  <Name>nginx</Name>
                  <EnvironmentVars>
                        <Value>/usr/bin/</Value>
                        <Key>PATH</Key>
                        <ValueFrom>
                              <FieldRef>
                                    <FieldPath>status.podIP</FieldPath>
                              </FieldRef>
                        </ValueFrom>
                  </EnvironmentVars>
                  <Ports>
                        <Port>8080</Port>
                        <Protocol>TCP</Protocol>
                  </Ports>
                  <VolumeMounts>
                        <ReadOnly>false</ReadOnly>
                        <MountPath>/usr/share/</MountPath>
                        <MountPropagation>None</MountPropagation>
                        <Name>test-empty</Name>
                  </VolumeMounts>
                  <Commands>[/bin/sh echo]</Commands>
                  <Args>["hello"]</Args>
                  <PreviousState>
                        <Signal>1</Signal>
                        <Message>Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)</Message>
                        <FinishTime>2018-08-02T15:00:00Z	</FinishTime>
                        <State>Terminated</State>
                        <ExitCode>0</ExitCode>
                        <StartTime>2018-08-02T15:00:00Z	</StartTime>
                        <DetailStatus>working</DetailStatus>
                        <Reason>Completed</Reason>
                  </PreviousState>
                  <CurrentState>
                        <Signal>1</Signal>
                        <Message>Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)</Message>
                        <FinishTime>2018-08-02T15:00:00Z	</FinishTime>
                        <State>Terminated</State>
                        <ExitCode>0</ExitCode>
                        <StartTime>2019-12-19T12:05:02Z</StartTime>
                        <DetailStatus>working</DetailStatus>
                        <Reason>Started</Reason>
                  </CurrentState>
                  <ReadinessProbe>
                        <TimeoutSeconds>5</TimeoutSeconds>
                        <InitialDelaySeconds>5</InitialDelaySeconds>
                        <PeriodSeconds>1</PeriodSeconds>
                        <FailureThreshold>3</FailureThreshold>
                        <SuccessThreshold>1</SuccessThreshold>
                        <Execs>["/bin/sh", "-c", "echo Hello world &gt; /usr/share/message"]</Execs>
                        <HttpGet>
                              <Path>/usr/local</Path>
                              <Scheme>HTTP</Scheme>
                              <Port>8080</Port>
                        </HttpGet>
                        <TcpSocket>
                              <Port>8888</Port>
                              <Host>1.2.3.4</Host>
                        </TcpSocket>
                  </ReadinessProbe>
                  <LivenessProbe>
                        <TimeoutSeconds>10</TimeoutSeconds>
                        <InitialDelaySeconds>10</InitialDelaySeconds>
                        <PeriodSeconds>5</PeriodSeconds>
                        <FailureThreshold>3</FailureThreshold>
                        <SuccessThreshold>1</SuccessThreshold>
                        <Execs>["/bin/sh", "-c", "echo Hello world &gt; /usr/share/message"]</Execs>
                        <HttpGet>
                              <Path>/usr/nginx/</Path>
                              <Scheme>HTTP</Scheme>
                              <Port>80</Port>
                        </HttpGet>
                        <TcpSocket>
                              <Port>80</Port>
                              <Host>1.2.3.4</Host>
                        </TcpSocket>
                  </LivenessProbe>
                  <SecurityContext>
                        <RunAsUser>1000</RunAsUser>
                        <ReadOnlyRootFilesystem>true</ReadOnlyRootFilesystem>
                        <Capability>
                              <Adds>[NET_ADMIN]</Adds>
                        </Capability>
                  </SecurityContext>
            </Containers>
            <HostAliases>
                  <Ip>42.101.1.10</Ip>
                  <Hostnames>['hehe.com', 'haha.com']</Hostnames>
            </HostAliases>
            <InitContainers>
                  <RestartCount>5</RestartCount>
                  <Ready>true</Ready>
                  <WorkingDir>/usr/test</WorkingDir>
                  <ImagePullPolicy>Always</ImagePullPolicy>
                  <Memory>2.0</Memory>
                  <Cpu>1.0</Cpu>
                  <Image>nginx</Image>
                  <Gpu>1</Gpu>
                  <Name>Init-xxx</Name>
                  <EnvironmentVars>
                        <Value>/usr/local/bin</Value>
                        <Key>PATH</Key>
                        <ValueFrom>
                              <FieldRef>
                                    <FieldPath>status.podIP</FieldPath>
                              </FieldRef>
                        </ValueFrom>
                  </EnvironmentVars>
                  <Ports>
                        <Port>8888</Port>
                        <Protocol>TCP</Protocol>
                  </Ports>
                  <VolumeMounts>
                        <ReadOnly>false</ReadOnly>
                        <MountPath>/usr/share/</MountPath>
                        <MountPropagation>None</MountPropagation>
                        <Name>test-empty</Name>
                  </VolumeMounts>
                  <Command>[/bin/sh echo]</Command>
                  <Args>['hello world']</Args>
                  <PreviousState>
                        <Signal>1</Signal>
                        <Message>Started container</Message>
                        <FinishTime>2019-12-24T05:35:44Z</FinishTime>
                        <State>Terminated</State>
                        <ExitCode>0</ExitCode>
                        <StartTime>2019-12-24T05:35:44Z</StartTime>
                        <DetailStatus>working</DetailStatus>
                        <Reason>completed</Reason>
                  </PreviousState>
                  <CurrentState>
                        <Signal>1</Signal>
                        <Message>Created container</Message>
                        <FinishTime>2018-08-02T15:00:00Z	</FinishTime>
                        <State>Running</State>
                        <ExitCode>0</ExitCode>
                        <StartTime>2018-08-02T15:00:00Z	</StartTime>
                        <DetailStatus>working</DetailStatus>
                        <Reason>Started</Reason>
                  </CurrentState>
                  <SecurityContext>
                        <RunAsUser>1557</RunAsUser>
                        <ReadOnlyRootFilesystem>true</ReadOnlyRootFilesystem>
                        <Capability>
                              <Adds>NET_ADMIN</Adds>
                        </Capability>
                  </SecurityContext>
            </InitContainers>
            <Volumes>
                  <NFSVolumePath>/eci</NFSVolumePath>
                  <Type>EmptyDirVolume</Type>
                  <FlexVolumeDriver>flexvolume</FlexVolumeDriver>
                  <FlexVolumeFsType>ntfs</FlexVolumeFsType>
                  <DiskVolumeDiskId>d-xxxx</DiskVolumeDiskId>
                  <FlexVolumeOptions>[nolock,tcp,noresvport]</FlexVolumeOptions>
                  <NFSVolumeServer>0eafxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com</NFSVolumeServer>
                  <DiskVolumeFsType>xfs</DiskVolumeFsType>
                  <NFSVolumeReadOnly>false</NFSVolumeReadOnly>
                  <Name>test-empty</Name>
                  <ConfigFileVolumeConfigFileToPaths>
                        <Path>/usr/bin/</Path>
                        <Content>hello world</Content>
                  </ConfigFileVolumeConfigFileToPaths>
            </Volumes>
            <Events>
                  <Type>Normal</Type>
                  <LastTimestamp>2018-08-02T15:00:00Z</LastTimestamp>
                  <Message>Started container</Message>
                  <FirstTimestamp>2018-08-02T15:00:00Z</FirstTimestamp>
                  <Count>20</Count>
                  <Reason>Created</Reason>
                  <Name>test-xxx</Name>
            </Events>
            <Tags>
                  <Value>test-xh</Value>
                  <Key>name</Key>
            </Tags>
            <DnsConfig>
                  <Options>
                        <Value>value</Value>
                        <Name>name</Name>
                  </Options>
                  <NameServers>[10.2.*.*]</NameServers>
                  <Searches>[svc.local.kubenetes]</Searches>
            </DnsConfig>
            <EciSecurityContext>
                  <Sysctls>
                        <Value>65536</Value>
                        <Name>kernel.msgmax</Name>
                  </Sysctls>
            </EciSecurityContext>
      </ContainerGroups>
</DescribeContainerGroupsResponse>

JSON格式

{
	"TotalCount": "19",
	"NextToken": "d78f2dd8-5979-42fe-****-b16db43be5bc",
	"RequestId": "89945DD3-9072-47D0-A318-353284CFC7B3",
	"ContainerGroups": [{
		"Discount": "9",
		"ResourceGroupId": "rg-8db03793gfrz****",
		"Memory": "4.0",
		"Cpu": "2.0",
		"TenantSecurityGroupId": "sg-xxx",
		"FailedTime": "2018-08-02T15:00:00Z",
		"IntranetIp": "10.21.1.1",
		"ContainerGroupName": "test",
		"RamRoleName": "ram:PassRole",
		"InternetIp": "21.3.43.4",
		"ExpiredTime": "2018-08-02T15:00:00Z",
		"InstanceType": "ecs.g5.large",
		"SpotStrategy": "NoSpot",
		"Ipv6Address": "CDCD:0000:0000:0000:8475:1111:3900:2020=CDCD::8475:1111:3900:2020",
		"TenantEniIp": "10.10.*.*",
		"Status": "Running",
		"ZoneId": "cn-hangzhou-h",
		"SucceededTime": "2019-12-11T04:33:42Z",
		"SecurityGroupId": "sg-bp12ujq5zpxuyjfo3o8r",
		"VSwitchId": "vsw-bp1vzjjflab6wvjox****",
		"RestartPolicy": "Never",
		"TenantEniInstanceId": "i-xxx",
		"TenantVSwitchId": "vsw-xxx",
		"VpcId": "vpc-1vzjjflab6wvjox****",
		"EniInstanceId": "eni-bp14rzqi6fd8satm****",
		"CreationTime": "2018-08-02T15:00:00Z",
		"ContainerGroupId": "eci-bp1jrgfqqy54kg5hc****",
		"RegionId": "cn-hangzhou",
		"EphemeralStorage": "20",
		"Containers": [{
			"RestartCount": "0",
			"Ready": "true",
			"WorkingDir": "/usr/local/nginx",
			"ImagePullPolicy": "Always",
			"Memory": "2.0",
			"Tty": "false",
			"Cpu": "2.0",
			"Image": "mysql",
			"Gpu": "1",
			"StdinOnce": "true",
			"Stdin": "true",
			"Name": "nginx",
			"EnvironmentVars": [{
				"Value": "/usr/bin/",
				"Key": "PATH",
				"ValueFrom": {
					"FieldRef": {
						"FieldPath": "status.podIP"
					}
				}
			}],
			"Ports": [{
				"Port": "8080",
				"Protocol": "TCP"
			}],
			"VolumeMounts": [{
				"ReadOnly": "false",
				"MountPath": "/usr/share/",
				"MountPropagation": "None",
				"Name": "test-empty"
			}],
			"Commands": "[/bin/sh echo]",
			"Args": "[\"hello\"]",
			"PreviousState": {
				"Signal": "1",
				"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
				"FinishTime": "2018-08-02T15:00:00Z\t",
				"State": "Terminated",
				"ExitCode": "0",
				"StartTime": "2018-08-02T15:00:00Z\t",
				"DetailStatus": "working",
				"Reason": "Completed"
			},
			"CurrentState": {
				"Signal": "1",
				"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
				"FinishTime": "2018-08-02T15:00:00Z\t",
				"State": "Terminated",
				"ExitCode": "0",
				"StartTime": "2019-12-19T12:05:02Z",
				"DetailStatus": "working",
				"Reason": "Started"
			},
			"ReadinessProbe": {
				"TimeoutSeconds": "5",
				"InitialDelaySeconds": "5",
				"PeriodSeconds": "1",
				"FailureThreshold": "3",
				"SuccessThreshold": "1",
				"Execs": "[\"/bin/sh\", \"-c\", \"echo Hello world > /usr/share/message\"]",
				"HttpGet": {
					"Path": "/usr/local",
					"Scheme": "HTTP",
					"Port": "8080"
				},
				"TcpSocket": {
					"Port": "8888",
					"Host": "1.2.3.4"
				}
			},
			"LivenessProbe": {
				"TimeoutSeconds": "10",
				"InitialDelaySeconds": "10",
				"PeriodSeconds": "5",
				"FailureThreshold": "3",
				"SuccessThreshold": "1",
				"Execs": "[\"/bin/sh\", \"-c\", \"echo Hello world > /usr/share/message\"]",
				"HttpGet": {
					"Path": "/usr/nginx/",
					"Scheme": "HTTP",
					"Port": "80"
				},
				"TcpSocket": {
					"Port": "80",
					"Host": "1.2.3.4"
				}
			},
			"SecurityContext": {
				"RunAsUser": "1000",
				"ReadOnlyRootFilesystem": "true",
				"Capability": {
					"Adds": "[NET_ADMIN]"
				}
			}
		}],
		"HostAliases": [{
			"Ip": "42.101.1.10",
			"Hostnames": "['hehe.com', 'haha.com']"
		}],
		"InitContainers": [{
			"RestartCount": "5",
			"Ready": "true",
			"WorkingDir": "/usr/test",
			"ImagePullPolicy": "Always",
			"Memory": "2.0",
			"Cpu": "1.0",
			"Image": "nginx",
			"Gpu": "1",
			"Name": "Init-xxx",
			"EnvironmentVars": [{
				"Value": "/usr/local/bin",
				"Key": "PATH",
				"ValueFrom": {
					"FieldRef": {
						"FieldPath": "status.podIP"
					}
				}
			}],
			"Ports": [{
				"Port": "8888",
				"Protocol": "TCP"
			}],
			"VolumeMounts": [{
				"ReadOnly": "false",
				"MountPath": "/usr/share/",
				"MountPropagation": "None",
				"Name": "test-empty"
			}],
			"Command": "[/bin/sh echo]",
			"Args": "['hello world']",
			"PreviousState": {
				"Signal": "1",
				"Message": "Started container",
				"FinishTime": "2019-12-24T05:35:44Z",
				"State": "Terminated",
				"ExitCode": "0",
				"StartTime": "2019-12-24T05:35:44Z",
				"DetailStatus": "working",
				"Reason": "completed"
			},
			"CurrentState": {
				"Signal": "1",
				"Message": "Created container",
				"FinishTime": "2018-08-02T15:00:00Z\t",
				"State": "Running",
				"ExitCode": "0",
				"StartTime": "2018-08-02T15:00:00Z\t",
				"DetailStatus": "working",
				"Reason": "Started"
			},
			"SecurityContext": {
				"RunAsUser": "1557",
				"ReadOnlyRootFilesystem": "true",
				"Capability": {
					"Adds": "NET_ADMIN"
				}
			}
		}],
		"Volumes": [{
			"NFSVolumePath": "/eci",
			"Type": "EmptyDirVolume",
			"FlexVolumeDriver": "flexvolume",
			"FlexVolumeFsType": "ntfs",
			"DiskVolumeDiskId": "d-xxxx",
			"FlexVolumeOptions": "[nolock,tcp,noresvport]",
			"NFSVolumeServer": "0eafxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com",
			"DiskVolumeFsType": "xfs",
			"NFSVolumeReadOnly": "false",
			"Name": "test-empty",
			"ConfigFileVolumeConfigFileToPaths": [{
				"Path": "/usr/bin/",
				"Content": "hello world"
			}]
		}],
		"Events": [{
			"Type": "Normal",
			"LastTimestamp": "2018-08-02T15:00:00Z",
			"Message": "Started container",
			"FirstTimestamp": "2018-08-02T15:00:00Z",
			"Count": "20",
			"Reason": "Created",
			"Name": "test-xxx"
		}],
		"Tags": [{
			"Value": "test-xh",
			"Key": "name"
		}],
		"DnsConfig": {
			"Options": [{
				"Value": "value",
				"Name": "name"
			}],
			"NameServers": "[10.2.*.*]",
			"Searches": "[svc.local.kubenetes]"
		},
		"EciSecurityContext": {
			"Sysctls": [{
				"Value": "65536",
				"Name": "kernel.msgmax"
			}]
		}
	}]
}

错误码

访问错误中心查看更多错误码。