Call ListDatabaseUserPermssions to display 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 Yes ListDatabaseUserPermssions

The operation that you want to perform. Valid values: ListDatabaseUserPermssions

DbId String Yes 123

The ID of the database.

PermType String Yes 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 was a logical database.

PageNumber String Optional 1

The number of the page to return.

PageSize String Optional 10

Data size per page

UserName String No search_user_name

The nickname of the user.

Response parameters

Prameter Type Sample response Description
ErrorCode String UnknownError

Error code

ErrorMessage String UnknownError

The error message.

RequestId String Cost

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

TotalCount Long 1

The total number of users who met the query conditions.

UserPermissions Array

User permission details

UserPermission

User permission details

Alias String instance_alias

The alias of the database instance.

ColumnName String column_name

Field

DbId String 1234

The ID of the database.

DbType String mysql

The type of the database instance.

DsType String DATABASE

Resource permission type

EnvType String product

Environment to which the database belongs

InstanceId String 1**3

Instance ID

Logic Boolean false

Indicates whether the database was a logical database.

PermDetails Array

User permission details

PermDetail

User permission details

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 1***4

The ID of the permission record.

SchemaName String xxx@xxxx:3306【xxx_ent_prod】

The name of the database.

SearchName String xxx

Database search name

TableId String 42***

The ID of the table.

TableName String table_name

Table name

UserId String 14***

The ID of the user.

UserNickName String user_nick_name

The nickname of the user.

Examples

Sample request


http(s)://[Endpoint]/? Action=ListDatabaseUserPermssions
&DbId=1**
&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>3***5</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>390***</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>390***</UserAccessId>
                <PermType>CORRECT</PermType>
                <OriginFrom>xxx</OriginFrom>
                <CreateDate>2019-11-21 15:07:45</CreateDate>
            </PermDetail>
        </PermDetails>
        <InstanceId>1**4</InstanceId>
        <SearchName>xxx@xxxx:3306【xxx_ent_prod】</SearchName>
        <DbId>123***</DbId>
        <UserId>432***</UserId>
        <DbType>drds</DbType>
        <EnvType>product</EnvType>
        <SchemaName>xxx</SchemaName>
    </UserPermission>
</UserPermissions>
<TotalCount>1</TotalCount>
<RequestId>68075D06-7406-4887-83A7-F558A4******</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":"390***",
							"PermType":"QUERY",
							"OriginFrom":"xxx",
							"CreateDate":"2019-11-21 15:07:45"
						},
						{
							"ExpireDate":"2020-10-31 00:00:00",
							"UserAccessId":"390***",
							"PermType":"EXPORT",
							"OriginFrom":"xxx",
							"CreateDate":"2019-11-21 15:07:45"
						},
						{
							"ExpireDate":"2020-10-31 00:00:00",
							"UserAccessId":"390***",
							"PermType":"CORRECT",
							"OriginFrom":"xxx",
							"CreateDate":"2019-11-21 15:07:45"
						}
					]
				},
				"SearchName":"xxx@xxxx:3306【xxx_ent_prod】",
				"InstanceId":1**4,
				"DbId":123***,
				"UserId":432***,
				"DbType":"drds",
				"EnvType":"product",
				"SchemaName":"xxx"
			}
		]
	},
	"TotalCount":1,
	"RequestId":"68075D06-7406-4887-83A7-F558A4******",
	"Success":true
}

Error codes.

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