描述
查询所有实例的详细信息。
名称 | 类型 | 是否必须 | 描述 |
Action | String | 是 | 系统规定参数。取值:DescribeInstances |
RegionId | String | 是 | 地域 ID。 |
VpcId | String | 否 | 专有网络 ID。 |
VSwitchId | String | 否 | 交换机 ID。 |
ZoneId | String | 否 | 可用区 ID。 |
InstanceIds | String | 否 | 实例的编号列表。参数为一个带有格式的 Json Array:[“i-xxxxxxxxx”, ”i-yyyyyyyyy”, … “i-zzzzzzzzz”],最多 100 个 ID,用半角逗号字符隔开。 |
InstanceType | String | 否 | 实例的规格。 |
InstanceTypeFamily | String | 否 | 实例的规格族。 |
InstanceNetworkType | String | 否 | 实例网络类型。 |
PrivateIpAddresses | String | 否 | VPC 网络类型实例的私有 IP 列表。当 NetworkType 为 VPC 时,这个参数生效.参数为一个带有格式的 Json Array:[“172.16.1.1”, “172.16.2.1”, … “172.16.10.1”],最多 100 个 IP,用半角逗号字符隔开。 |
InnerIpAddresses | String | 否 | 经典网络类型实例的内网 IP 列表。当 NetworkType 为 Classic 时,这个参数生效。参数为一个带有格式的 Json Array:[“10.1.1.1”, ”10.1.2.1”, … “10.1.10.1”],最多 100 个 IP,用半角逗号字符隔开。 |
PublicIpAddresses | String | 否 | 经典网络类型实例的公网 IP 列表。当 NetworkType 为 Classic 时,这个参数生效。参数为一个带有格式的 Json Array:[“42.1.1.1”, ”42.1.2.1”, … “42.1.10.1”],最多 100 个 IP,用半角逗号字符隔开。 |
SecurityGroupId | String | 否 | 实例所属的安全组。 |
InstanceChargeType | String | 否 | 实例的付费方式。取值范围:
|
SpotStrategy | String | 否 | 后付费实例的竞价策略 当InstanceChargeType为PostPay时为生效,可选取值为: NoSpot,正常按量付费实例; SpotWithPriceLimit,设置上限价格的竞价实例; SpotAsPriceGo 系统自动出价,最高按量付费价格。默认值为NoSpot |
InternetChargeType | String | 否 | 网络计费类型。取值范围:
|
InstanceName | String | 否 | 实例名称。 |
ImageId | String | 否 | 镜像 ID。 |
DeploymentSetId | String | 否 | 部署集 ID。 |
Status | String | 否 | 实例状态。取值范围:
|
IoOptimized | String | 否 | 是否是 I/O 优化型实例。取值范围:
|
Tag.n.Key | String | 否 | 标签 key。n 的取值范围:[1, 5]不允许为空字符串。 |
Tag.n.Value | String | 否 | 标签 value。n 的取值范围:[1, 5]允许为空字符串。 |
PageNumber | Integer | 否 | 实例状态列表的页码,起始值为 1。默认值:1 |
PageSize | Integer | 否 | 分页查询时设置的每页行数,最大值为 100 行。默认值:10 |
名称 | 类型 | 描述 |
TotalCount | Integer | 实例总个数 |
PageNumber | Integer | 实例列表的页码 |
PageSize | Integer | 输入时设置的每页行数 |
Instances | InstanceAttributesType | 由 InstanceAttributesType 组成的数组格式,返回实例的信息 |
错误代码 | 描述 | Http 状态码 | 语义 |
InvalidInstanceChargeType.NotFound | The InstanceChargeType does not exist in our records. | 404 | 指定的 InstanceChargeType 不存在。 |
InvalidInternetChargeType.ValueNotSupported | The specified InternetChargeType is not valid | 404 | 指定的 InternetChargeType 不存在。 |
InvalidNetworkType.NotFound | The specified InstanceNetworkType is not found | 404 | 指定的 InstanceNetworkType 不存在。 |
InvalidStatus.NotFound | The specified Status is not found | 404 | 指定的 Status 不存在。 |
InvalidTag.Mismatch | The specified Tag.n.Key and Tag.n.Value are not match. | 400 | 指定的 Tag.n.Key 和 Tag.n.Value 不匹配。 |
InvalidTagCount | The specified tags are beyond the permitted range. | 400 | 指定的 Tag 数超过了 5 个。 |
https://ecs.aliyuncs.com/?Action=DescribeInstances
&RegionId=cn-hangzhou
&<公共请求参数>
返回示例
XML格式
<DescribeInstancesResponse>
<CreationTime>2014-09-21T01:12:35Z</CreationTime>
<DeviceAvailable>true</DeviceAvailable>
<Description></Description>
<EipAddress>
<AllocationId></AllocationId>
<InternetChargeType></InternetChargeType>
<IpAddress></IpAddress>
</EipAddress>
<ExpiredTime>2011-09-08T16:00Z</ExpiredTime>
<HostName>iZ25skktcp4Z</HostName>
<ImageId>ubuntu1404_64_20G_aliaegis_20140703.vhd</ImageId>
<InnerIpAddress></InnerIpAddress>
<InstanceChargeType>PostPaid</InstanceChargeType>
<IpAddress></IpAddress>
<InstanceId>i-25skktcp4</InstanceId>
<InstanceName>iZ25skktcp4Z</InstanceName>
<InstanceNetworkType>vpc</InstanceNetworkType>
<InstanceType>ecs.t1.xsmall</InstanceType>
<InternetChargeType></InternetChargeType>
<InternetMaxBandwidthIn>-1</InternetMaxBandwidthIn>
<InternetMaxBandwidthOut></InternetMaxBandwidthOut>
<IoOptimized>false</IoOptimized>
<OperationLocks>
<LockReason></LockReason>
</OperationLocks>
<PublicIpAddress>
<IpAddress></IpAddress>
</PublicIpAddress>
<RegionId>cn-beijing</RegionId>
<SecurityGroupIds>
<SecurityGroupId>sg-25am0n4q0</SecurityGroupId>
</SecurityGroupIds>
<SerialNumber>51d1353b-22bf-4567-a176-8b3e12e43135</SerialNumber>
<Status>Running</Status>
<VlanId></VlanId>
<VpcAttributes>
<NatIpAddress>10.175.68.212</NatIpAddress>
<PrivateIpAddress>
<IpAddress>192.168.2.3</IpAddress>
</PrivateIpAddress>
<VSwitchId>vsw-25gbsqby3</VSwitchId>
<VpcId>vpc-25onv3oi4</VpcId>
</VpcAttributes>
<ZoneId>cn-beijing-a</ZoneId>
</DescribeInstancesResponse>
JSON格式
{
"Instances": {
"Instance": [
{
"CreationTime": "2015-07-27T07:08Z",
"DeviceAvailable": true,
"EipAddress": {},
"ExpiredTime": "2011-09-08T16:00Z",
"HostName": "iZ94t3s0jxkZ",
"ImageId": "centos6u5_64_20G_aliaegis_20150130.vhd",
"InnerIpAddress": {
"IpAddress": [
"10.170.106.80"
]
},
"InstanceChargeType": "PostPaid",
"InstanceId": "i-94t3s0jxk",
"InstanceName": "dd\u6027\u80fd\u6d4b\u8bd5",
"InstanceNetworkType": "classic",
"InstanceType": "ecs.s2.large",
"InternetChargeType": "PayByTraffic",
"InternetMaxBandwidthIn": -1,
"InternetMaxBandwidthOut": 1,
"IoOptimized": false,
"OperationLocks": {
"LockReason": []
},
"PublicIpAddress": {
"IpAddress": [
"120.25.13.106"
]
},
"RegionId": "cn-shenzhen",
"SecurityGroupIds": {
"SecurityGroupId": [
"sg-94kd0cyg0"
]
},
"SerialNumber": "51d1353b-22bf-4567-a176-8b3e12e43135",
"Status": "Running",
"VpcAttributes": {
"PrivateIpAddress": {
"IpAddress": []
}
},
"ZoneId": "cn-shenzhen-a"
}
]
},
"PageNumber": 1,
"PageSize": 10,
"RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
"TotalCount": 1
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
你好,我是AI助理
可以解答问题、推荐解决方案等