Creates a database account for an ApsaraDB for ClickHouse cluster and grants permissions to the database account.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateAccountAndAuthority |
The operation that you want to perform. Set the value to CreateAccountAndAuthority. |
RegionId | String | Yes | cn-hangzhou |
The region ID. You can call the DescribeRegions operation to query the most recent region list. |
DBClusterId | String | Yes | cc-bp1p816075e21**** |
The ID of the cluster. |
AccountName | String | Yes | test |
The username of the database account. Note
|
AccountPassword | String | Yes | 123456Aa |
The password of the database account. Note
|
AccountDescription | String | Yes | ceshi |
The description of the database account. Note
|
DmlAuthority | String | Yes | all |
Specifies whether to grant DML permissions to the database account. Valid values:
|
DdlAuthority | Boolean | Yes | true |
Specifies whether to grant DDL permissions to the database account. Valid values:
|
AllowDatabases | String | Yes | db1 |
The list of databases to which you want to grant permissions. Separate databases with commas (,). |
TotalDatabases | String | No | db1,db2 |
The list of all databases. Separate databases with commas (,). |
AllowDictionaries | String | Yes | dt1 |
The list of dictionaries to which you want to grant permissions. Separate dictionaries with commas (,). |
TotalDictionaries | String | No | dt1,dt2 |
A list of all dictionaries. Separate dictionaries with commas (,). |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | F5178C10-1407-4987-9133-DE4DC9119F75 |
The ID of the request. |
Examples
Sample requests
http(s)://clickhouse.aliyuncs.com/?Action=CreateAccountAndAuthority
&RegionId=cn-hangzhou
&DBClusterId=cc-bp1p816075e21****
&AccountName=test
&AccountPassword=123456Aa
&AccountDescription=ceshi
&DmlAuthority=all
&DdlAuthority=true
&AllowDatabases=db1
&TotalDatabases=db1,db2
&AllowDictionaries=dt1
&TotalDictionaries=dt1,dt2
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateAccountAndAuthorityResponse>
<RequestId>F5178C10-1407-4987-9133-DE4DC9119F75</RequestId>
</CreateAccountAndAuthorityResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "F5178C10-1407-4987-9133-DE4DC9119F75"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified DBClusterId parameter does not exist. Check whether the cluster ID is valid. |
500 | InternalError | An error occurred while processing your request. | The error message returned because an internal error has occurred. Try again later. |
503 | ServiceUnavailable | An error occurred while processing your request. | The error message returned because the service is unavailable. Try again later. |
For a list of error codes, visit the API Error Center.