Queries the details of a database account of a PolarDB cluster.

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 No DescribeAccounts

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

DBClusterId String Yes pc-***************

The ID of the cluster.

AccountName String No test_acc

The name of the account.

PageNumber Integer No 1

The number of the page to return. The value must be an integer that is larger than 0. Default value: 1.

PageSize Integer No 30

The number of entries to return on each page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

Response parameters

Parameter Type Example Description
Accounts Array of DBAccount

The details of the account.

AccountDescription String test

The description of the account.

AccountLockState String UnLock

The locking status of the account. Valid values:

  • UnLock
  • Lock
AccountName String test_acc

The name of the account.

AccountPasswordValidTime String undefined

The validity period of the password.

AccountStatus String Available

The status of the account. Valid values:

  • Creating: The account is being created.
  • Available: The account is available.
  • Deleting: The account is being deleted.
AccountType String Normal

The type of the database account. Valid values:

  • Normal: a standard account
  • Super: a privileged account
DatabasePrivileges Array of DatabasePrivilege

The list of database permissions that are granted to the account.

Note This parameter is only returned for standard accounts.
AccountPrivilege String ReadOnly

The permissions of the database account.

DBName String DBtest

The name of the database.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 1

The number of entries returned on the current page.

RequestId String 155462B9-205F-4FFC-BB43-4855FE******

The ID of the request.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/? Action=DescribeAccounts
&DBClusterId=pc-***************
&<Common request parameters>

Sample success responses

XML format

<DescribeAccountsResponse>
  <PageRecordCount>1</PageRecordCount>
  <RequestId>155462B9-205F-4FFC-BB43-4855FE******</RequestId>
  <PageNumber>1</PageNumber>
  <Accounts>
        <AccountDescription>test</AccountDescription>
        <AccountStatus>Available</AccountStatus>
        <AccountLockState>UnLock</AccountLockState>
        <AccountPasswordValidTime>undefined</AccountPasswordValidTime>
        <AccountType>Normal</AccountType>
        <AccountName>test_acc</AccountName>
  </Accounts>
  <Accounts>
        <DatabasePrivileges>
              <AccountPrivilege>ReadOnly</AccountPrivilege>
              <DBName>DBtest</DBName>
        </DatabasePrivileges>
  </Accounts>
</DescribeAccountsResponse>

JSON format

{
    "PageRecordCount": 1,
    "RequestId": "155462B9-205F-4FFC-BB43-4855FE******",
    "PageNumber": 1,
    "Accounts": [
        {
            "AccountDescription": "test",
            "AccountStatus": "Available",
            "AccountLockState": "UnLock",
            "AccountPasswordValidTime": "undefined",
            "AccountType": "Normal",
            "AccountName": "test_acc"
        },
        {
            "DatabasePrivileges": {
                "AccountPrivilege": "ReadOnly",
                "DBName": "DBtest"
            }
        }
    ]
}

Error codes

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