Queries the permissions of a database account on a specified permission level.
Debugging
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| adb:DescribeAccountPrivileges | list | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | Yes | The region ID of the cluster. | cn-hangzhou |
| DBClusterId | string | Yes | The ID of the AnalyticDB for MySQL Data Lakehouse Edition (V3.0) cluster. | amv-bp1k5p066e1a**** |
| AccountName | string | Yes | The name of the database account. | account1 |
| PrivilegeType | string | Yes | The permission level that you want to query. You can call the | Global |
| DatabasePrivilegeObject | string | No | The databases that you want to query. You can use this parameter to query the permissions of the database account on specific databases. This parameter is available only if the PrivilegeType parameter is set to Database, Table, or Column. | db1 |
| TablePrivilegeObject | string | No | The tables that you want to query. You can use this parameter to query the permissions of the database account on specific tables. This parameter can be used together with the DatabasePrivilegeObject parameter. This parameter is available only if the PrivilegeType parameter is set to Table or Column. | table1 |
| PageNumber | string | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
| PageSize | string | No | The number of entries to return on each page. Default value: 20. | 10 |
| ColumnPrivilegeObject | string | No | The columns that you want to query. You can use this parameter to query the permissions of the database account on specific columns. This parameter is available only if the PrivilegeType parameter is set to Column. | col1 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "DA32480A-E3E5-1BE7-BA98-724551DC04C8",
"Data": [
{
"PrivilegeType": "Column",
"PrivilegeObject": {
"Database": "db1",
"Table": "tabl1",
"Column": "column1",
"Description": "a test column"
},
"Privileges": [
"insert,select"
]
}
],
"TotalCount": 100,
"PageNumber": 1,
"PageSize": 20
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | ACS.Account.NotExist | The account is not found. | The specified RAM user does not exist. |
| 400 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The DBClusterId parameter is invalid. Check the parameter. |
| 400 | ACS.Account.NotBindDatabaseAccount | The account has not been associated with a database account. | - |
| 400 | ACS.InvalidParameter.%s | Parameter %s is invalid. | The specified parameter is invalid. |
| 400 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2023-12-06 | The Error code has changed | View Change Details |
| 2023-04-20 | The Error code has changed | View Change Details |
| 2023-03-24 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
