Queries the details of a database account of a PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | 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 page number of the returned page. 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:
Default value: 30. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PageRecordCount | Integer | 1 |
The number of entries returned per page. |
RequestId | String | 155462B9-205F-4FFC-BB43-4855FE****** |
The ID of the request. |
PageNumber | Integer | 1 |
The number of the returned page. |
Accounts | Array of DBAccount |
The details of the account. |
|
AccountStatus | String | Available |
The status of the account. Valid values:
|
DatabasePrivileges | Array of DatabasePrivilege |
The list of database permissions that are granted to the account. |
|
DBName | String | DBtest |
The name of the database whose tables you want to query. |
AccountPrivilege | String | ReadOnly |
Indicates the permissions that an account is granted on the database. Valid values: |
AccountDescription | String | test |
The description of the account. |
AccountPasswordValidTime | String | undefined |
The validity period of the password. |
AccountType | String | Normal |
The type of the account. Valid values:
|
AccountLockState | String | UnLock |
The locking status of the account. Valid values: Valid values:
|
AccountName | String | test_acc |
The name of the account. |
AccountPassword | String | Test1111 |
The password of the account. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=DescribeAccounts
&DBClusterId=pc-***************
&AccountName=test_acc
&PageNumber=1
&PageSize=30
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeAccountsResponse>
<PageRecordCount>1</PageRecordCount>
<RequestId>155462B9-205F-4FFC-BB43-4855FE******</RequestId>
<PageNumber>1</PageNumber>
<Accounts>
<AccountStatus>Available</AccountStatus>
<DatabasePrivileges>
<DBName>DBtest</DBName>
<AccountPrivilege>ReadOnly</AccountPrivilege>
</DatabasePrivileges>
<AccountDescription>test</AccountDescription>
<AccountPasswordValidTime>undefined</AccountPasswordValidTime>
<AccountType>Normal</AccountType>
<AccountLockState>UnLock</AccountLockState>
<AccountName>test_acc</AccountName>
<AccountPassword>Test1111</AccountPassword>
</Accounts>
</DescribeAccountsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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 code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | The error message returned because the specified PageSize parameter is invalid. |
400 | InvalidPageNumber.Malformed | The specified parameter PageNumber is not valid. | The error message returned because the specified PageNumber parameter is invalid. |
400 | Database.ConnectError | db instance %s connect failed, please check instance status and database processlist | The error message returned because the cluster %s is not connected. Check the cluster status and database process list. |
400 | Account.QueryError | Instance %s query account error | The error message returned because an error occurs when you query accounts for cluster %s. |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified cluster ID does not exist. |
404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The error message returned because the specified DBClusterId parameter is invalid. |
For a list of error codes, visit the API Error Center.