Lists resources accessible to the current account in resource groups.
Operation description
You can call this operation with a RAM role that has no session policy.
The following example lists resources accessible to the current account in resource groups. The response shows that only the ECS instance i-23v38**** in resource group rg-uPJpP**** is accessible.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-uPJpP**** |
| Service |
string |
No |
The ID of the Alibaba Cloud service. Find the ID in the Service code column of Services that work with Resource Group. |
ecs |
| Region |
string |
No |
The region ID. |
cn-hangzhou |
| ResourceType |
string |
No |
The resource type. Supported types are listed in the Resource type column of Services that work with Resource Group. |
instance |
| ResourceId |
string |
No |
The ID of the resource. |
i-23v38**** |
| PageNumber |
integer |
No |
The page number. Pages start from page 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 1 to 100. Default value: 10. |
10 |
| ResourceTypes |
array<object> |
No |
The resource types. Maximum: 50. Note
If you specify |
|
|
object |
No |
The resource types. |
||
| ResourceType |
string |
No |
The resource type. Valid values of N: 1 to 50. Supported types are listed in the Resource type column of Services that work with Resource Group. Note
Both |
instance |
| Service |
string |
No |
The ID of the Alibaba Cloud service. Valid values of N: 1 to 50. Find the ID in the Service code column of Services that work with Resource Group. Note
Both |
ecs |
Common request parameters: Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
04F0F334-1335-436C-A1D7-6C044FE73368 |
| Resources |
object |
||
| Resource |
array<object> |
The resources. |
|
|
object |
The resource details. |
||
| CreateDate |
string |
The time when the resource was created, in UTC. |
2015-01-23T12:33:18Z |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| ResourceGroupId |
string |
The ID of the resource group. |
rg-uPJpP**** |
| ResourceId |
string |
The ID of the resource. |
i-23v38**** |
| ResourceType |
string |
The resource type. |
instance |
| Service |
string |
The ID of the Alibaba Cloud service. |
ecs |
| TotalCount |
integer |
The total number of entries returned. |
1 |
Examples
Success response
JSON format
{
"PageNumber": 1,
"PageSize": 10,
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"Resources": {
"Resource": [
{
"CreateDate": "2015-01-23T12:33:18Z",
"RegionId": "cn-hangzhou",
"ResourceGroupId": "rg-uPJpP****",
"ResourceId": "i-23v38****",
"ResourceType": "instance",
"Service": "ecs"
}
]
},
"TotalCount": 1
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.ResourceIds | The ResourceIds is invalid. | The ResourceIds is invalid. |
| 400 | LimitExceeded.ResourceIds | The maximum number of ResourceId is exceeded. | The maximum number of ResourceId is exceeded. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.