Queries the details of one or all of the accounts that were created in 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.

RegionId String No cn-hangzhou

The region ID the instance.

InstanceId String Yes r-bp1zxszhcgatnx****

The ID of the instance.

AccountName String No demoaccount

The name of the account that you want to query.

Response parameters

Parameter Type Example Description
RequestId String 6C9E114C-217C-4118-83C0-B4070222****

The ID of the request.

Accounts Array of Account

Details about returned accounts of the instance.

Account
AccountDescription String testdec

The description of the account.

InstanceId String r-bp10noxlhcoim2****

The ID of the instance.

AccountType String Normal

The type of the account. Valid values:

  • Normal: standard account
  • Super: super account
AccountStatus String Available

The state of the account. Valid values:

  • Unavailable: The account is unavailable.
  • Available: The account is available.
AccountName String demoaccount

The name of the account.

DatabasePrivileges Array of DatabasePrivilege

Details about account permissions.

DatabasePrivilege
AccountPrivilege String RoleReadWrite

The permission 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.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/?Action=DescribeAccounts
&InstanceId=r-bp1zxszhcgatnx****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<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/>
            <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

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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.