DescribeContainerGroup(描述容器组)
接口描述
该接口适用于描述容器组
请求方式
POST/GET
输入参数
参数 |
类型 |
是否必选 |
描述 |
ContainerGroupId.N |
String |
否 |
容器组的id |
MaxResults |
Integer |
否 |
单次调用所返回的最大实例数目,默认20,最大100 |
Marker |
Integer |
否 |
分页标识,单次调用未返回全部实例时,标记下次调用的返回值的起点,默认值是0 |
Filter.N |
Filter.N数据类型 |
否 |
一个或者多个过滤器,有效值: 子网id:subnet-id vpc id:vpc-id 可用区名称:availability-zone.name 实例状态:status (仅支持筛选状态为Running、Succeeded、Failed的容器组 |
Search |
String |
否 |
模糊匹配,可以匹配如下字段: 容器组名称:ContainerGroupName 容器组IP:PrivateIpAddress |
返回参数
参数 |
类型 |
描述 |
RequestId |
String |
请求id |
MaxResults |
Integer |
单词调用返回的最大实例数 |
Marker |
Integer |
分页标识,如果调用未返回全部实例,标记下次调用的返回值的起点,如果已返回全部实例,则其值为0 |
TotalCount |
Integer |
查询结果数目 |
ContainerGroups |
Array of ContainerGroup |
容器组信息 |
ContainerGroup
参数 |
类型 |
描述 |
ContainerGroupId |
String |
容器组id |
ContainerGroupName |
String |
容器组名称 |
AvailabilityZone |
String |
容器组所在可用区 |
ChargeType |
String |
容器组计费方式 |
NetworkInterfaceAttributes |
Array of NetworkInterfaceAttribute |
网卡信息 |
Cpu |
Float |
容器组的Cpu,单位:核 |
Memory |
Float |
容器组的内存,单位Gi |
CreateTime |
String |
容器组创建时间 |
RestartPolicy |
String |
容器组重启策略 |
Status |
String |
容器组状态 |
SucceededTime |
String |
容器组成功时间 |
Volumes |
Array of Volume |
数据卷信息 |
DnsConfig |
DnsConfig数据类型 |
dns配置 |
Containers |
Array of Container |
容器信息 |
Events |
Array of Event |
容器组的事件信息 |
NetworkInterfaceAttribute
参数 |
类型 |
描述 |
NetworkInterfaceId |
String |
网卡id |
NetworkInterfaceType |
String |
网卡类型,主网卡(primary)、从网卡(extension) |
VpcId |
String |
网卡所在的VPC id |
SubnetId |
String |
网卡所在的子网id |
PrivateIpAddress |
String |
网卡的私有IP地址 |
MacAddress |
String |
网卡的Mac地址 |
SecurityGroups |
Array of SecurityGroup |
安全组信息 |
SecurityGroup
参数 |
类型 |
是否必选 |
SecurityGroupId |
String |
安全组id |
Volume
参数 |
类型 |
描述 |
Type |
String |
存储卷的类型 |
Name |
String |
存储卷的名称 |
ConfigFileVolume |
ConfigFileVolume数据类型 |
ConfigFileVolume存储卷信息 |
EBSVolume |
EBSVolume数据类型 |
EBSVolume信息 |
ConfigFileVolume
ConfigFileToPath
参数 |
类型 |
描述 |
Path |
String |
挂载路径 |
EBSVolume
参数 |
类型 |
描述 |
FsType |
String |
文件系统类型 |
VolumeId |
String |
云硬盘id |
Container
参数 |
类型 |
描述 |
Name |
String |
容器名称 |
Cpu |
Float |
cpu,单位:核 |
Memory |
Float |
内存大小,单位:Gi |
Image |
String |
镜像 |
Commands |
Array of String |
容器启动命令 |
Args |
Array of String |
容器启动参数 |
EnvironmentVars |
Array of EnvironmentVar |
环境变量 |
WorkingDir |
String |
工作目录 |
Ports |
Array of Port |
端口信息 |
VolumeMounts |
Array of VolumeMount |
数据卷挂载信息 |
RestartCount |
Integer |
重启次数 |
PreviousState |
PreviousState数据类型 |
上一次状态 |
CurrentState |
CurrentState数据类型 |
当前状态 |
EnvironmentVar
参数 |
类型 |
描述 |
Key |
String |
变量名 |
Value |
String |
变量值 |
Port
参数 |
类型 |
描述 |
Port |
Integer |
端口号 |
Protocol |
String |
协议 |
VolumeMount
参数 |
类型 |
描述 |
Name |
String |
数据卷名称 |
MountPath |
String |
挂载路径 |
ReadOnly |
Boolean |
读写权限 |
DnsConfig
参数 |
类型 |
描述 |
NameServers |
Array of String |
DNS 服务器 IP 地址列表 |
Searches |
Array of String |
DNS 搜索域列表 |
Options |
Array of Option |
- |
Option
参数 |
类型 |
描述 |
Name |
String |
对象的Name |
Value |
String |
对象的Value |
Event
参数 |
类型 |
描述 |
FirstTimestamp |
String |
首次出现时间 |
LastTimestamp |
String |
最后出现时间 |
Count |
Integer |
出现次数 |
Type |
String |
类型 |
Reason |
String |
出现原因 |
Message |
String |
详细信息 |
PreviousState
参数 |
类型 |
描述 |
StartTime |
String |
容器运行开始时间 |
FinishTime |
String |
容器运行结束时间 |
State |
String |
容器状态 |
Reason |
String |
状态详情 |
ExitCode |
Integer |
容器退出码 |
CurrentState
参数 |
类型 |
描述 |
StartTime |
String |
容器运行开始时间 |
FinishTime |
String |
容器运行结束时间 |
State |
String |
容器状态 |
Reason |
String |
状态详情 |
ExitCode |
Integer |
容器退出码 |
调用示例
示例1 描述容器组
输入示例
http://kci.api.ksyun.com/?Action=DescribeContainerGroup&Version=2020-07-02
&ContainerGroupId.1=9f0c0be6-f6fe-4e29-af1axxxx
返回示例
{
"RequestId": "709735fe-9e98-42cc-afedxxxx",
"MaxResults": 20,
"Marker": 0,
"TotalCount": 1,
"ContainerGroups": [
{
"ContainerGroupId": "9f0c0be6-f6fe-4e29-af1axxxx",
"ContainerGroupName": "nginx-kci",
"AvailabilityZone": "cn-beijing-6a",
"ChargeType": "HourlyInstantSettlement",
"NetworkInterfaceAttributes": [
{
"NetworkInterfaceId": "f38892ef-8763-439e-xxxx",
"NetworkInterfaceType": "primary",
"VpcId": "31e21dca-c92e-4b06-a8cexxxx",
"SubnetId": "f2ac1919-0e34-4812-8290xxxx",
"PrivateIpAddress": "10.0.0.xx",
"MacAddress": "fa:16:3e:6e:xx:xx",
"SecurityGroups": [
{
"SecurityGroupId": "d46c7672-7ca9xxxx"
}
]
}
],
"Cpu": 2,
"Memory": 4,
"CreateTime": "2020-10-10 11:55:04",
"RestartPolicy": "Always",
"Status": "Running",
"SucceededTime": null,
"Volumes": null,
"DnsConfig": null,
"Containers": [
{
"Name": "nginx-container",
"Commands": [],
"Args": [],
"EnvironmentVars": [],
"Cpu": null,
"Memory": null,
"WorkingDir": null,
"Image": "nginx",
"LivenessProbe": null,
"ReadinessProbe": null,
"Ports": [
{
"Protocol": "TCP",
"Port": 80
}
],
"VolumeMounts": null,
"RestartCount": 0,
"CurrentState": {
"StartTime": "2020-10-10T03:55:12Z",
"FinishTime": null,
"State": "running",
"Reason": null,
"ExitCode": null
},
"PreviousState": null,
"Events": null
}
],
"Events": [
{
"FirstTimestamp": "2020-10-10T03:55:07Z",
"LastTimestamp": "2020-10-10T03:55:07Z",
"Count": 1,
"Type": "Normal",
"Reason": "Pulling",
"Message": "Pulling image \"nginx\""
},
{
"FirstTimestamp": "2020-10-10T03:55:12Z",
"LastTimestamp": "2020-10-10T03:55:12Z",
"Count": 1,
"Type": "Normal",
"Reason": "Pulled",
"Message": "Successfully pulled image \"nginx\""
},
{
"FirstTimestamp": "2020-10-10T03:55:12Z",
"LastTimestamp": "2020-10-10T03:55:12Z",
"Count": 1,
"Type": "Normal",
"Reason": "Created",
"Message": "Created container nginx-container"
},
{
"FirstTimestamp": "2020-10-10T03:55:12Z",
"LastTimestamp": "2020-10-10T03:55:12Z",
"Count": 1,
"Type": "Normal",
"Reason": "Started",
"Message": "Started container nginx-container"
}
]
}
]
}