Queries resources that can be accessed by the current account in resource groups.
Operation description
This topic provides an example on how to call the API operation to query resources that can be accessed by the current account in resource groups. The response shows that the current account can access only the Elastic Compute Service (ECS) instance i-23v38****
in the resource group rg-uPJpP****
.
Debugging
Authorization information
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. You can obtain the ID from the Service code column in Services that work with Resource Group. | ecs |
Region | string | No | The region ID. | cn-hangzhou |
ResourceType | string | No | The resource type. For more information about the supported resource types, see the Resource type column in 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 | object [] | No | The resource types. A maximum of 50 resource types are supported. Note
If you configure ResourceTypes , you must configure both Service and ResourceType . Otherwise, the configured Service or ResourceType does not take effect.
| |
Service | string | No | The ID of the Alibaba Cloud service. Valid values of N: 1 to 50. You can obtain the ID from the Service code column in Services that work with Resource Group. Note
You must configure both Service and ResourceType in ResourceTypes . Otherwise, the two parameters do not take effect.
| ecs |
ResourceType | string | No | The resource type. Valid values of N: 1 to 50. For more information about the supported resource types, see the Resource type column in Services that work with Resource Group. Note
You must configure both Service and ResourceType in ResourceTypes . Otherwise, the two parameters do not take effect.
| instance |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"TotalCount": 1,
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"PageSize": 10,
"PageNumber": 1,
"Resources": {
"Resource": [
{
"Service": "ecs",
"ResourceType": "instance",
"ResourceGroupId": "rg-uPJpP****",
"ResourceId": "i-23v38****",
"CreateDate": "2015-01-23T12:33:18Z",
"RegionId": "cn-hangzhou"
}
]
}
}
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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2023-07-26 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||
|