Queries information about all accounts or specified accounts in a PolarDB-X instance.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. 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 DescribeAccountList

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

RegionId String Yes cn-hangzhou

The ID of the region where the PolarDB-X instance is deployed.

DBInstanceName String Yes pxc-********

The name of the PolarDB-X instance.

AccountName String No testaccount

The username of the account that you want to query. If you want to query information about a specific account, you must specify this parameter.

AccountType String No 0

The type of accounts that you want to query. If you want to query a specific type of accounts, you must specify this parameter. If you do not specify this parameter, information about all accounts of the specified instance is returned.

  • If the three-role mode is disabled, valid values are 0 and 1. The value 0 specifies standard accounts, and the value 1 specifies the privileged account.
  • If the three-role mode is enabled, valid values are 0, 2, 3, and 4. The value 0 specifies standard accounts, the value 2 specifies the database administrator (DBA) account, the value 3 specifies the data security administrator (DSA) account, and the value 4 specifies the data audit administrator (DAA) account.

Response parameters

Parameter Type Example Description
Message String success

The message that is returned. If the request is successful, "success" is returned. If the request fails, an error code is returned.

RequestId String 9B2F3840-5C98-475C-B269-2D5C3A31797C

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Data Array of Account

The data that is returned.

GmtCreated String 2012-06-08T15:00Z

The point in time when the account was created.

DBInstanceName String pxc-*********

The name of the PolarDB-X instance.

AccountDescription String testaccount desc

The description of the account.

DBName String testdb

The PolarDB-X database that can be accessed by using the account.

AccountPrivilege String ReadWrite

The type of permissions that are granted to the account.

AccountType String 0

The type of the account.

  • If the three-role mode is disabled, the returned value can be 0 or 1. 0 indicates standard accounts, and 1 indicates the privileged account.
  • If the three-role mode is enabled, the returned value can be 0, 2, 3, or 4. The value 0 indicates standard accounts, the value 2 indicates the database administrator (DBA) account, the value 3 indicates the data security administrator (DSA) account, and the value 4 indicates the data audit administrator (DAA) account.
AccountName String testAccount

The username of the account.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeAccountList
&RegionId=cn-hangzhou
&DBInstanceName=pxc-********
&AccountName=testaccount
&AccountType=0
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeAccountListResponse>
    <Message>success</Message>
    <RequestId>9B2F3840-5C98-475C-B269-2D5C3A31797C</RequestId>
    <Success>true</Success>
    <Data>
        <GmtCreated>2012-06-08T15:00Z</GmtCreated>
        <DBInstanceName>pxc-*********</DBInstanceName>
        <AccountDescription>testaccount desc</AccountDescription>
        <DBName>testdb</DBName>
        <AccountPrivilege>ReadWrite</AccountPrivilege>
        <AccountType>0</AccountType>
        <AccountName>testAccount</AccountName>
    </Data>
</DescribeAccountListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "success",
  "RequestId" : "9B2F3840-5C98-475C-B269-2D5C3A31797C",
  "Success" : true,
  "Data" : [ {
    "GmtCreated" : "2012-06-08T15:00Z",
    "DBInstanceName" : "pxc-*********",
    "AccountDescription" : "testaccount desc",
    "DBName" : "testdb",
    "AccountPrivilege" : "ReadWrite",
    "AccountType" : "0",
    "AccountName" : "testAccount"
  } ]
}

Error codes

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