Creates an account with the specified permissions for an ApsaraDB for Redis instance.

Note
  • The engine version of the ApsaraDB for Redis instance is Redis 4.0 or later.
  • The ApsaraDB for Redis instance must be in the running state.
  • Up to 18 accounts can be created for an ApsaraDB for Redis instance.

For more information about how to perform the corresponding operation in the console, see Manage database accounts.

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 No CreateAccount

The operation that you want to perform. Set the value to CreateAccount.

AccountName String Yes demoaccount

The name of the account. The name must be 1 to 16 characters in length and contain lowercase letters, digits, and underscores (_). It must start with a lowercase letter.

AccountPassword String Yes uWonno233

The password of the account. The password must be 8 to 32 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include !@#$%^&*()_+-=.

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance.

AccountPrivilege String No RoleReadOnly

The permission of the account. Valid values:

  • RoleReadOnly
  • RoleReadWrite (Default)
AccountDescription String No this is a test account

The description of the account.

  • The description must start with a letter, and cannot start with http:// or https://.
  • The description can contain letters, underscores (_), hyphens (-), and digits.
  • The name must be 2 to 256 characters in length.
AccountType String No Normal

The type of the account. Set this value to Normal.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

Response parameters

Parameter Type Example Description
AcountName String demoaccount

The name of the account.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

RequestId String ABAF95F6-35C1-4177-AF3A-70969EBDF624

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/
? Action=CreateAccount
? AccountName=demoaccount
&AccountPassword=uWonno233
&InstanceId=r-bp1xxxxxxxxxxxxx
&<Common request parameters>

Sample success responses

XML format

<CreateAccountResponse>
      <RequestId>ABAF95F6-35C1-4177-AF3A-70969EBDF624</RequestId>
      <AcountName>demoaccount</AcountName>
</CreateAccountResponse>

JSON format

{
    "RequestId":"ABAF95F6-35C1-4177-AF3A-70969EBDF624",
    "AcountName":"demoaccount"
}

Error codes

For a list of error codes, visit the API Error Center.