Queries all accounts or a specified account of an ApsaraDB for Redis instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeAccounts |
The operation that you want to perform. Set the value to DescribeAccounts. |
InstanceId | String | Yes | r-bp1zxszhcgatnx**** |
The ID of the instance. |
AccountName | String | No | demoaccount |
The name of the account that you want to manage. The name must start with a lowercase letter and can contain lowercase letters, digits, and underscores (_). The name can be 1 to 16 characters in length. |
RegionId | String | No | cn-hangzhou |
The ID of the region where the instance is deployed. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 6C9E114C-217C-4118-83C0-B4070222**** |
The ID of the request. |
Accounts | Array of Account |
The list of returned accounts of the ApsaraDB for Redis instances. |
|
Account | |||
AccountDescription | String | testdec |
The description of the account. |
AccountName | String | demoaccount |
The name of the account. |
AccountStatus | String | Available |
The status of the account. Valid values:
|
AccountType | String | Normal |
The type of account. Valid values:
|
DatabasePrivileges | Array of DatabasePrivilege |
The list of account permissions. |
|
DatabasePrivilege | |||
AccountPrivilege | String | RoleReadWrite |
The permissions of the account. Valid values:
Note In addition to reading data from and writing data to the ApsaraDB for Redis instance,
an account granted with the RoleRepl permission can run the SYNC and PSYNC commands.
|
InstanceId | String | r-bp10noxlhcoim2**** |
The ID of the instance. |
Examples
Sample requests
https://r-kvstore.aliyuncs.com/?Action=DescribeAccounts
&InstanceId=r-bp1zxszhcgatnx****
&<Common request parameters>
Sample success responses
XML
format
<DescribeAccountsResponse>
<RequestId>4A74FE3A-2BA8-4574-AB85-99C01707****</RequestId>
<Accounts>
<Account>
<AccountStatus>Available</AccountStatus>
<InstanceId>r-bp10noxlhcoim2****</InstanceId>
<AccountType>Normal</AccountType>
<DatabasePrivileges>
<DatabasePrivilege>
<AccountPrivilege>RoleReadWrite</AccountPrivilege>
</DatabasePrivilege>
</DatabasePrivileges>
<AccountName>r-bp10noxlhcoim2****</AccountName>
</Account>
<Account>
<AccountDescription></AccountDescription>
<AccountStatus>Available</AccountStatus>
<InstanceId>r-bp10noxlhcoim2****</InstanceId>
<AccountType>Normal</AccountType>
<DatabasePrivileges>
<DatabasePrivilege>
<AccountPrivilege>RoleReadWrite</AccountPrivilege>
</DatabasePrivilege>
</DatabasePrivileges>
<AccountName>testaccount</AccountName>
</Account>
</Accounts>
</DescribeAccountsResponse>
JSON
format
{
"RequestId": "4A74FE3A-2BA8-4574-AB85-99C01707****",
"Accounts": {
"Account": [
{
"AccountStatus": "Available",
"InstanceId": "r-bp10noxlhcoim2****",
"AccountType": "Normal",
"DatabasePrivileges": {
"DatabasePrivilege": [
{
"AccountPrivilege": "RoleReadWrite"
}
]
},
"AccountName": "r-bp10noxlhcoim2****"
},
{
"AccountDescription": "",
"AccountStatus": "Available",
"InstanceId": "r-bp10noxlhcoim2****",
"AccountType": "Normal",
"DatabasePrivileges": {
"DatabasePrivilege": [
{
"AccountPrivilege": "RoleReadWrite"
}
]
},
"AccountName": "testaccount"
}
]
}
}
Error codes
For a list of error codes, visit the API Error Center.