Creates an account for an ApsaraDB for Tair (Redis® OSS-Compatible) database instance.
Operation description
This API operation supports only instances that are compatible with Redis 4.0 or later.
The instance status must be Running when you call this API operation.
You can create up to 18 accounts for each instance.
For the console operation that corresponds to this API operation, see Account management.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:CreateAccount |
create |
*DBInstance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
r-bp1zxszhcgatnx**** |
| AccountName |
string |
Yes |
The account name. The name must meet the following requirements:
|
demoaccount |
| AccountPrivilege |
string |
No |
The permissions of the account. Valid values:
|
RoleReadOnly |
| AccountPassword |
string |
Yes |
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, special characters, and digits. The following special characters are supported: |
uWonno21**** |
| AccountDescription |
string |
No |
The description of the account.
|
testaccount |
| AccountType |
string |
No |
The account type. Set the value to Normal (standard account). |
Normal |
| SourceBiz |
string |
No |
This parameter is used only for internal maintenance. You do not need to specify this parameter. |
SDK |
| Parameters |
string |
No |
The account parameters to modify in JSON format. The new values overwrite the original values. Important This parameter is supported only for Tair Serverless KV instances. |
{"access-db-id":"1","cu-limit":"10"} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABAF95F6-35C1-4177-AF3A-70969EBD**** |
| InstanceId |
string |
The instance ID. |
r-bp1zxszhcgatnx**** |
| AcountName |
string |
[Deprecated] This parameter is deprecated. |
demoaccount |
| AccountName |
string |
The account name. |
demoaccount |
Examples
Success response
JSON format
{
"RequestId": "ABAF95F6-35C1-4177-AF3A-70969EBD****",
"InstanceId": "r-bp1zxszhcgatnx****",
"AcountName": "demoaccount",
"AccountName": "demoaccount"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidAccountName.Duplicate | Specified AccountName already exists in this instance. | The error message returned because the account already exists. |
| 400 | InvalidAccountName.Format | Specified AccountName is not valid. | |
| 400 | InvalidEngineVersion.Format | Current EngineVersion does not support operations. | The operation is not supported while the instance runs this engine version. |
| 400 | InvalidAccountDescription.Format | Specified AccountDescription is not valid. | |
| 400 | InvalidAccountPassword.Format | Specified AccountPassword is not valid. | |
| 400 | InvalidDBInstanceAccountMode.Format | Current DB instance AccountMode does not support this operation. | |
| 400 | InvalidAccountName.Forbid | Specified AccountName is a keyword. | |
| 400 | InvalidAccountPrivilege.Malformed | Specified account privilege is not valid. | |
| 403 | AccountLimitExceeded | Exceeding the allowed amount of account. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.