Queries the resources that can be accessed by the current account.

Note RAM roles cannot be used to query resources.

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 ListResources

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

ResourceGroupId String No rg-uPJpP****

The ID of the resource group.

Service String No ecs

The ID of the service.

Region String No cn-hangzhou

The region ID.

ResourceType String No instance

The type of the resource.

ResourceId String No i-23v38****

The ID of the resource.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

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

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Resources Array

The information of the resources.

Resource
CreateDate String 2015-01-23T12:33:18Z

The time when the resource was created.

RegionId String cn-hangzhou

The region ID.

ResourceGroupId String rg-uPJpP****

The ID of the resource group.

ResourceId String i-23v38****

The ID of the resource.

ResourceType String instance

The type of the resource.

Service String ecs

The ID of the service.

TotalCount Integer 2

The total number of returned entries.

Examples

Sample requests

https://resource-manager.aliyuncs.com/?Action=ListResources
&<Common request parameters>

Sample success responses

XML format

<ListResourcesResponse>
	  <RequesgtId>04F0F334-1335-436C-A1D7-6C044FE73368</RequesgtId>
	  <PageNumber>1</PageNumber>
	  <PageSize>10</PageSize>
	  <TotalCount>2</TotalCount>
	  <Resources>
		    <Resource>
			      <ResourceGroupId>rg-uPJpP****</ResourceGroupId>
			      <Service>ecs</Service>
			      <ResourceType>instance</ResourceType>
			      <ResourceId>i-23v38****</ResourceId>
			      <RegionId>cn-hangzhou</RegionId>
			      <CreateDate>2015-01-23T12:33:18Z</CreateDate>
		    </Resource>
	  </Resources>
</ListResourcesResponse>

JSON format

{
    "RequesgtId": "04F0F334-1335-436C-A1D7-6C044FE73368",
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 2,
    "Resources": {
        "Resource": [
            {
                "ResourceGroupId": "rg-uPJpP****",
                "Service": "ecs",
                "ResourceType": "instance",
                "ResourceId": "i-23v38****",
                "RegionId": "cn-hangzhou",
                "CreateDate": "2015-01-23T12:33:18Z"
            }
        ]
    }
}

Error codes

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