All Products
Search
Document Center

PolarDB:DescribeAccounts

Last Updated:Jun 17, 2024

Queries information about 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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
polardb:DescribeAccountsRead
  • dbcluster
    acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

pc-***************
AccountNamestringNo

The name of the account.

test_acc
PageNumberintegerNo

The page number of the page to return. Set this parameter to an integer that is larger than 0. Default value: 1.

1
PageSizeintegerNo

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

  • 30
  • 50
  • 100

Default value: 30.

30

Response parameters

ParameterTypeDescriptionExample
object
PageRecordCountinteger

The number of entries returned per page.

1
RequestIdstring

The request ID.

155462B9-205F-4FFC-BB43-4855FE******
PageNumberinteger

The page number of the page returned.

1
Accountsobject []

The details of the account.

AccountStatusstring

The state of the account. Valid values:

  • Creating: The account is being created.
  • Available: The account is available.
  • Deleting: The account is being deleted
Available
DatabasePrivilegesobject []

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

DBNamestring

The name of the database.

DBtest
AccountPrivilegestring

The permissions that the account is granted on the database. Valid values:

ReadOnly
AccountDescriptionstring

The description of the account.

test
AccountPasswordValidTimestring

The validity period of the password.

undefined
AccountTypestring

The type of the account. Valid values:

  • Normal: a standard account
  • Super: a privileged account
Normal
AccountLockStatestring

The locking state of the account. Valid values:

  • UnLock
  • Lock
UnLock
AccountNamestring

The name of the account.

test_acc
AccountPasswordstring

The password of the account that is used to log on to the database.

Test1111

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidPageSize.MalformedThe specified parameter PageSize is not valid.The specified PageSize parameter is invalid.
400InvalidPageNumber.MalformedThe specified parameter PageNumber is not valid.The specified PageNumber parameter is invalid.
400Database.ConnectErrordb instance %s connect failed, please check instance status and database processlistFailed to connect to the database cluster. Check the cluster status and database process list.
400Account.QueryErrorInstance %s query account errorFailed to query accounts for cluster %s.
400Connect.TimeoutService can not connect to instance temporarily.Failed to connect to the cluster.
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.
404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.
404InvalidDBClusterId.NotFoundThe DBInstanceId provided does not exist in our records.The specified DBClusterId parameter does not exist in the current record.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-03The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
Output ParametersThe response structure of the API has changed.
2023-06-12The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
    delete Error Codes: 400
2023-04-24The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 404