Queries the resources in an account group.

In this topic, the ca-c560626622af0005**** account group is used as an example. The return result shows a total of eight resources in the sample account group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListAggregateDiscoveredResources

The operation that you want to perform. Set the value to ListAggregateDiscoveredResources.

ResourceId String No s-hp3d9r78m7uysiii****

The ID of the resource to be queried.

ResourceDeleted Integer No 1

The status of the one or more resources to be queried. Valid values: 0 and 1.

  • 0: The resource is deleted.
  • 1: The resource is retained.
PageSize Integer Yes 10

The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.

PageNumber Integer Yes 1

The number of the page to return.

Pages start from page 1. Default value: 1.

ResourceTypes String No ACS::ECS::Snapshot

The type of the one or more resources to be queried. Separate multiple resource types with commas (,).

Regions String No cn-huhehaote

The ID of the region where the one or more resources to be queried reside. Separate multiple region IDs with commas (,).

For more information about how to obtain the region ID of a resource, see ListAggregateDiscoveredResources.

ComplianceType String No COMPLIANT

The compliance evaluation results of the one or more resources to be queried. Valid values:

  • COMPLIANT: The relevant resources are evaluated as compliant.
  • NON_COMPLIANT: The relevant resources are evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to the resources.
  • INSUFFICIENT_DATA: No resource data is available.
AggregatorId String Yes ca-c560626622af0005****

The ID of the account group.

For more information about how to obtain the ID of an account group, see ListAggregators.

ResourceOwnerId Long No 161259599160****

The ID of the Alibaba Cloud account to which the resources belong.

For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
DiscoveredResourceProfiles Object

The information about the resources.

DiscoveredResourceProfileList Array of DiscoveredResourceProfile

The information about the resource.

ResourceType String ACS::ECS::Snapshot

The type of the resource.

Region String cn-huhehaote

The ID of the region where the resource resides.

ResourceCreationTime Long 1618675206000

The timestamp when the resource was created. Unit: milliseconds.

Tags String {\"key1\":[\"value2\"],\"key3\":[\"value4\"]}

The tags of the resource.

AccountId Long 161259599160****

The ID of the Alibaba Cloud account to which the resource belongs.

ResourceId String s-hp3d9r78m7uysiii****

The ID of the resource.

ResourceName String auto2.0_20210418_sp-hp3e2kkt8ugld7ox****

The name of the resource.

ResourceDeleted Integer 1

Indicates whether the resource is deleted. Valid values:

  • 0: The resource is deleted.
  • 1: The resource is retained.
ResourceStatus String Running

The status of the resource. The parameter value varies with the resource type and may be left empty. Examples:

  • If the ResourceType parameter is set to ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, valid values of this parameter include Running and Stopped.
  • If the ResourceType parameter is set to ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that does not have a specific state. In this case, this parameter is left empty.
ResourceOwnerId Long 161259599160****

The ID of the Alibaba Cloud account to which the resource belongs.

PageNumber Integer 1

The page number of the returned page. Pages start from page 1.

PageSize Integer 10

The number of entries returned per page. Valid values: 1 to 100.

TotalCount Integer 8

The total number of resources in the account group.

RequestId String C7817373-78CB-4F9A-8AFA-E7A88E9D64A2

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListAggregateDiscoveredResources
&PageSize=10
&PageNumber=1
&AggregatorId=ca-c560626622af0005****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListAggregateDiscoveredResourcesResponse>
    <DiscoveredResourceProfiles>
        <DiscoveredResourceProfileList>
            <ResourceType>ACS::ECS::Snapshot</ResourceType>
            <Region>cn-huhehaote</Region>
            <ResourceCreationTime>1618675206000</ResourceCreationTime>
            <Tags>{\"key1\":[\"value2\"],\"key3\":[\"value4\"]}</Tags>
            <ResourceId>s-hp3d9r78m7uysiii****</ResourceId>
            <ResourceName>auto2.0_20210418_sp-hp3e2kkt8ugld7ox****</ResourceName>
            <ResourceDeleted>1</ResourceDeleted>
            <ResourceStatus>Running</ResourceStatus>
        </DiscoveredResourceProfileList>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
        <TotalCount>8</TotalCount>
    </DiscoveredResourceProfiles>
    <RequestId>C7817373-78CB-4F9A-8AFA-E7A88E9D64A2</RequestId>
</ListAggregateDiscoveredResourcesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DiscoveredResourceProfiles" : {
    "DiscoveredResourceProfileList" : [ {
      "ResourceType" : "ACS::ECS::Snapshot",
      "Region" : "cn-huhehaote",
      "ResourceCreationTime" : 1618675206000,
      "Tags" : "{\\\"key1\\\":[\\\"value2\\\"],\\\"key3\\\":[\\\"value4\\\"]}",
      "ResourceId" : "s-hp3d9r78m7uysiii****",
      "ResourceName" : "auto2.0_20210418_sp-hp3e2kkt8ugld7ox****",
      "ResourceDeleted" : 1,
      "ResourceStatus" : "Running"
    } ],
    "PageNumber" : 1,
    "PageSize" : 10,
    "TotalCount" : 8
  },
  "RequestId" : "C7817373-78CB-4F9A-8AFA-E7A88E9D64A2"
}

Error codes

HTTP status code Error code Error message Description
400 NoPermission You are not authorized to perform this operation. The error message returned because you are not authorized to perform the specified operation.
400 MemberNotBelongToMaster The specified member does not belong to your organization. The error message returned because the specified member account does not belong to your resource directory.
404 AccountNotExisted Your account does not exist. The error message returned because your account does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. The error message returned because the service is unavailable.

For a list of error codes, visit the API Error Center.