You can call the CheckCloudResourceAuthorized operation to check permissions that are granted on cloud resources.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | CheckCloudResourceAuthorized |
The operation that you want to perform. Set the value to CheckCloudResourceAuthorized. |
| RegionId | String | Yes | cn-hangzhou |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
| DBInstanceId | String | Yes | rm-t4n7j9eb52y7c1960 |
The ID of the instance. You can call the DescribeDBInstances operation to query the ID of the instance. |
| TargetRegionId | String | No | us-east-1 |
The ID of the destination region. You can call the DescribeRegions operation to query the most recent region list. |
| ResourceGroupId | String | No | rg-acfmy********** |
The ID of the resource group. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | 8B993DA9-5272-5414-94E3-4CA8BA0146C2 |
The ID of the request. |
| RoleArn | String | acs:ram::1406926****:role/aliyunrdsinstanceencryptiondefaultrole |
The Alibaba Cloud Resource Name (ARN) of the RAM role. A RAM role is a virtual identity that you can create within your Alibaba Cloud account. For more information, see RAM role overview. Note This parameter is available only when the instance runs MySQL.
|
| AuthorizationState | Integer | 1 |
The authorization status. Valid values:
|
Examples
Sample requests
http(s)://[Endpoint]/?Action=CheckCloudResourceAuthorized
&RegionId=cn-hangzhou
&DBInstanceId=rm-t4n7j9eb52y7c1960
&TargetRegionId=us-east-1
&ResourceGroupId=rg-acfmy**********
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<CheckCloudResourceAuthorizedResponse>
<AuthorizationState>1</AuthorizationState>
<RequestId>525DC837-1677-5D76-94F2-80DD30F109F0</RequestId>
<RoleArn>acs:ram::1204700685511859:role/aliyunrdsinstanceencryptiondefaultrole</RoleArn>
</CheckCloudResourceAuthorizedResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"AuthorizationState" : 1,
"RequestId" : "525DC837-1677-5D76-94F2-80DD30F109F0",
"RoleArn" : "acs:ram::1204700685511859:role/aliyunrdsinstanceencryptiondefaultrole"
}
Error codes
For a list of error codes, visit the API Error Center.