Description
You can call this API to create an account for a distributed database instance. You can create a maximum of three accounts for the instance.
Note The required parameters in this operation contain private data such as passwords. For your data security, you must call this operation over HTTPS.
Request parameters
Name | Type | Required | Description |
---|---|---|---|
<Common request parameters> | - | - | For more information, see Common parameters. |
Action | String | Yes | Required parameter, and the value is CreateAccount. |
InstanceId | String | Yes | The ID of the instance. |
AccountName | String | Yes | The name of the account. The account name must be 2-10 characters in length. It must start with a lowercase letter and can contain lowercase letters, numbers, and underscores (_). |
AccountPassword | String | Yes | The password for the account. The password must be 8-32 characters in length. It must contain at least three types of characters, including uppercase letters, lowercase letters, number, and special characters. |
AccountType | String | No | The type of the account. Valid values: Normal and Super.
|
DBInfo | String | No | The key-value pairs that map account privileges to databases. The account privilege can be:
For example, |
DBName | String | No | The name of the database. Separate multiple databases by commas (,). |
AccountPrivilege | String | No | The privilege of the account. Valid values:
|
AccountDescription | String | No | The description of the account.
Note The description cannot start with http:// or https://. It must start with a Chinese character or a letter. It can contain Chinese characters, letters, numbers, underscores (_), and hyphens (-). The description must be 2-256 characters in length.
|
ClientToken | String | No | The client token, used to perform idempotence check. |
AccountVersion | String | No | The version of an account, and the value can be 0 or 1.
|
Response parameters
Name | Type | Description |
---|---|---|
<Common response parameters> | - | For more information, see Common response parameters. |
Sample requests
https://petadata.aliyuncs.com/?Action=CreateAccount
&InstanceId=pd-xxxxxxxxxxxxxx
&AccountName=testacc02
&AccountPassword=Pw123456
&<[Common request parameters]>
Sample responses
XML format
<CreateAccountResponse>
<RequestId>2FED790E-FB61-4721-8C1C-07C627FA5A19</RequestId>
</CreateAccountResponse>
JSON format
{
"RequestId": "2FED790E-FB61-4721-8C1C-07C627FA5A19"
}