Calls the ListUserPermissions to display the database and table permissions of a specified user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListUserPermissions

The operation that you want to perform. Set the value to ListUserPermissions .

PermType String Yes DATABASE

The resource permission type. For the values and descriptions, see ListDatabaseUserPermssions API .

Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the avatar in the upper-right corner of the system. For more information, see Tenant ID and Tenant .
UserId String Yes 13435

The user ID, which corresponds to the user ID in the GetUser API. Note that it is not the user's Alibaba Cloud Uid.

DatabaseName String No db_name

The name of the database.

Logic Boolean No false

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

  • true
  • false
EnvType String No dev

The type of the environment to which the database belongs.

DbType String No MySQL

The database engine available.

PageNumber Integer No 1

The page number of the returned page.

PageSize Integer No 1

The amount of data per page.

Response parameters

Parameter Type Example Description
ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String C51420E3-144A-4A94-B473-8662FCF4AD10

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

TotalCount Long 6

The total number of records that meet the specified conditions.

UserPermissions Array of UserPermission

The list of user permission information.

UserPermission
Alias String instance_alias

The alias of the instance.

ColumnName String column_name

The name of the column.

DbId String 1324

The ID of the database.

DbType String mysql

The type of the storage instance of the DRDS database.

DsType String DATABASE

The type of the permission resource.

EnvType String dev

The type of the environment to which the database belongs.

InstanceId String 134

The ID of the instance.

Logic Boolean false

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

  • true
  • false
PermDetails Array of PermDetail

The details of the permission.

PermDetail
CreateDate String 2019-12-12 00:00:00

The time when the permission was granted

ExpireDate String 2020-12-12 00:00:00

Authorization expiration time

ExtraData String xxx

Additional data, reserved parameters

OriginFrom String xxx

Permission Granting source information

PermType String QUERY

Permission types

UserAccessId String 1345

Authorization record ID

SchemaName String test_db

The name of the database.

SearchName String test_db@xxx:3306

The name of the database search.

TableId String 13434

The ID of the table.

TableName String test_table

The name of the table.

UserId String 423245

The ID of the user.

UserNickName String nick_name

The name of the user.

Examples

Sample requests


     http(s)://[Endpoint]/? Action=ListUserPermissions&perftype=DATABASE &Tid=-1 &UserId=13435 &<common request parameters> 
   

Sample success responses

XML format


     <UserPermissions> <UserPermission> <Logic>false</Logic> <UserNickName>xxx</UserNickName> <DsType>DATABASE</DsType> <Alias>xxx_ent_dev</Alias> <PermDetails> <PermDetail> <ExpireDate>2020-10-31 00:00:00</ExpireDate> <UserAccessId>390913</UserAccessId> <PermType>EXPORT</PermType> <OriginFrom>xxx</OriginFrom> <CreateDate>2019-11-21 15:07:45</CreateDate> </PermDetail> <PermDetail> <ExpireDate>2020-10-31 00:00:00</ExpireDate> <UserAccessId>390914</UserAccessId> <PermType>CORRECT</PermType> <OriginFrom>xxx</OriginFrom> <CreateDate>2019-11-21 15:07:45</CreateDate> </PermDetail> </PermDetails> <InstanceId>24671</InstanceId> <SearchName>xxx@xxx:3306</SearchName> <DbId>111369</DbId> <UserId>88658</UserId> <DbType>drds</DbType> <EnvType>dev</EnvType> <SchemaName>xxx_ent_dev</SchemaName> </UserPermission> </UserPermissions> <TotalCount>6</TotalCount> <RequestId>C51420E3-144A-4A94-B473-8662FCF4AD10</RequestId> <Success>true</Success> 
   

JSON Format


     { "UserPermissions": { "UserPermission": [ { "Logic": false, "UserNickName": "xxx", "DsType": "DATABASE", "Alias": "xxx_ent_dev", "PermDetails": { "PermDetail": [ { "ExpireDate": "2020-10-31 00:00:00", "UserAccessId": "390913", "PermType": "EXPORT", "OriginFrom": "xxx", "CreateDate": "2019-11-21 15:07:45" }, { "ExpireDate": "2020-10-31 00:00:00", "UserAccessId": "390914", "PermType": "CORRECT", "OriginFrom": "xxx", "CreateDate": "2019-11-21 15:07:45" } ] }, "InstanceId": 24671, "SearchName": "xxx@xxx:3306", "DbId": 111369, "UserId": 88658, "DbType": "drds", "EnvType": "dev", "SchemaName": "xxx_ent_dev" } ] }, "TotalCount": 6, "RequestId": "C51420E3-144A-4A94-B473-8662FCF4AD10", "Success": true } 
   

Error codes

Go to the Error Center For more information, see error codes.