Retrieves the details of a specified resource in an account group.
Operation description
This topic provides an example on how to query the details of the ECS instance i-bp12g4xbl4i0brkn**** in the China (Hangzhou) region within the account group ca-5885626622af0008****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:GetAggregateDiscoveredResource |
get |
*Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceId |
string |
Yes |
The resource ID. For information about how to obtain a resource ID, see ListAggregateDiscoveredResources. |
i-bp12g4xbl4i0brkn**** |
| ResourceType |
string |
Yes |
The resource type. For information about how to obtain a resource type, see ListAggregateDiscoveredResources. |
ACS::ECS::Instance |
| Region |
string |
Yes |
The ID of the region in which the resource resides. For information about how to obtain the region ID, see ListAggregateDiscoveredResources. |
cn-hangzhou |
| AggregatorId |
string |
Yes |
The account group ID. For information about how to obtain an account group ID, see ListAggregators. |
ca-5885626622af0008**** |
| ResourceAccountId |
integer |
No |
Required. The Alibaba Cloud account ID of the resource that you want to query in the account group. |
100931896542**** |
| ComplianceOption |
integer |
No |
Specifies whether to query the compliance result of the resource. Valid values:
Valid values:
|
0 |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| RequestId |
string |
The request ID. |
E4D71ACE-6B0A-46E0-8352-56952378CC7F |
| DiscoveredResourceDetail |
object |
The resource details. |
|
| AvailabilityZone |
string |
The zone of the resource. |
cn-hangzhou-h |
| ResourceType |
string |
The resource type. |
ACS::ECS::Instance |
| Configuration |
string |
The complete configuration of the resource. |
{\"ResourceGroupId\":\"\",\"Memory\":4096,\"InstanceChargeType\":\"PostPaid\",\"Cpu\":2,\"OSName\":\"Windows Server 2022 DataCenter Edition 64bit Chinese Edition\",\"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 |
The region ID. |
cn-hangzhou |
| ResourceCreationTime |
integer |
The time when the resource was created. This value is a UNIX timestamp in milliseconds. |
1624961112000 |
| Tags |
string |
The resource tags. |
{\"\"hc\"\":[\"\"value2\"\"]} |
| AccountId |
integer |
The Alibaba Cloud account ID of the resource owner. |
100931896542**** |
| ResourceId |
string |
The resource ID. |
i-bp12g4xbl4i0brkn**** |
| ResourceDeleted |
integer |
The deletion status of the resource. Valid values:
|
1 |
| ResourceName |
string |
The resource name. |
test123 |
| ResourceStatus |
string |
The resource status. The status of a resource depends on how each cloud service defines it. This parameter may be empty. For example:
|
Stopped |
| ComplianceType |
string |
The compliance type. Valid values:
|
COMPLIANT |
| VpcId |
string |
The ID of the VPC to which the resource belongs. Format: vpc-t4nhheyvay74fp7n0hxxx. An empty string ("") is returned if the resource does not belong to a VPC. |
vpc-t4nhheyvay74fp7n0hxxx |
| VSwitchId |
string |
The ID of the vSwitch to which the resource belongs. Format: vsw-t4n7pokxxxxxxxxxxxxxx. Multiple values are separated by commas, such as vsw-t4n7pokxxxxxxxxxxxxxx,vsw-t4n7pokxxxxxxxxxxxxxx. An empty string ("") is returned if the resource does not belong to a vSwitch. |
vsw-t4n7pokxxxxxxxxxxxxxx |
Examples
Success response
JSON format
{
"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 数据中心版 64位中文版\\\",\\\"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": 1624961112000,
"Tags": "{\\\"\\\"hc\\\"\\\":[\\\"\\\"value2\\\"\\\"]}",
"AccountId": 0,
"ResourceId": "i-bp12g4xbl4i0brkn****",
"ResourceDeleted": 1,
"ResourceName": "test123",
"ResourceStatus": "Stopped",
"ComplianceType": "COMPLIANT",
"VpcId": "vpc-t4nhheyvay74fp7n0hxxx",
"VSwitchId": "vsw-t4n7pokxxxxxxxxxxxxxx"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | NoPermission | You are not authorized to perform this operation. | 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. | The request has failed due to a temporary failure of the server. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.