Call 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Required ListUserPermissions

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

PermType String Required DATABASE

The type of the resource permission. For more information about valid values and descriptions, see ListDatabaseUserPermssions API.

Tid Long Yes -1

The ID of the tenant.

UserId String Required 13435

The user ID, which corresponds to the user ID in the GetUser operation. It must not correspond to the Alibaba Cloud Uid of a user.

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 type of the storage instance of the DRDS database.

PageNumber Integer Optional 1

The page number of the returned page.

PageSize Integer Optional 1

The amount of data on each 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 met the query condition.

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 field.

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

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

Grant Time

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

Expiration Time

ExtraData String xxx

Extra data and reserved parameters

OriginFrom String xxx

The source information of the permission granting policy.

PermType String QUERY

Permission Type

UserAccessId String 1345

Authorization record ID

SchemaName String test_db

The name of the database.

SearchName String test_db@xxx:3306

The database search name.

TableId String 13434

The ID of the table.

TableName String test_table

The name of a table to be created.

UserId String 423245

The UID.

UserNickName String nick_name

The username.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ListUserPermissions
&PermType=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

For a list of error codes, visit the API Error Center.