擷取指定資源的資源詳情。
介面說明
本文將提供一個樣本,查詢杭州地區的 ECS 執行個體i-bp12g4xbl4i0brkn****的詳情。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
config:GetDiscoveredResource |
get |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ResourceId |
string |
是 |
資源 ID。 關於如何擷取資源 ID,請參見 ListDiscoveredResources 。 |
i-bp12g4xbl4i0brkn**** |
| ResourceType |
string |
是 |
資源類型。 關於如何擷取資源類型,請參見 ListDiscoveredResources 。 |
ACS::ECS::Instance |
| Region |
string |
是 |
資源所在地區 ID。 關於如何擷取資源所在地區 ID,請參見 ListDiscoveredResources 。 |
cn-hangzhou |
| ComplianceOption |
integer |
否 |
查詢資源合規結果。取值:
|
0 |
關於公用請求參數的詳情,請參見公用參數。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
無。 |
||
| RequestId |
string |
請求 ID。 |
E4D71ACE-6B0A-46E0-8352-56952378CC7F |
| DiscoveredResourceDetail |
object |
資源詳情。 |
|
| AvailabilityZone |
string |
資源可用性區域。 |
cn-hangzhou-h |
| ResourceType |
string |
資源類型。 |
ACS::ECS::Instance |
| Configuration |
string |
資源的完整配置資訊。 |
{"ResourceGroupId":"","Memory":4096,"InstanceChargeType":"PostPaid","Cpu":2,"OSName":"Windows Server 2022 Datacenter 64-bit (Simplified Chinese)","InstanceNetworkType":"vpc","InnerIpAddress":{"IpAddress":[]},"ExpiredTime":"2099-12-31T15:59Z","ImageId":"win2022_21H2_x64_dtc_zh-cn_40G_alibase_20240110.vhd","EipAddress":{"AllocationId":"","IpAddress":"","InternetChargeType":""},"ImageOptions":{},"VlanId":"","HostName":"iZl4i0brknq****","Status":"Stopped","HibernationOptions":{"Configured":false},"MetadataOptions":{"HttpTokens":"","HttpEndpoint":""},"InstanceId":"i-bp12g4xbl4i0brkn****","StoppedMode":"KeepCharging","CpuOptions":{"ThreadsPerCore":2,"Numa":"ON","CoreCount":1},"StartTime":"2024-02-29T07:08Z","DeletionProtection":false,"VpcAttributes":{"PrivateIpAddress":{"IpAddress":["172.16.XX.XX"]},"VpcId":"vpc-bp1wjaw8t272wwmkg****","VSwitchId":"vsw-bp103i8xzww5132ul****","NatIpAddress":""},"SecurityGroupIds":{"SecurityGroupId":["sg-bp1h96fz9fagaegp****"]},"InternetChargeType":"PayByTraffic","InstanceName":"test123","DeploymentSetId":"","InternetMaxBandwidthOut":5,"SerialNumber":"6764f567-28fb-4a39-bfc3-48404995****","OSType":"windows","CreationTime":"2024-02-29T07:08Z","AutoReleaseTime":"","Description":"","InstanceTypeFamily":"ecs.c7","DedicatedInstanceAttribute":{"Tenancy":"","Affinity":""},"PublicIpAddress":{"IpAddress":["47.98.XX.XX"]},"GPUSpec":"","NetworkInterfaces":{"NetworkInterface":[{"Type":"Primary","PrimaryIpAddress":"172.16.XX.XX","MacAddress":"00:16:3e:0c:**:**","NetworkInterfaceId":"eni-bp19uj35v8won3x9****","PrivateIpSets":{"PrivateIpSet":[{"PrivateIpAddress":"172.16.XX.XX","Primary":true}]}}]},"SpotPriceLimit":0.0,"SaleCycle":"","DeviceAvailable":true,"InstanceType":"ecs.c7.large","OSNameEn":"Windows Server 2022 DataCenter Edition 64bit Chinese Edition","SpotStrategy":"NoSpot","IoOptimized":true,"ZoneId":"cn-hangzhou-b","ClusterId":"","EcsCapacityReservationAttr":{"CapacityReservationPreference":"","CapacityReservationId":""},"DedicatedHostAttribute":{"DedicatedHostId":"","DedicatedHostName":"","DedicatedHostClusterId":""},"GPUAmount":0,"OperationLocks":{"LockReason":[]},"InternetMaxBandwidthIn":2000,"Recyclable":false,"RegionId":"cn-hangzhou","CreditSpecification":""} |
| Region |
string |
地區 ID。 |
cn-hangzhou |
| ResourceCreationTime |
integer |
資源建立時間戳記。 |
1709190480000 |
| Tags |
string |
資源標籤。 |
{"key":"value"} |
| AccountId |
integer |
資源擁有者的阿里雲帳號 ID。 |
120886317861**** |
| ResourceId |
string |
資源 ID。 |
i-bp12g4xbl4i0brkn**** |
| ResourceDeleted |
integer |
資源刪除狀態。取值:
|
1 |
| ResourceName |
string |
資源名稱。 |
test123 |
| ResourceStatus |
string |
資源狀態。資源的狀態取決於各雲端服務對其的定義,該參數可能為空白。例如:
|
Stopped |
| ComplianceType |
string |
合規類型 |
COMPLIANT |
| VpcId |
string |
所屬的 vpc ID,格式:vpc-t4nhheyvay74fp7n0hxxx,無所屬 VPC 時返回Null 字元串: "" |
vpc-t4nhheyvay74fp7n0hxxx |
| VSwitchId |
string |
所屬的 vSwitch ID,格式:vsw-t4n7pokxxxxxxxxxxxxxx,多值時逗號分隔,如 vsw-t4n7pokxxxxxxxxxxxxxx,vsw-t4n7pokxxxxxxxxxxxxxx,無所屬 VSWITCH 時返回為空白字串:"" |
vsw-t4n7pokxxxxxxxxxxxxxx |
樣本
正常返回樣本
JSON格式
{
"RequestId": "E4D71ACE-6B0A-46E0-8352-56952378CC7F",
"DiscoveredResourceDetail": {
"AvailabilityZone": "cn-hangzhou-h",
"ResourceType": "ACS::ECS::Instance",
"Configuration": "{\"ResourceGroupId\":\"\",\"Memory\":4096,\"InstanceChargeType\":\"PostPaid\",\"Cpu\":2,\"OSName\":\"Windows Server 2022 Datacenter 64-bit (Simplified Chinese)\",\"InstanceNetworkType\":\"vpc\",\"InnerIpAddress\":{\"IpAddress\":[]},\"ExpiredTime\":\"2099-12-31T15:59Z\",\"ImageId\":\"win2022_21H2_x64_dtc_zh-cn_40G_alibase_20240110.vhd\",\"EipAddress\":{\"AllocationId\":\"\",\"IpAddress\":\"\",\"InternetChargeType\":\"\"},\"ImageOptions\":{},\"VlanId\":\"\",\"HostName\":\"iZl4i0brknq****\",\"Status\":\"Stopped\",\"HibernationOptions\":{\"Configured\":false},\"MetadataOptions\":{\"HttpTokens\":\"\",\"HttpEndpoint\":\"\"},\"InstanceId\":\"i-bp12g4xbl4i0brkn****\",\"StoppedMode\":\"KeepCharging\",\"CpuOptions\":{\"ThreadsPerCore\":2,\"Numa\":\"ON\",\"CoreCount\":1},\"StartTime\":\"2024-02-29T07:08Z\",\"DeletionProtection\":false,\"VpcAttributes\":{\"PrivateIpAddress\":{\"IpAddress\":[\"172.16.XX.XX\"]},\"VpcId\":\"vpc-bp1wjaw8t272wwmkg****\",\"VSwitchId\":\"vsw-bp103i8xzww5132ul****\",\"NatIpAddress\":\"\"},\"SecurityGroupIds\":{\"SecurityGroupId\":[\"sg-bp1h96fz9fagaegp****\"]},\"InternetChargeType\":\"PayByTraffic\",\"InstanceName\":\"test123\",\"DeploymentSetId\":\"\",\"InternetMaxBandwidthOut\":5,\"SerialNumber\":\"6764f567-28fb-4a39-bfc3-48404995****\",\"OSType\":\"windows\",\"CreationTime\":\"2024-02-29T07:08Z\",\"AutoReleaseTime\":\"\",\"Description\":\"\",\"InstanceTypeFamily\":\"ecs.c7\",\"DedicatedInstanceAttribute\":{\"Tenancy\":\"\",\"Affinity\":\"\"},\"PublicIpAddress\":{\"IpAddress\":[\"47.98.XX.XX\"]},\"GPUSpec\":\"\",\"NetworkInterfaces\":{\"NetworkInterface\":[{\"Type\":\"Primary\",\"PrimaryIpAddress\":\"172.16.XX.XX\",\"MacAddress\":\"00:16:3e:0c:**:**\",\"NetworkInterfaceId\":\"eni-bp19uj35v8won3x9****\",\"PrivateIpSets\":{\"PrivateIpSet\":[{\"PrivateIpAddress\":\"172.16.XX.XX\",\"Primary\":true}]}}]},\"SpotPriceLimit\":0.0,\"SaleCycle\":\"\",\"DeviceAvailable\":true,\"InstanceType\":\"ecs.c7.large\",\"OSNameEn\":\"Windows Server 2022 DataCenter Edition 64bit Chinese Edition\",\"SpotStrategy\":\"NoSpot\",\"IoOptimized\":true,\"ZoneId\":\"cn-hangzhou-b\",\"ClusterId\":\"\",\"EcsCapacityReservationAttr\":{\"CapacityReservationPreference\":\"\",\"CapacityReservationId\":\"\"},\"DedicatedHostAttribute\":{\"DedicatedHostId\":\"\",\"DedicatedHostName\":\"\",\"DedicatedHostClusterId\":\"\"},\"GPUAmount\":0,\"OperationLocks\":{\"LockReason\":[]},\"InternetMaxBandwidthIn\":2000,\"Recyclable\":false,\"RegionId\":\"cn-hangzhou\",\"CreditSpecification\":\"\"}",
"Region": "cn-hangzhou",
"ResourceCreationTime": 1709190480000,
"Tags": "{\"key\":\"value\"}",
"AccountId": 0,
"ResourceId": "i-bp12g4xbl4i0brkn****",
"ResourceDeleted": 1,
"ResourceName": "test123",
"ResourceStatus": "Stopped",
"ComplianceType": "COMPLIANT",
"VpcId": "vpc-t4nhheyvay74fp7n0hxxx",
"VSwitchId": "vsw-t4n7pokxxxxxxxxxxxxxx"
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | 您無權執行此操作。 |
| 400 | MemberNotBelongToMaster | The specified member does not belong to your organization. | |
| 404 | AccountNotExisted | Your account does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服務不可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。