Method create

Creates a ClickHouse user in the specified cluster.

HTTP request

POST https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/{clusterId}/users

Path parameters

Parameter Description
clusterId Required. ID of the ClickHouse cluster to create a user in. To get the cluster ID, use a list request. The maximum string length in characters is 50.

Body parameters

{
  "userSpec": {
    "name": "string",
    "password": "string",
    "permissions": [
      {
        "databaseName": "string"
      }
    ],
    "settings": {
      "readonly": "integer",
      "allowDdl": true,
      "insertQuorum": "integer",
      "insertQuorumTimeout": "integer",
      "selectSequentialConsistency": true,
      "maxReplicaDelayForDistributedQueries": "integer",
      "fallbackToStaleReplicasForDistributedQueries": true,
      "maxThreads": "integer",
      "maxBlockSize": "integer",
      "maxInsertBlockSize": "integer",
      "maxMemoryUsage": "integer",
      "maxMemoryUsageForUser": "integer",
      "maxRowsToRead": "integer",
      "maxBytesToRead": "integer",
      "readOverflowMode": "string",
      "maxRowsToGroupBy": "integer",
      "groupByOverflowMode": "string",
      "maxRowsToSort": "integer",
      "maxBytesToSort": "integer",
      "sortOverflowMode": "string",
      "maxResultRows": "integer",
      "maxResultBytes": "integer",
      "resultOverflowMode": "string",
      "maxRowsInDistinct": "integer",
      "maxBytesInDistinct": "integer",
      "distinctOverflowMode": "string",
      "maxRowsToTransfer": "integer",
      "maxBytesToTransfer": "integer",
      "transferOverflowMode": "string",
      "maxExecutionTime": "integer",
      "timeoutOverflowMode": "string",
      "maxColumnsToRead": "integer",
      "maxTemporaryColumns": "integer",
      "maxTemporaryNonConstColumns": "integer",
      "maxQuerySize": "integer",
      "maxAstDepth": "integer",
      "maxAstElements": "integer",
      "maxExpandedAstElements": "integer"
    }
  }
}
Field Description
userSpec object

Required. Properties of the user to be created.

userSpec.
name
string

Required. Name of the ClickHouse user.

The maximum string length in characters is 63. Value must match the regular expression [a-zA-Z0-9_]*.

userSpec.
password
string

Required. Password of the ClickHouse user.

The string length in characters must be 8-128.

userSpec.
permissions[]
object

Set of permissions to grant to the user.

userSpec.
permissions[].
databaseName
string

Name of the database that the permission grants access to.

userSpec.
settings
object

ClickHouse user settings. Supported settings are a limited subset of all settings described in ClickHouse documentation.

userSpec.
settings.
readonly
integer (int64)

See in-depth description in ClickHouse documentation.

Acceptable values are 0 to 2, inclusive.

userSpec.
settings.
allowDdl
boolean (boolean)

See in-depth description in ClickHouse documentation.

userSpec.
settings.
insertQuorum
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
insertQuorumTimeout
integer (int64)

Quorum write timeout in milliseconds. Default value: 60000. See in-depth description in ClickHouse documentation.

The minimum value is 1000.

userSpec.
settings.
selectSequentialConsistency
boolean (boolean)

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxReplicaDelayForDistributedQueries
integer (int64)

Max replica delay in milliseconds. If a replica lags more than the set value, this replica is not used. Default value: 300000. See in-depth description in ClickHouse documentation.

The minimum value is 1000.

userSpec.
settings.
fallbackToStaleReplicasForDistributedQueries
boolean (boolean)

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxThreads
integer (int64)

See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxBlockSize
integer (int64)

See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxInsertBlockSize
integer (int64)

See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxMemoryUsage
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxMemoryUsageForUser
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxRowsToRead
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxBytesToRead
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
readOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxRowsToGroupBy
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
groupByOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxRowsToSort
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxBytesToSort
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
sortOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxResultRows
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxResultBytes
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
resultOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxRowsInDistinct
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxBytesInDistinct
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
distinctOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxRowsToTransfer
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxBytesToTransfer
integer (int64)

See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
transferOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxExecutionTime
integer (int64)

Maximum query execution time in milliseconds. See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
timeoutOverflowMode
string

See in-depth description in ClickHouse documentation.

userSpec.
settings.
maxColumnsToRead
integer (int64)

Maximum number of columns that can be read from a table in a single query. See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxTemporaryColumns
integer (int64)

Maximum number of temporary columns that must be kept in RAM at the same time when running a query, including constant columns. See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxTemporaryNonConstColumns
integer (int64)

Maximum number of temporary columns that must be kept in RAM at the same time when running a query, excluding constant columns. See in-depth description in ClickHouse documentation.

The minimum value is 0.

userSpec.
settings.
maxQuerySize
integer (int64)

The maximum part of a query that can be taken to RAM for parsing with the SQL parser, in bytes. Default value: 262144. See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxAstDepth
integer (int64)

Maximum depth of query syntax tree. Default value: 1000. See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxAstElements
integer (int64)

Maximum size of query syntax tree in number of nodes. Default value: 50000. See in-depth description in ClickHouse documentation.

Value must be greater than 0.

userSpec.
settings.
maxExpandedAstElements
integer (int64)

Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk. Default value: 500000.

Value must be greater than 0.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // end of the list of possible fields

}

An Operation resource. For more information, see Operation.

Field Description
id string

ID of the operation.

description string

Description of the operation. 0-256 characters long.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.