Queries resources based on specified query criteria.

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 ListDiscoveredResources

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

ResourceId String No eni-hp31cqoba96jagtz****

The ID of the resource.

ResourceDeleted Integer No 1

The status of the resource. Valid values:

  • 0: The resource is deleted.
  • 1: The resource is retained. This is the default value.
PageSize Integer Yes 1

The number of entries to return on each page. Valid values: 1 to 100.

PageNumber Integer Yes 10

The number of the page to return. Pages start from page 1.

ResourceTypes String No ACS::ECS::NetworkInterface

The type of the resource. Separate multiple resource types with commas (,).

Regions String No cn-huhehaote

The ID of the region in which the resource resides. Separate multiple regions IDs with commas (,).

MultiAccount Boolean No false

This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see Overview.

MemberId Long No 120886341261****

This parameter has been removed from 00:00:00, June 30, 2021. Account group-related operations are provided as an alternative after 00:00:00, May 30, 2021. If you are using this parameter, we recommend that you switch to account group-related operations after 00:00:00, May 30, 2021. For more information about account groups, see Overview.

Response parameters

Parameter Type Example Description
DiscoveredResourceProfiles Object

The information about the returned resources.

DiscoveredResourceProfileList Array of DiscoveredResourceProfile

The information about the resource.

ResourceType String ACS::ECS::NetworkInterface

The type of the resource.

Region String cn-huhehaote

The ID of the region.

ResourceCreationTime Long 1618675206000

The timestamp when the resource was created.

Tags String {\"key1\":[\"value2\"]}

The tags of the resource.

AccountId Long 120886317861****

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

ResourceId String eni-hp31cqoba96jagtz****

The ID of the resource.

ResourceName String Cloud Firewall

The name of the resource.

ResourceDeleted Integer 1

Indicates whether the resource is deleted. Valid values:

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

The status of the resource. The parameter value varies based on the resource type and may be left empty.

Examples:

  • If the value of the ResourceType parameter is ACS::ECS::Instance, the resource is an Elastic Compute Service (ECS) instance that has a specific state. In this case, the valid values of this parameter are Running and Stopped.
  • If the value of the ResourceType parameter is 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.
PageNumber Integer 10

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

PageSize Integer 1

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

TotalCount Integer 129

The total number of resources.

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

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListDiscoveredResources
&PageNumber=10
&PageSize=1
&<Common request parameters>

Sample success responses

XML format

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

<ListDiscoveredResourcesResponse>
	<DiscoveredResourceProfiles>
		<TotalCount>129</TotalCount>
		<PageSize>1</PageSize>
		<PageNumber>10</PageNumber>
		<DiscoveredResourceProfileList>
			<AccountId>120886317861****</AccountId>
			<ResourceCreationTime>1618675206000</ResourceCreationTime>
			<ResourceId>eni-hp31cqoba96jagtz****</ResourceId>
			<ResourceName>Cloud Firewall</ResourceName>
			<Region>cn-huhehaote</Region>
			<ResourceStatus>InUse</ResourceStatus>
			<ResourceType>ACS::ECS::NetworkInterface</ResourceType>
			<ResourceDeleted>1</ResourceDeleted>
			<Tags>{\"key1\":[\"value2\"]}</Tags>
		</DiscoveredResourceProfileList>
	</DiscoveredResourceProfiles>
	<RequestId>C7817373-78CB-4F9A-8AFA-E7A88E9D64A2</RequestId>
</ListDiscoveredResourcesResponse>

JSON format

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

{
  "DiscoveredResourceProfiles" : {
    "TotalCount" : 129,
    "PageSize" : 1,
    "PageNumber" : 10,
    "DiscoveredResourceProfileList" : [ {
      "AccountId" : "120886317861****",
      "ResourceCreationTime" : 1618675206000,
      "ResourceId" : "eni-hp31cqoba96jagtz****",
      "ResourceName" : "Cloud Firewall",
      "Region" : "cn-huhehaote",
      "ResourceStatus" : "InUse",
      "ResourceType" : "ACS::ECS::NetworkInterface",
      "ResourceDeleted" : 1,
      "Tags" : "{\"key1\":[\"value2\"]}"
    } ]
  },
  "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 the specified 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.