Queries the databases on which the specified user has permissions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dms:ListAuthorizedDatabasesForUser |
none |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UserId |
string |
Yes |
The user ID. You can call the GetUser operation to obtain this ID. |
51**** |
| EnvType |
string |
No |
The environment type of the database instance. Valid values:
|
product |
| DbType |
string |
No |
The type of databases. Valid values:
|
MySQL |
| Logic |
boolean |
No |
Whether the database is a logical database. Valid values:
|
false |
| SearchKey |
string |
No |
The search keyword. |
policy_test |
| PageNumber |
string |
No |
The page number. |
1 |
| PageSize |
string |
No |
The number of entries to return on each page. |
20 |
| Tid |
integer |
No |
The ID of the tenant. |
3*** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. You can use the ID to query logs and troubleshoot issues. |
012AE0B5-4B52-532F-BD7C-1EE9F182089B |
| Databases |
array<object> |
The databases on which the user has permissions. |
|
|
array<object> |
The database information. |
||
| DbId |
string |
The database ID. |
254**** |
| SchemaName |
string |
The database name. |
poc_testdb |
| SearchName |
string |
The name used to search for the database. |
poc |
| InstanceId |
string |
The instance ID. |
235**** |
| Logic |
boolean |
Indicates whether the database is a logical database. Valid values:
|
false |
| DbType |
string |
The engine of the database. |
MYSQL |
| UserId |
string |
The user ID. |
51**** |
| EnvType |
string |
The environment type of the database instance. |
product |
| PermissionDetail |
object |
The permission details. The format varies by permission source. For example, if the source is a normal permission, the following parameters are returned. |
|
| DsType |
string |
The type of object on which the operation is performed. |
DATABASE |
| PermType |
string |
The type of the permission. Valid values:
|
CORRECT |
| ExpireDate |
string |
The time when the permission expires. |
2024-12-06 10:00:00 |
| Message |
string |
If the permission source is a permission policy, this parameter includes the policy name and the allowed operations. |
权限策略通过,策略名:INSTANCE_OWNER,被允许的操作:instance:InstanceQuery |
Examples
Success response
JSON format
{
"RequestId": "012AE0B5-4B52-532F-BD7C-1EE9F182089B",
"Databases": [
{
"DbId": "254****",
"SchemaName": "poc_testdb",
"SearchName": "poc",
"InstanceId": "235****",
"Logic": false,
"DbType": "MYSQL",
"UserId": "51****",
"EnvType": "product",
"PermissionDetail": {
"DsType": "DATABASE",
"PermType": "CORRECT",
"ExpireDate": "2024-12-06 10:00:00",
"Message": "权限策略通过,策略名:INSTANCE_OWNER,被允许的操作:instance:InstanceQuery"
}
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.