All Products
Search
Document Center

Data Management:ListAuthorizedInstancesForUser

Last Updated:Nov 10, 2025

Queries the instances 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:ListAuthorizedInstancesForUsernone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
UserIdstringYes

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

Note If IdentityType is set to USER, this parameter is required.
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
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.

Note To view the ID of the tenant, go to the DMS console and move the pointer over the profile picture in the upper-right corner. For more information, see the View information about the current tenant section of the "Manage DMS tenants" topic.
3***

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

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

B7DB89CC-017D-5503-8953-38FFE241A618
Instancesarray<object>

The list of instances on which the user has permissions.

instancesobject

The instances on which the user has permissions.

InstanceIdstring

The ID of the instance.

21****
Hoststring

The endpoint that is used to connect to the instance.

rm-2zex9lrc0gz0****.mysql.rds.aliyuncs.com
Portstring

The port number that is used to connect to the instance.

3306
DbTypestring

The database engine that the instance runs.

MySQL
UserIdstring

The user IDs.

51****
UserNamestring

The user name.

user_test
InstanceAliasstring

The alias of the instance.

DMS_TEST
EnvTypestring

The type of the environment to which the database instance belongs.

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 permission expires.

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": "B7DB89CC-017D-5503-8953-38FFE241A618",
  "Instances": [
    {
      "InstanceId": "21****",
      "Host": "rm-2zex9lrc0gz0****.mysql.rds.aliyuncs.com",
      "Port": 3306,
      "DbType": "MySQL",
      "UserId": "51****",
      "UserName": "user_test",
      "InstanceAlias": "DMS_TEST",
      "EnvType": "product",
      "PermissionDetail": {
        "DsType": "DATABASE",
        "PermType": "CORRECT",
        "ExpireDate": "2024-12-06 10:00:00\n",
        "Message": ""
      }
    }
  ]
}

Error codes

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