获取Container实例-DescribeContainerInstance

获取Container实例

Request Parameters

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
Zonestring可用区。参见 可用区列表No
ProjectIdstring项目ID。不填写为默认项目,子帐号必须填写。 请参考GetProjectList接口No
NodeIdstring容器所属节点IDNo
ClusterIdstring容器所属资源池IDNo
ContainerIds.nstring容器IDNo
Offsetint偏移量,默认为0No
Limitint总量限制,默认20,最大值10000No

Response Elements

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
TotalCountint总数Yes
ContainerSetarray容器列表No

ContainerSet

Parameter nameTypeDescriptionRequired
ContainerIdstring容器IDNo
ClusterIdstring集群IDNo
NodeIdstring节点IDNo
Namestring容器名No
Imagestring容器镜像No
Zonestring可用区No
CPUfloatCPU个数No
Memoryint内存容量,MBNo
Cmdstring容器启动命令No
Statestring状态No
IPSetarrayIPNo
CreateTimeintUnix时间戳No
Volumestring容器内挂载的目录No
Enviromentarray环境变量No

EnviromentSet

Parameter nameTypeDescriptionRequired
Keystringkey:val形式No

IPSet

Parameter nameTypeDescriptionRequired
TypestringIP类型 国际:International, BGP:BGP, 内网:PrivateNo
IPIdstringIP资源ID (只在当前IP为外网IP时返回)No
IPstringIP地址No
BandwidthintIP对应的带宽, 单位:Mb (只在当前IP为外网IP时返回)No
VPCIdstringVPCIdNo
SubnetIdstring子网IDNo

Request Example

https://api.ucloud.cn/?Action=DescribeContainerInstance
&Region=cn-bj2
&Zone=cn-bj2-02
&ProjectId=org-xxx
&NodeId=dnode-xxx
&ClusterId=cluster-xxx
&Offset=0
&Limit=100

Response Example

{
    "RetCode": 0,
    "Action": "DescribeContainerInstanceResponse",
    "TotalCount": 2,
    "ContainerSet": [
        {
            "ClusterId": "cluster-xxx",
            "ClusterName": "cluster2",
            "Cmd": "",
            "ComputerDetails": {
                "res_id": "dnode-xxx",
                "all_cpus": 4,
                "all_mem": 8192,
                "vpc_id": "uvnet-xxx",
                "subnet_id": "subnet-xxx"
            },
            "CreateTime": 1529986046,
            "Image": "uhub.service.ucloud.cn/ucloud/centos6-ssh:latest",
            "Name": "service22-pod",
            "NodeId": "dnode-xxx",
            "Parameters": {
                "log-opt": [
                    "max-file=2",
                    "max-size=10M"
                ]
            },
            "PortMap": "",
            "RegionId": 1000001,
            "SvcName": "service22",
            "TaskId": "docker-xxx",
            "Volume": "",
            "Weight": 100,
            "ContainerType": "pod",
            "CPU": 0,
            "Memory": 0,
            "Enviroment": [
                {
                    "TZ": "Asia/Shanghai"
                }
            ],
            "IPSet": [
                {
                    "Type": "Private",
                    "IP": "10.10.xxx.xxx"
                }
            ],
            "Zone": "cn-bj2-02",
            "ContainerId": "docker-xxx",
            "State": "RUNNING"
        },
        {
            "ClusterId": "cluster-xxx",
            "ClusterName": "cluster2",
            "Cmd": "",
            "ComputerDetails": {
                "res_id": "dnode-xxx",
                "all_cpus": 4,
                "all_mem": 8192,
                "vpc_id": "uvnet-xxx",
                "subnet_id": "subnet-xxx"
            },
            "CreateTime": 1529985617,
            "Image": "uhub.service.ucloud.cn/ucloud/centos6-ssh:latest",
            "Name": "Container",
            "NodeId": "dnode-xxx",
            "Parameters": {
                "log-opt": [
                    "max-file=2",
                    "max-size=10M"
                ]
            },
            "PortMap": "",
            "RegionId": 1000001,
            "SvcName": "",
            "TaskId": "docker-xxx",
            "Volume": ":/data",
            "Weight": 0,
            "ContainerType": "container",
            "CPU": 0,
            "Memory": 0,
            "Enviroment": [
                {
                    "TZ": "Asia/Shanghai"
                }
            ],
            "IPSet": [
                {
                    "Type": "Private",
                    "IP": "10.10.xxx.xxx"
                }
            ],
            "Zone": "cn-bj2-02",
            "ContainerId": "docker-xxx",
            "State": "RUNNING"
        }
    ]
}