Queries all accounts or a specified account of an ApsaraDB for Redis instance.

Note Only ApsaraDB for Redis instances of Redis 4.0 or later are supported.

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 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. The name must meet the following requirements:

  • The name can contain lowercase letters, digits, and hyphens (-), and must start with a lowercase letter.
  • The name can be up to 100 characters in length.
  • The name cannot be one of the reserved words in the Reserved words for Redis account names section.
RegionId String No cn-hangzhou

The region ID of the instance.

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 instance.

Account
AccountDescription String testdec

The description of the account.

AccountName String demoaccount

The name of the account.

AccountStatus String Available

The state of the account. Valid values:

  • Unavailable: The account is unavailable.
  • Available: The account is available.
AccountType String Normal

The type of the account. Valid values:

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

The list of account permissions.

DatabasePrivilege
AccountPrivilege String RoleReadWrite

The permissions of the account. Default value: RoleReadWrite. Valid values:

  • RoleReadOnly: The account has the read-only permissions.
  • RoleReadWrite: The account has the read and write permissions.
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.