All Products
Search
Document Center

Cloud Config:ListDiscoveredResources

Last Updated:Jun 24, 2025

Obtains a list of resources aggregated across regions within an Alibaba Cloud account.

Operation description

This topic provides an example on how to call the ListDiscoveredResources operation to query the resources in the current Alibaba Cloud account. The returned result indicates that a total of eight resources exist in the account.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
config:ListDiscoveredResourceslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceIdstringNo

The resource ID.

eni-hp31cqoba96jagtz****
ResourceDeletedintegerNo

The status of the resource. Valid values:

  • 0: The resource is deleted. If a resource is deleted from the desired cloud service, Deleted is displayed in the resource list in the Cloud Config console.
  • 1 (default): The resource is retained. If a resource is managed as expected, Active is displayed in the resource list in the Cloud Config console.
1
MaxResultsintegerYes

The maximum number of entries returned for a single request. Valid values: 1 to 100.

10
ResourceTypesstringNo

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

ACS::ECS::NetworkInterface
RegionsstringNo

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

cn-hangzhou
NextTokenstringNo

The token that you want to use to initiate the current request. If the response of the previous request is truncated, you can use this token to initiate another request and obtain the remaining entries.

IWBjqMYSy0is7zSMGu16****
StartUpdateTimestamplongNo

The start time of the time range for querying resources. The value is a timestamp in the UTC format. When you specify this parameter, take note of the following limits:

  • The value must be a timestamp in milliseconds.
  • The value cannot be greater than the value of the EndUpdateTimestamp parameter. The interval between the value and the value of the EndUpdateTimestamp parameter must be less than or equal to 30 days.
  • The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left blank at the same time.
1722441600000
EndUpdateTimestamplongNo

The end time of the time range for querying resources. The value is a timestamp in the UTC format. When you specify this parameter, take note of the following limits:

  • The value must be a timestamp in milliseconds.
  • The value cannot be less than the value of the StartUpdateTimestamp parameter. The interval between the value and the value of the StartUpdateTimestamp parameter must be less than or equal to 30 days.
  • The StartUpdateTimestamp and EndUpdateTimestamp parameters must be specified at the same time or left empty at the same time.
1724947200000
ExcludeResourceTypesstringNo

The types of resources that are excluded. Separate multiple values with commas (,). If this parameter conflicts with the ResourceTypes parameter, this parameter prevails.

ACS::ECS::Instance,ACS::ECS::NetworkInterface

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

DiscoveredResourceProfilesobject

The information about the resources.

DiscoveredResourceProfileListarray<object>

The details of the resources.

DiscoveredResourceProfileobject

None.

AccountIdlong

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

161259599160****
AvailabilityZonestring

The zone ID.

cn-hangzhou-h
Regionstring

The region ID.

cn-hangzhou
ResourceCreationTimelong

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

1618675206000
ResourceDeletedinteger

The status of the resource. Valid values:

  • 0: The resource is deleted.
  • 1: The resource is retained.
1
ResourceIdstring

The resource ID.

eni-hp31cqoba96jagtz****
ResourceNamestring

The resource name.

Cloud Firewall
ResourceStatusstring

The status of the resource. The value of this parameter varies based on the resource type and may be 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, the valid values of this parameter are Running and Stopped.
  • If the ResourceType parameter is ACS::OSS::Bucket, the resource is an Object Storage Service (OSS) bucket that is not in a specific state. In this case, this parameter is left empty.
InUse
ResourceTypestring

The type of the resource.

ACS::ECS::NetworkInterface
Tagsstring

The tags of the resource.

{\"key1\":[\"value2\"]}
UpdateTimelong

The time when the resource was last updated. The value must be a timestamp in milliseconds.

1722441600000
Versionlong

The version of the resource change.

1
MaxResultsinteger

The maximum number of entries returned on each page.

10
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

161259599160****
TotalCountinteger

The total number of resources.

8
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

{
  "DiscoveredResourceProfiles": {
    "DiscoveredResourceProfileList": [
      {
        "AccountId": 0,
        "AvailabilityZone": "cn-hangzhou-h",
        "Region": "cn-hangzhou",
        "ResourceCreationTime": 1618675206000,
        "ResourceDeleted": 1,
        "ResourceId": "eni-hp31cqoba96jagtz****",
        "ResourceName": "Cloud Firewall",
        "ResourceStatus": "InUse",
        "ResourceType": "ACS::ECS::NetworkInterface",
        "Tags": "{\\\"key1\\\":[\\\"value2\\\"]}",
        "UpdateTime": 1722441600000,
        "Version": 1
      }
    ],
    "MaxResults": 10,
    "NextToken": "161259599160****",
    "TotalCount": 8
  },
  "RequestId": "C7817373-78CB-4F9A-8AFA-E7A88E9D64A2"
}

Error codes

HTTP status codeError codeError messageDescription
400NoPermissionYou are not authorized to perform this operation.You are not authorized to perform this operation.
400MemberNotBelongToMasterThe specified member does not belong to your organization.-
404AccountNotExistedYour account does not exist.-
503ServiceUnavailableThe request has failed due to a temporary failure of the server.The request has failed due to a temporary failure of the server.

For a list of error codes, visit the Service error codes.