描述实例信息

最近更新时间:2019-05-13 14:56:48

DescribeInstances(描述实例信息)

主网卡信息直接在返回值中体现;

NetworkInterfaceSet体现所有网卡的信息;

Request Parameters(请求参数)

MaxResults

  • 单次调用所返回的最大实例数目,取值为5~1000,超过1000记为1000
  • 类型: Integer
  • 缺省: 10
  • 是否可缺省: 是

Marker

  • 分页标识,单次调用未返回全部实例时,标记下次调用的返回值的起点,默认值是0
  • 类型: Integer
  • 是否可缺省: 是

InstanceId.N(N的范围为1-100)

  • 待返回描述信息的实例ID列表
  • 类型: String 列表
  • 缺省: 返回全部实例描述信息
  • 是否可缺省: 是

ProjectId.N(N的范围为1-100)

  • 待返回实例信息的项目ID列表
  • 类型:Long列表
  • 是否可缺省:是
  • 缺省:默认项目

Filter.N(N的范围为1-100)

  • 一个或者多个过滤器
  • 类型: 过滤器(Filter)列表
  • 有效值:支持如下过滤器名称
    • instance-id 实例ID
    • subnet-id 子网ID
    • vpc-id vpc ID
    • network-interface.subnet-id 网络接口关联的子网ID
    • network-interface.network-interface-id 网络接口的ID
    • network-interface.group-id 网络接口关联的安全组ID
    • instance-state.name-实例状态
    • availability-zone.name 可用区(AvailabilityZone)名字(规划中)
  • 是否可缺省: 是

Sort

  • 筛选器
  • 类型: 筛选器(Sort)列表
  • 有效值:支持如下筛选器名称
  • InstanceName –主机名称
  • CreationDate –创建时间
  • PrivateIpAddress - 主机内网IP(主网卡)
  • 是否可缺省:是

Search

  • 搜索条件,模糊匹配,可搜索字段如下:
  • 类型:string
  • 支持字段:实例名(InstanceName)、主网卡私有IP地址(PrivateIpAddress)
  • 是否可缺省:是

Response Elements(返回值)

RequestId

  • 请求ID
  • 类型: String
  • 是否可缺省: 否

Marker

  • 分页标识,如果调用未返回全部实例,标记下次调用的返回值的起点,如果已返回全部实例,则其值为0
  • 类型: Integer
  • 是否可缺省: 否

InstanceCount

  • 实例总数
  • 类型: Integer
  • 是否可缺省: 否

SystemDisk

  • 云主机系统盘配置参数。通用型N2、N3主机支持更换操作系统时指定系统盘大小。
  • 类型:SystemDisk
  • 是否可缺省:是

InstancesSet

  • 实例集合
  • 类型: 实例类型列表
  • 是否可缺省: 否

StoppedMode

  • 关机模式
  • 类型:String
  • KeepCharging (默认参数) 保持计费;StopCharging 停止计费;NotSupported 不支持的实例类型

Examples(例子)

描述cn-beijing-6这个region的实例信息,默认显示10个实例;如果想显示该Region下所有实例,需要增加输入参数MaxResults=1000,即单次调用最多可以显示1000个实例;增加输入参数Marker=0,即单次调用未返回全部实例时,标记下次调用的返回值的起点从0开始;

Sample Request(请求)
http://kec.{{region}}.api.ksyun.com/?Action=DescribeInstances&Version=2016-03-04&MaxResults=1000&Marker=0
Sample Response(返回)
{
    "Marker": 0,
    "InstanceCount": 5,
    "RequestId": "e971a15b-b59a-4477-a655-97c60e35d101",
    "InstancesSet": [
        {
            "InstanceId": "19c61e7e-c604-43ec-b225-3677f4f2eaf6",
            "ProjectId": 0,
            "InstanceName": "SOHO_A",
            "InstanceType": "I1.1A",
            "InstanceConfigure": {
                "VCPU": 1,
                "GPU": 0,
                "MemoryGb": 1,
                "DataDiskGb": 0,
                "RootDiskGb": 20,
                "DataDiskType": "SSD"
            },
            "ImageId": "d6725701-bf67-49a0-90cd-ff9ed0ec3a41",
            "SubnetId": "6c296896-b72a-40fe-8854-4c7673d172fd",
            "PrivateIpAddress": "172.17.11.9",
            "InstanceState": {
                "Name": "active"
            },
            "Monitoring": {
                "State": "enabled"
            },
            "NetworkInterfaceSet": [
                {
                    "NetworkInterfaceId": "1b199937-542e-45a5-990f-bff22b4ac82b",
                    "NetworkInterfaceType": "primary",
                    "VpcId": "6a2459b0-6555-4f55-9179-79b7c119631a",
                    "SubnetId": "6c296896-b72a-40fe-8854-4c7673d172fd",
                    "MacAddress": "fa:16:3e:4d:ca:b3",
                    "PrivateIpAddress": "172.17.11.9",
                    "GroupSet": [
                        {
                            "GroupId": "93d913fe-b6c0-43f6-a4b7-2c9b4f1a5174"
                        }
                    ],
                    "SecurityGroupSet": [
                        {
                            "SecurityGroupId": "93d913fe-b6c0-43f6-a4b7-2c9b4f1a5174"
                        }
                    ]
                }
            ],
            "SriovNetSupport": "false",
            "IsShowSriovNetSupport": false,
            "CreationDate": "2018-08-22T17:56:52Z",
            "AvailabilityZone": "cn-beijing-6a",
            "AvailabilityZoneName": "可用区A",
            "AutoScalingType": "Auto",
            "ProductType": 41,
            "ProductWhat": 1,
            "ChargeType": "PostPaidByHour"
            "SystemDisk": {
                "DiskType": "Local_SSD",
                "DiskSize": 50
        },
        {
            "InstanceId": "30414a24-18c7-4b2d-b808-b2020855b804",
            "ProjectId": 0,
            "InstanceName": "docker_no_delete",
            "InstanceType": "I2.2C",
            "InstanceConfigure": {
                "VCPU": 2,
                "GPU": 0,
                "MemoryGb": 8,
                "DataDiskGb": 50,
                "RootDiskGb": 20,
                "DataDiskType": "SSD"
            },
            "ImageId": "e6c6c90b-ac7e-427f-a3d5-7c27fc1bec17",
            "SubnetId": "7e23b980-11c2-4bb0-9388-9215ac09c539",
            "PrivateIpAddress": "10.0.22.14",
            "InstanceState": {
                "Name": "active"
            },
            "Monitoring": {
                "State": "enabled"
            },
            "NetworkInterfaceSet": [
                {
                    "NetworkInterfaceId": "1aa3c101-03d8-4a20-8478-809d10d592ac",
                    "NetworkInterfaceType": "primary",
                    "VpcId": "31e21dca-c92e-4b06-a8ce-3560afa63462",
                    "SubnetId": "7e23b980-11c2-4bb0-9388-9215ac09c539",
                    "MacAddress": "fa:16:3e:1a:05:fa",
                    "PrivateIpAddress": "10.0.22.14",
                    "GroupSet": [
                        {
                            "GroupId": "d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac"
                        }
                    ],
                    "SecurityGroupSet": [
                        {
                            "SecurityGroupId": "d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac"
                        }
                    ]
                }
            ],
            "SriovNetSupport": "false",
            "IsShowSriovNetSupport": false,
            "CreationDate": "2018-08-02T10:18:49Z",
            "AvailabilityZone": "cn-beijing-6b",
            "AvailabilityZoneName": "可用区B",
            "ProductType": 78,
            "ProductWhat": 1,
            "ChargeType": "Daily",
            "KeySet": [
                "2186e15f-476a-41b6-adc9-dd255a4bcb36"
            ]
        },
        {
            "InstanceId": "4374b3ac-3f0e-44d8-96b9-400291eb31e5",
            "ProjectId": 0,
            "InstanceName": "TestVM-N2",
            "InstanceType": "N2.1A",
            "InstanceConfigure": {
                "VCPU": 1,
                "GPU": 0,
                "MemoryGb": 2,
                "DataDiskGb": 0,
                "RootDiskGb": 20,
                "DataDiskType": "SSD"
            },
            "ImageId": "f7753569-f788-4e59-8f69-348f29a3b4cb",
            "SubnetId": "03f70c27-b567-43fc-8b8b-c789b6cf9b48",
            "PrivateIpAddress": "172.31.20.7",
            "InstanceState": {
                "Name": "active"
            },
            "Monitoring": {
                "State": "enabled"
            },
            "NetworkInterfaceSet": [
                {
                    "NetworkInterfaceId": "79a723d6-12e6-4d8f-9ad8-51606822e2c5",
                    "NetworkInterfaceType": "primary",
                    "VpcId": "571b3641-022c-43d6-9544-828d19cdbb91",
                    "SubnetId": "03f70c27-b567-43fc-8b8b-c789b6cf9b48",
                    "MacAddress": "fa:16:3e:6e:a1:ce",
                    "PrivateIpAddress": "172.31.20.7",
                    "GroupSet": [
                        {
                            "GroupId": "cfbcc927-eafc-4c54-b8c3-4a344fee66dd"
                        }
                    ],
                    "SecurityGroupSet": [
                        {
                            "SecurityGroupId": "cfbcc927-eafc-4c54-b8c3-4a344fee66dd"
                        }
                    ]
                }
            ],
            "SriovNetSupport": "false",
            "IsShowSriovNetSupport": false,
            "CreationDate": "2018-08-29T19:25:53Z",
            "AvailabilityZone": "cn-beijing-6b",
            "AvailabilityZoneName": "可用区B",
            "ProductType": 137,
            "ProductWhat": 1,
            "ChargeType": "Daily",
            "KeySet": [
                "6ba2161e-ee9a-40b8-96b2-8f1b0801d301"
            ]
        },
        {
            "InstanceId": "4e8b5d26-34dd-4a2e-a1e8-93e66f9174db",
            "ProjectId": 0,
            "InstanceName": "docker_no_delete",
            "InstanceType": "I2.2B",
            "InstanceConfigure": {
                "VCPU": 2,
                "GPU": 0,
                "MemoryGb": 4,
                "DataDiskGb": 0,
                "RootDiskGb": 20,
                "DataDiskType": "SSD"
            },
            "ImageId": "e6c6c90b-ac7e-427f-a3d5-7c27fc1bec17",
            "SubnetId": "7e23b980-11c2-4bb0-9388-9215ac09c539",
            "PrivateIpAddress": "10.0.22.10",
            "InstanceState": {
                "Name": "active"
            },
            "Monitoring": {
                "State": "enabled"
            },
            "NetworkInterfaceSet": [
                {
                    "NetworkInterfaceId": "3f5ca8c2-29e0-4eb4-9a9f-f795a8943e46",
                    "NetworkInterfaceType": "primary",
                    "VpcId": "31e21dca-c92e-4b06-a8ce-3560afa63462",
                    "SubnetId": "7e23b980-11c2-4bb0-9388-9215ac09c539",
                    "MacAddress": "fa:16:3e:6a:e5:ff",
                    "PrivateIpAddress": "10.0.22.10",
                    "GroupSet": [
                        {
                            "GroupId": "d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac"
                        }
                    ],
                    "SecurityGroupSet": [
                        {
                            "SecurityGroupId": "d46c7672-7ca9-4f51-bbd9-0e28ccdf3fac"
                        }
                    ]
                }
            ],
            "SriovNetSupport": "false",
            "IsShowSriovNetSupport": false,
            "CreationDate": "2018-08-01T11:44:14Z",
            "AvailabilityZone": "cn-beijing-6b",
            "AvailabilityZoneName": "可用区B",
            "ProductType": 78,
            "ProductWhat": 1,
            "ChargeType": "Daily"
        },
        {
            "InstanceId": "dbef9d6d-a501-40b7-9518-508c7d3bcde3",
            "ProjectId": 0,
            "InstanceName": "SOHO_B",
            "InstanceType": "I1.1A",
            "InstanceConfigure": {
                "VCPU": 1,
                "GPU": 0,
                "MemoryGb": 1,
                "DataDiskGb": 0,
                "RootDiskGb": 20,
                "DataDiskType": "SSD"
            },
            "ImageId": "d3410864-1cf1-418f-9afe-c70aa3fa9cd4",
            "SubnetId": "950a7b88-f072-4d35-a302-975aaa170ad1",
            "PrivateIpAddress": "172.17.12.12",
            "InstanceState": {
                "Name": "active"
            },
            "Monitoring": {
                "State": "enabled"
            },
            "NetworkInterfaceSet": [
                {
                    "NetworkInterfaceId": "da34df08-03cc-4098-a143-64406a0eda50",
                    "NetworkInterfaceType": "primary",
                    "VpcId": "6a2459b0-6555-4f55-9179-79b7c119631a",
                    "SubnetId": "950a7b88-f072-4d35-a302-975aaa170ad1",
                    "MacAddress": "fa:16:3e:29:5c:eb",
                    "PrivateIpAddress": "172.17.12.12",
                    "GroupSet": [
                        {
                            "GroupId": "93d913fe-b6c0-43f6-a4b7-2c9b4f1a5174"
                        }
                    ],
                    "SecurityGroupSet": [
                        {
                            "SecurityGroupId": "93d913fe-b6c0-43f6-a4b7-2c9b4f1a5174"
                        }
                    ]
                }
            ],
            "SriovNetSupport": "false",
            "IsShowSriovNetSupport": false,
            "CreationDate": "2018-08-22T17:51:07Z",
            "AvailabilityZone": "cn-beijing-6b",
            "AvailabilityZoneName": "可用区B",
            "ProductType": 41,
            "ProductWhat": 1,
            "ChargeType": "PostPaidByHour"
        }
    ]
}

金山云,开启您的云计算之旅

注册有礼