Creates a database account and grants permissions.
Operation description
This API is available only for cluster versions 21.8 and earlier. For newer versions, use a high-privilege account and SQL statements to modify user permissions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
clickhouse:CreateAccountAndAuthority |
create |
*DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| DBClusterId |
string |
Yes |
The cluster ID. |
cc-bp1p816075e21**** |
| AccountName |
string |
Yes |
The name of the database account.
|
test |
| AccountPassword |
string |
Yes |
The password for the database account. Note
|
123456Aa |
| AccountDescription |
string |
No |
The description of the database account.
|
ceshi |
| DmlAuthority |
string |
Yes |
Specifies the DML permissions for the database account. Valid values:
|
all |
| DdlAuthority |
boolean |
Yes |
Specifies whether to grant DDL permissions to the database account. Valid values:
|
true |
| AllowDatabases |
string |
Yes |
The databases to which the account has permissions. Separate multiple database names with commas (,). |
db1 |
| TotalDatabases |
string |
No |
All databases in the cluster. Separate multiple database names with commas (,). |
db1,db2 |
| AllowDictionaries |
string |
Yes |
The dictionaries to which the account has permissions. Separate multiple dictionary names with commas (,). |
dt1 |
| TotalDictionaries |
string |
No |
All dictionaries in the cluster. Separate multiple dictionary names with commas (,). |
dt1,dt2 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The request ID. |
F5178C10-1407-4987-9133-DE4DC9119F75 |
Examples
Success response
JSON format
{
"RequestId": "F5178C10-1407-4987-9133-DE4DC9119F75"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | InternalError | An error occurred while processing your request. | An error occurred while processing your request. |
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The DBClusterId provided does not exist in our records. |
| 503 | ServiceUnavailable | An error occurred while processing your request. | An error occurred while processing your request. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.