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 |
ProjectId.N |
Array of Integer |
否 |
项目ID,为空时查询所有项目下的实例资源 |
返回参数
参数 |
类型 |
描述 |
RequestId |
String |
请求ID |
MaxResults |
Integer |
单词调用返回的最大实例数 |
Marker |
Integer |
分页标识,如果调用未返回全部实例,标记下次调用的返回值的起点,如果已返回全部实例,则其值为0 |
TotalCount |
Integer |
查询结果数目 |
ContainerGroups |
Array of ContainerGroup |
容器组信息 |
ContainerGroup
参数 |
类型 |
描述 |
ContainerGroupId |
String |
容器组ID |
ContainerGroupName |
String |
容器组名称 |
AvailabilityZone |
String |
容器组所在可用区 |
KciType |
String |
容器实例类型 |
ChargeType |
String |
容器组计费方式 |
ProjectId |
Long |
容器组的项目ID |
InstanceType |
String |
容器实例底层云主机的套餐 |
NetworkInterfaceAttributes |
Array of NetworkInterfaceAttribute |
网卡信息 |
Cpu |
Float |
容器组的Cpu,单位:核 |
Memory |
Float |
容器组的内存,单位Gi |
Gpu |
Integer |
容器组的Gpu,单位:卡 |
CreateTime |
String |
容器组创建时间 |
RestartPolicy |
String |
容器组重启策略 |
Status |
String |
容器组状态 |
SucceededTime |
String |
容器组成功时间 |
Volumes |
Array of Volume |
数据卷信息 |
DnsConfig |
DnsConfig数据类型 |
DNS配置 |
HostAliases |
Array of HostAliase |
HostAliase信息 |
Containers |
Array of Container |
容器信息 |
Events |
Array of Event |
容器组的事件信息 |
RetainIp |
Boolean |
容器组是否开启固定IP功能 |
RetainIpHours |
String |
固定IP的保留时长 |
NetworkInterfaceAttribute
参数 |
类型 |
描述 |
NetworkInterfaceId |
String |
网卡ID |
NetworkInterfaceType |
String |
网卡类型,主网卡(primary)、从网卡(extension) |
VpcId |
String |
网卡所在的VPC ID |
SubnetId |
String |
网卡所在的子网ID |
PrivateIpAddress |
String |
网卡的私有IP地址 |
PublicIp |
String |
网卡的公网IP地址 |
MacAddress |
String |
网卡的Mac地址 |
SecurityGroups |
Array of SecurityGroup |
安全组信息 |
SecurityGroup
参数 |
类型 |
是否必选 |
SecurityGroupId |
String |
安全组ID |
Volume
参数 |
类型 |
描述 |
Type |
String |
存储卷的类型 |
Name |
String |
存储卷的名称 |
EBSVolume |
EBSVolume数据类型 |
EBSVolume信息 |
NFSVolume |
NFSVolume数据类型 |
NFSVolume存储卷信息 |
EBSVolume
参数 |
类型 |
描述 |
FsType |
String |
文件系统类型 |
VolumeId |
String |
云硬盘ID |
NFSVolume
参数 |
类型 |
描述 |
Server |
String |
Server地址 |
Path |
String |
nfs文件路径 |
ReadOnly |
Boolean |
默认值false |
Options |
Array of string |
其他的挂载参数 |
Container
参数 |
类型 |
描述 |
Name |
String |
容器名称 |
Cpu |
Float |
cpu,单位:核 |
Memory |
Float |
内存大小,单位:Gi |
Image |
String |
镜像 |
ImagePullPolicy |
String |
镜像拉取策略。取值范围: - Alway:总是拉取。每次都拉取镜像。 - IfNotPresent:按需拉取。优先使用本地镜像,本地没有镜像时则拉取镜像。 - Never:从不拉取。使用本地镜像,不拉取镜像。 |
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 |
- |
HostAliase
参数 |
类型 |
描述 |
Hostnames |
Array of String |
主机名 |
Ip |
String |
IP地址 |
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": "1f0b6c93-bcb9-475d-a3762dxxxxxx",
"MaxResults": 20,
"Marker": 0,
"TotalCount": 1,
"ContainerGroups": [
{
"ContainerGroupId": "f8cba191-c9ff-40ff-f24209xxxxxx",
"ContainerGroupName": "nginx-rbkci",
"AvailabilityZone": "cn-beijing-6a",
"ChargeType": "HourlyInstantSettlement",
"NetworkInterfaceAttributes": [
{
"NetworkInterfaceId": "b3888b4a-be14-4f81-4dbae1xxxxxx",
"NetworkInterfaceType": "primary",
"VpcId": "e8529d17-7015-48ef-36dd25xxxxxx",
"SubnetId": "d9b2b914-1533-4299-563a36xxxxxx",
"PrivateIpAddress": "10.0.xx.xx",
"PublicIp": "120.92.xx.xx",
"MacAddress": "fa:16:3e:1d:xx:xx",
"SecurityGroups": [
{
"SecurityGroupId": "30c47f6e-51ac-4fc3-2b7303xxxxxx"
}
]
}
],
"Cpu": 2,
"Memory": 4,
"Gpu": null,
"CreateTime": "2023-02-27 16:45:23",
"RestartPolicy": "Always",
"Status": "Running",
"SucceededTime": null,
"Volumes": null,
"DnsConfig": null,
"Containers": [
{
"Name": "nginx",
"Commands": [],
"Args": [],
"EnvironmentVars": null,
"Cpu": null,
"Memory": null,
"Gpu": null,
"WorkingDir": null,
"Image": "hub.kce.ksyun.com/ksyun/nginx:latest",
"ImagePullPolicy": "IfNotPresent",
"LivenessProbe": null,
"ReadinessProbe": null,
"Ports": [
{
"Protocol": "TCP",
"Port": 80
}
],
"VolumeMounts": null,
"RestartCount": 0,
"CurrentState": {
"StartTime": "2023-02-27T08:46:08Z",
"FinishTime": null,
"State": "running",
"Reason": null,
"ExitCode": null
},
"PreviousState": null,
"Events": null
}
],
"Events": null,
"Labels": [
{
"Key": "cluster-id",
"Value": null
},
{
"Key": "namespace",
"Value": null
},
{
"Key": "node-name",
"Value": null
},
{
"Key": "pod-name",
"Value": null
}
],
"HostAliases": null,
"IngressBandwidth": null,
"EgressBandwidth": null,
"InstanceType": "N3.2B",
"KciType": "RBKCI",
"KciMode": "STANDALONE",
"ProjectId": 0,
"RetainIp": null,
"RetainIpHours": null
}
]
}