Creates an account that has the specified permissions for an ApsaraDB for Redis instance.
- Only ApsaraDB for Redis instances of Redis 4.0 or later are supported.
- The ApsaraDB for Redis instance must be in the running state.
- You can create up to 18 accounts for an ApsaraDB for Redis instance.
For more information about how to perform the corresponding operations in the console, see Manage database accounts.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | 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 meet the following requirements:
|
AccountPassword | String | Yes | uWonno21**** |
The password of the account. The password must be 8 to 32 characters in length. It
must contain at least three of the following character types: uppercase letters, lowercase
letters, digits, and special characters. Special characters include |
InstanceId | String | Yes | r-bp1zxszhcgatnx**** |
The ID of the instance. |
AccountPrivilege | String | No | RoleReadOnly |
The permissions of the account. Default value: RoleReadWrite. Valid values:
|
AccountDescription | String | No | testaccount |
The description of the account.
|
AccountType | String | No | Normal |
The type of the account. Set the value to Normal. |
RegionId | String | No | cn-hangzhou |
The region ID of the instance. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
AcountName | String | demoaccount |
The name of the account. |
InstanceId | String | r-bp1zxszhcgatnx**** |
The ID of the instance. |
RequestId | String | ABAF95F6-35C1-4177-AF3A-70969EBD**** |
The ID of the request. |
Examples
Sample requests
https://r-kvstore.aliyuncs.com/?Action=CreateAccount
&AccountName=demoaccount
&AccountPassword=uWonno21****
&InstanceId=r-bp1zxszhcgatnx****
&<Common request parameters>
Sample success responses
XML
format
<CreateAccountResponse>
<RequestId>D3876765-1983-4CBC-BB45-79EEBD6D****</RequestId>
<InstanceId>r-bp1zxszhcgatnx****</InstanceId>
<AcountName>demoaccount</AcountName>
</CreateAccountResponse>
JSON
format
{
"RequestId": "D3876765-1983-4CBC-BB45-79EEBD6D****",
"InstanceId": "r-bp1zxszhcgatnx****",
"AcountName": "demoaccount"
}
Error codes
For a list of error codes, visit the API Error Center.