查询实例列表

1. 接口描述

调用 DescribeInstances 接口查询实例列表的详细信息。

2. 请求参数

参数名 类型 是否必选 描述
Action String 固定取值:DescribeInstances
RegionCode String 实例所属的地域编码,您可以调用DescribeRegionConfig查看最新的地域列表
PageNumber Integer 实例列表的页码。 起始值:1 默认值:1
PageSize Integer 分页查询时设置的每页行数。 最大值:50 默认值:10

3. 返回数据

参数名 类型 说明
Items Array[ InstanceInfo ] 实例详细信息列表
RequestId String 请求ID
Total Integer 符合条件的实例数量

4. 示例

请求示例

https://openapi.kaopuyun.com/?SignatureVersion=1.0
&Action=DescribeInstances
&Format=JSON
&PageSize=50
&RegionCode=cn-hongkong-3
&SignatureNonce=fad368fd-b5e3-476b-903b-2ef34e0e9fba
&Version=2014-05-26
&AccessKeyId=hfWkfqG6a794
&Signature=IcyHYfUBWSzJauAbDaqniNSNE94=
&SignatureMethod=HMAC-SHA1
&Timestamp=2023-02-25T15:29:21Z

正常返回示例

{
        "RequestId" : "65ac6fe0-b4ea-11ed-8dde-06dde3cb088a",
        "Total" : 21,
        "Items" : [ 
            {
                "EcsStatus" : "STARTED",
                "InstanceUUID" : "ecs-9t0000ffch7d",
                "RegionCode" : "cn-hongkong-3",
                "EcsPendingStatus" : "NONE",
                "Memory" : 4,
                "Cpu" : 2,
                "ExpirationTime" : "2023-04-01 23:59:59",
                "ImageUUID" : "img-d6b2a3f4a208c2001",
                "VpcAttributes" : [ 
                    {
                        "PrivateIpAddress" : {
                            "IpAddress" : "10.231.110.32"
                        }
                    }
                ],
                "InstanceNetworkType" : "PRIVATE_NETWORK",
                "InstanceName" : "web.hk.proxy",
                "SerialNumber" : "ecs-9t0000ffch7d",
                "CreationTime" : "2021-03-17 18:13:36",
                "ZoneCode" : "cn-hongkong-3-a",
                "PublicIpAddresses" : [ 
                    {
                        "IpAddress" : "103.136.251.199"
                    }
                ],
                "DeviceAvailable" : "TRUE",
                "InstanceType" : "ecs.n1.medium",
                "HostName" : "web.hk.proxy"
            }
        ]
}

5. 错误码

错误码 错误信息
MissingParameter RegionCode 参数不能为空
AvailableRegionNotFound 可用的地域找不到
AvailableZoneNotFound 可用的可用区找不到
DescribeInstancesFail 查询实例列表失败:xxx
kaopuyun all right reserved,powered by GitbookUpdated Time: 2024-09-06 07:49:37

results matching ""

    No results matching ""