如何簡便快速的查詢一臺或多臺實例的詳細信息

本篇文章給大家帶來的內容是關于如何簡便快速的查詢一臺或多臺實例的詳細信息,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所幫助。

DescribeInstances

查詢一臺或多臺實例的詳細信息。

描述

請求參數的作用類似于一個過濾器,過濾器為邏輯與(AND)關系。如果某一參數為空,則過濾器不起作用。但是參數InstanceIds如果是一個空JSON數組,即[],則視為該過濾器有效,且返回空。

請求參數

如何簡便快速的查詢一臺或多臺實例的詳細信息

如何簡便快速的查詢一臺或多臺實例的詳細信息

返回參數

如何簡便快速的查詢一臺或多臺實例的詳細信息

示例

請求示例

https://ecs.aliyuncs.com/?Action=DescribeInstances &RegionId=cn-hangzhou & 返回示例

XML格式

<describeinstancesresponse> ??<pagenumber>1</pagenumber> ??<totalcount>6</totalcount> ??<pagesize>10</pagesize> ??<requestid>8EF01A45-FFFA-497B-B5C3-1DE1B74DB32D</requestid> ??<instances> ????<instance> ??????<inneripaddress></inneripaddress> ??????<imageid>ubuntu_16_0402_64_20G_alibase_20170818.vhd</imageid> ??????<instancetypefamily>ecs.g5</instancetypefamily> ??????<vlanid></vlanid> ??????<networkinterfaces> ????????<networkinterface> ??????????<macaddress>00:16:3e:32:b4:dc</macaddress> ??????????<primaryipaddress>172.17.XX.XXX</primaryipaddress> ??????????<networkinterfaceid>eni-2zeh9atclduxvf1zcyal</networkinterfaceid> ????????</networkinterface> ??????</networkinterfaces> ??????<instanceid>XXXXXXXXXXX</instanceid> ??????<eipaddress> ????????<ipaddress></ipaddress> ????????<allocationid></allocationid> ????????<internetchargetype></internetchargetype> ??????</eipaddress> ??????<internetmaxbandwidthin>1000</internetmaxbandwidthin> ??????<zoneid>cn-beijing-e</zoneid> ??????<internetchargetype>PayByBandwidth</internetchargetype> ??????<spotstrategy>NoSpot</spotstrategy> ??????<stoppedmode>Not-applicable</stoppedmode> ??????<serialnumber>d9bd1cdc-624d-4736-9da5-2ba2f741a304</serialnumber> ??????<iooptimized>true</iooptimized> ??????<memory>8192</memory> ??????<cpu>2</cpu> ??????<vpcattributes> ????????<natipaddress></natipaddress> ????????<privateipaddress> ??????????<ipaddress>172.17.XX.XXX</ipaddress> ????????</privateipaddress> ????????<vswitchid>vsw-2zeh0r1pabwtg6wcssgca</vswitchid> ????????<vpcid>vpc-2zeuphj08tt7q3brdb36x</vpcid> ??????</vpcattributes> ??????<internetmaxbandwidthout>1</internetmaxbandwidthout> ??????<deviceavailable>true</deviceavailable> ??????<securitygroupids> ????????<securitygroupid>sg-2ze21r9qb638hvtrvsus</securitygroupid> ??????</securitygroupids> ??????<spotpricelimit>0.0</spotpricelimit> ??????<salecycle>Week</salecycle> ??????<autoreleasetime></autoreleasetime> ??????<instancename>ECS-BUY-2017-57-10</instancename> ??????<description></description> ??????<resourcegroupid></resourcegroupid> ??????<ostype>linux</ostype> ??????<osname>Ubuntu?16.04?64</osname> ??????<instancenetworktype>vpc</instancenetworktype> ??????<publicipaddress> ????????<ipaddress>47.94.XX.XX</ipaddress> ??????</publicipaddress> ??????<hostname>iZ2zeh9atclduxvf1zxuylZ</hostname> ??????<instancetype>ecs.g5.large</instancetype> ??????<creationtime>2017-12-10T04:04Z</creationtime> ??????<tags> ????????<tag> ??????????<tagvalue>fqwfew</tagvalue> ??????????<tagkey>fefqe</tagkey> ????????</tag> ????????<tag> ??????????<tagvalue>weqfwq</tagvalue> ??????????<tagkey>fqewfwqewf</tagkey> ????????</tag> ????????<tag> ??????????<tagvalue>ewqffeqw</tagvalue> ??????????<tagkey>fqfwewfqw</tagkey> ????????</tag> ??????</tags> ??????<status>Running</status> ??????<clusterid></clusterid> ??????<recyclable>false</recyclable> ??????<regionid>cn-beijing</regionid> ??????<gpuspec></gpuspec> ??????<operationlocks></operationlocks> ??????<gpuamount>0</gpuamount> ??????<instancechargetype>PrePaid</instancechargetype> ??????<expiredtime>2017-12-17T16:00Z</expiredtime> ????</instance> ??</instances></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.XX.XXX" ??????????] ????????}, ????????"InstanceChargeType":?"PostPaid", ????????"InstanceId":?"XXXXXXXXX", ????????"InstanceName":?"ddu6027u80fdu6d4bu8bd5", ????????"InstanceNetworkType":?"classic", ????????"InstanceType":?"ecs.s2.large", ????????"InternetChargeType":?"PayByTraffic", ????????"InternetMaxBandwidthIn":?"-1", ????????"InternetMaxBandwidthOut":?"1", ????????"IoOptimized":?"false", ????????"OperationLocks":?{ ??????????"LockReason":?[] ????????}, ????????"PublicIpAddress":?{ ??????????"IpAddress":?[ ????????????"120.25.XX.XXX" ??????????] ????????}, ????????"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" }

錯誤碼

以下為本接口特有的錯誤碼。更多錯誤碼,請訪問 API錯誤中心。

如何簡便快速的查詢一臺或多臺實例的詳細信息

? 版權聲明
THE END
喜歡就支持一下吧
點贊12 分享