All Products
Search
Document Center

Data Management:ListAuthorizedDatabasesForUser

Last Updated:Nov 09, 2025

Queries the databases on which the specified user has permissions.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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 Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListAuthorizedDatabasesForUsernone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
UserIdstringYes

The ID of the user. You can call the GetUser operation to query the user ID.

51****
EnvTypestringNo

The type of the environment in which the database instance is deployed. Valid values:

  • product: production environment.
  • dev: development environment.
  • pre: pre-release environment.
  • test: test environment.
  • sit: system integration testing (SIT) environment.
  • uat: user acceptance testing (UAT) environment.
  • pet: stress testing environment.
  • stag: staging environment.
product
DbTypestringNo

The type of databases. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • Oracle
  • DRDS
  • OceanBase
  • Mongo
  • Redis
MySQL
LogicbooleanNo

Specifies whether the database is a logical database. Valid values:

  • true.: The database is a logical database
  • false: The database is a physical database.
false
SearchKeystringNo

The search keyword.

policy_test
PageNumberstringNo

The page number.

1
PageSizestringNo

The number of entries to return on each page.

20
TidlongNo

The ID of the tenant.

3***

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID. You can use the ID to query logs and troubleshoot issues.

012AE0B5-4B52-532F-BD7C-1EE9F182089B
Databasesarray<object>

The names of the databases on which the user has permissions.

databasesobject

The database information.

DbIdstring

The database ID.

254****
SchemaNamestring

The database name.

poc_testdb
SearchNamestring

The name that is used to search for the database.

poc
InstanceIdstring

The ID of the instance.

235****
Logicboolean

Indicates whether the database is a logical database. Valid values:

  • true.: The database is a logical database
  • false: The database is a physical database.
false
DbTypestring

The engine of the database.

MYSQL
UserIdstring

The user IDs.

51****
EnvTypestring

The type of the environment in which the database instance is deployed.

product
PermissionDetailobject

The details of permissions. The format of the permission details varies with the permission source. For example, if the permission source is a normal permission, the following parameters are returned.

DsTypestring

The type of object on which the operation is performed.

DATABASE
PermTypestring

The type of the permission. Valid values:

  • QUERY: the query permission
  • EXPORT: the data export permission
  • CORRECT: the data change permission
CORRECT
ExpireDatestring

The time when the permissions expire.

2024-12-06 10:00:00
Messagestring

If the permission source is a permission policy, the value of this parameter includes the policy name and the operations that are allowed for the user.

Examples

Sample success responses

JSONformat

{
  "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": ""
      }
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.