The call ListDatabaseUserPermssions displays the permissions of users who have specified Database permissions.

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 ListDatabaseUserPermssions

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

DbId String Required 123

The ID of the database.

PermType String Required DATABASE

The type of the permission. Valid values:

  • DATABASE: DATABASE permissions
  • TABLE: TABLE permissions.
  • COLUMN: The COLUMN permissions.
Tid Long Yes -1

The ID of the tenant.

Logic Boolean No false

Indicates whether the database is a logical database.

UserName String No search_user_name

The nickname of the user.

PageNumber Integer Optional 1

The page number of the returned page.

PageSize Integer Optional 10

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 68075D06-7406-4887-83A7-F558A4D28C13

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

TotalCount Long 1

The total number of records that met the query condition.

UserPermissions Array of UserPermission

The user permission details.

UserPermission
Alias String instance_alias

The alias of the instance.

ColumnName String column_name

The name of the field.

DbId String 1234

The ID of the database.

DbType String mysql

The type of the storage instance of the DRDS database.

DsType String DATABASE

The resource permission type.

EnvType String product

The environment to which the database belongs.

InstanceId String 1443

The ID of the instance.

Logic Boolean false

Indicates whether the database is a logical database.

PermDetails Array of PermDetail

The user permission details.

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

The time when the permission was created.

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

Permission expiration time

ExtraData String DEFAULT

Additional information, reserved attributes

OriginFrom String xxx grant

Permission Request source description

PermType String QUERY

The type of the permission. Valid values:

  • QUERY: the QUERY operation.
  • EXPORT: Exporting
  • CORRECT: change
UserAccessId String 13434

The ID of the permission record.

SchemaName String xxx@xxxx:3306

The name of the database.

SearchName String xxx

The database search name.

TableId String 42345

The ID of the table.

TableName String table_name

The name of a table to be created.

UserId String 14324

The UID.

UserNickName String user_nick_name

The nickname of the user.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ListDatabaseUserPermssions
&DbId=123
&PermType=DATABASE
&Tid=-1
&<Common request parameters>

Sample success responses

XML format

<UserPermissions>
    <UserPermission>
        <Logic>false</Logic>
        <UserNickName>xxx</UserNickName>
        <DsType>DATABASE</DsType>
        <Alias>beihe_ent_prod</Alias>
        <PermDetails>
            <PermDetail>
                <ExpireDate>2020-10-31 00:00:00</ExpireDate>
                <UserAccessId>390915</UserAccessId>
                <PermType>QUERY</PermType>
                <OriginFrom>xxx</OriginFrom>
                <CreateDate>2019-11-21 15:07:45</CreateDate>
            </PermDetail>
            <PermDetail>
                <ExpireDate>2020-10-31 00:00:00</ExpireDate>
                <UserAccessId>390916</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>390917</UserAccessId>
                <PermType>CORRECT</PermType>
                <OriginFrom>xxx</OriginFrom>
                <CreateDate>2019-11-21 15:07:45</CreateDate>
            </PermDetail>
        </PermDetails>
        <InstanceId>1434</InstanceId>
        <SearchName>xxx@xxxx:3306</SearchName>
        <DbId>123434</DbId>
        <UserId>432423</UserId>
        <DbType>drds</DbType>
        <EnvType>product</EnvType>
        <SchemaName>xxx</SchemaName>
    </UserPermission>
</UserPermissions>
<TotalCount>1</TotalCount>
<RequestId>68075D06-7406-4887-83A7-F558A4D28C13</RequestId>
<Success>true</Success>

JSON format

{
  "UserPermissions": {
    "UserPermission": [
      {
        "Logic": false,
        "UserNickName": "xxx",
        "DsType": "DATABASE",
        "Alias": "beihe_ent_prod",
        "PermDetails": {
          "PermDetail": [
            {
              "ExpireDate": "2020-10-31 00:00:00",
              "UserAccessId": "390915",
              "PermType": "QUERY",
              "OriginFrom": "xxx",
              "CreateDate": "2019-11-21 15:07:45"
            },
            {
              "ExpireDate": "2020-10-31 00:00:00",
              "UserAccessId": "390916",
              "PermType": "EXPORT",
              "OriginFrom": "xxx",
              "CreateDate": "2019-11-21 15:07:45"
            },
            {
              "ExpireDate": "2020-10-31 00:00:00",
              "UserAccessId": "390917",
              "PermType": "CORRECT",
              "OriginFrom": "xxx",
              "CreateDate": "2019-11-21 15:07:45"
            }
          ]
        },
        "InstanceId": 1434,
        "SearchName": "xxx@xxxx:3306",
        "DbId": 123434,
        "UserId": 432423,
        "DbType": "drds",
        "EnvType": "product",
        "SchemaName": "xxx"
      }
    ]
  },
  "TotalCount": 1,
  "RequestId": "68075D06-7406-4887-83A7-F558A4D28C13",
  "Success": true
}

Errors

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