Method update

Updates the specified ClickHouse cluster.

HTTP request

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

Path parameters

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

Body parameters

 {
  "updateMask": "string",
  "description": "string",
  "labels": "object",
  "configSpec": {
    "clickhouse": {
      "config": {
        "logLevel": "string",
        "mergeTree": {
          "replicatedDeduplicationWindow": "integer",
          "replicatedDeduplicationWindowSeconds": "integer"
        },
        "compression": [
          {
            "method": "string",
            "minPartSize": "string",
            "minPartSizeRatio": "number"
          }
        ],
        "dictionaries": [
          {
            "name": "string",
            "structure": {
              "id": {
                "name": "string"
              },
              "key": {
                "attributes": [
                  {
                    "name": "string",
                    "type": "string",
                    "nullValue": "string",
                    "expression": "string",
                    "hierarchical": true,
                    "injective": true
                  }
                ]
              },
              "attributes": [
                {
                  "name": "string",
                  "type": "string",
                  "nullValue": "string",
                  "expression": "string",
                  "hierarchical": true,
                  "injective": true
                }
              ]
            },
            "layout": {
              "type": "string",
              "sizeInCells": "string"
            },

            // `configSpec.clickhouse.config.dictionaries[]`includes only one of the fields `httpSource`, `mysqlSource`, `clickhouseSource`, `mongodbSource`
            "fixedLifetime": "string",
            "lifetimeRange": {
              "min": "string",
              "max": "string"
            },
            // end of the list of possible fields`configSpec.clickhouse.config.dictionaries[]`

            "httpSource": {
              "url": "string",
              "format": "string"
            },
            "mysqlSource": {
              "db": "string",
              "table": "string",
              "port": "string",
              "user": "string",
              "password": "string",
              "replicas": [
                {
                  "host": "string",
                  "priority": "string",
                  "port": "string",
                  "user": "string",
                  "password": "string"
                }
              ],
              "where": "string",
              "invalidateQuery": "string"
            },
            "clickhouseSource": {
              "db": "string",
              "table": "string",
              "host": "string",
              "port": "string",
              "user": "string",
              "password": "string",
              "where": "string"
            },
            "mongodbSource": {
              "db": "string",
              "collection": "string",
              "host": "string",
              "port": "string",
              "user": "string",
              "password": "string"
            }
          }
        ],
        "graphiteRollup": [
          {
            "name": "string",
            "patterns": [
              {
                "regexp": "string",
                "function": "string",
                "retention": [
                  {
                    "age": "string",
                    "precision": "string"
                  }
                ]
              }
            ]
          }
        ],
        "maxConnections": "integer",
        "maxConcurrentQueries": "integer",
        "keepAliveTimeout": "integer",
        "uncompressedCacheSize": "integer",
        "markCacheSize": "integer",
        "maxTableSizeToDrop": "integer",
        "builtinDictionariesReloadInterval": "integer"
      },
      "resources": {
        "resourcePresetId": "string",
        "diskSize": "string",
        "diskTypeId": "string"
      }
    },
    "zookeeper": {
      "resources": {
        "resourcePresetId": "string",
        "diskSize": "string",
        "diskTypeId": "string"
      }
    }
  }
}
Field Description
updateMask string

Field mask that specifies which fields of the ClickHouse Cluster resource should be updated.

A comma-separated names off ALL fields to be updated. Оnly the specified fields will be changed. The others will be left untouched. If the field is specified in updateMask and no value for that field was sent in the request, the field's value will be reset to the default. The default value for most fields is null or 0.

If updateMask is not sent in the request, all fields' values will be updated. Fields specified in the request will be updated to provided values. The rest of the fields will be reset to the default.

description string

New description of the ClickHouse cluster.

The maximum string length in characters is 256.

labels object

Custom labels for the ClickHouse cluster as key:value pairs. Maximum 64 per resource. For example, "project": "mvp" or "source": "dictionary".

The new set of labels will completely replace the old ones. To add a label, request the current set with the get method, then send an update request with the new label added to the set.

No more than 64 per resource. The maximum string length in characters for each key is 63. Each key must match the regular expression [a-z][-_0-9a-z]. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z].

configSpec object

New configuration and resources for hosts in the cluster.

configSpec.
clickhouse
object

Configuration and resources for a ClickHouse server.

configSpec.
clickhouse.
config
object

Configuration for a ClickHouse server.

ClickHouse configuration options. Detailed description for each set of options is available in ClickHouse documentation.

Any options not listed here are not supported.

configSpec.
clickhouse.
config.
logLevel
string

Logging level for the ClickHouse cluster.

configSpec.
clickhouse.
config.
mergeTree
object

Settings for the MergeTree engine. See description in ClickHouse documentation.

Options specific to the MergeTree table engine.

configSpec.
clickhouse.
config.
mergeTree.
replicatedDeduplicationWindow
integer (int64)

Number of blocks of hashes to keep in ZooKeeper. See detailed description in ClickHouse sources.

configSpec.
clickhouse.
config.
mergeTree.
replicatedDeduplicationWindowSeconds
integer (int64)

Period of time to keep blocks of hashes for. See detailed description in ClickHouse sources.

configSpec.
clickhouse.
config.
compression[]
object

Compression settings for the ClickHouse cluster. See in-depth description in ClickHouse documentation.

configSpec.
clickhouse.
config.
compression[].
method
string

Compression method to use for the specified combination of min_part_size and min_part_size_ratio.

configSpec.
clickhouse.
config.
compression[].
minPartSize
string (int64)

Minimum size of a part of a table.

The minimum value is 1.

configSpec.
clickhouse.
config.
compression[].
minPartSizeRatio
number (double)

Minimum ratio of a part relative to the size of all the data in the table.

configSpec.
clickhouse.
config.
dictionaries[]
object

Configuration of external dictionaries to be used by the ClickHouse cluster. See in-depth description in ClickHouse documentation.

configSpec.
clickhouse.
config.
dictionaries[].
name
string

Required. Name of the external dictionary.

configSpec.
clickhouse.
config.
dictionaries[].
structure
object
configSpec.
clickhouse.
config.
dictionaries[].
structure.
id
object

Single numeric key column for the dictionary.

Numeric key.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
id.
name
string

Required. Name of the numeric key.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key
object

Complex key for the dictionary, containing of one or more key column(s).

Complex key.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[]
object

Required. Attributes of a complex key.

Must contain at least one element.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
name
string

Required. Name of the column.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
type
string

Required. Type of the column.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
nullValue
string

Default value for an element without data (for example, an empty string).

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
expression
string

Expression, describing the attribute, if appicable.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
hierarchical
boolean (boolean)

Indication of hierarchy support. Default value: "false".

configSpec.
clickhouse.
config.
dictionaries[].
structure.
key.
attributes[].
injective
boolean (boolean)

Indication of injective mapping "id -> attribute". Default value: "false".

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[]
object

Required. Description of the fields available for database queries.

Must contain at least one element.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
name
string

Required. Name of the column.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
type
string

Required. Type of the column.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
nullValue
string

Default value for an element without data (for example, an empty string).

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
expression
string

Expression, describing the attribute, if appicable.

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
hierarchical
boolean (boolean)

Indication of hierarchy support. Default value: "false".

configSpec.
clickhouse.
config.
dictionaries[].
structure.
attributes[].
injective
boolean (boolean)

Indication of injective mapping "id -> attribute". Default value: "false".

configSpec.
clickhouse.
config.
dictionaries[].
layout
object

Layout determining how to store the dictionary in memory.

configSpec.
clickhouse.
config.
dictionaries[].
layout.
type
string

Required. Layout type for an external dictionary.

  • FLAT: The entire dictionary is stored in memory in the form of flat arrays. Available for all dictionary sources.
  • HASHED: The entire dictionary is stored in memory in the form of a hash table. Available for all dictionary sources.
  • COMPLEX_KEY_HASHED: Similar to HASHED, to be used with composite keys. Available for all dictionary sources.
  • RANGE_HASHED: The entire dictionary is stored in memory in the form of a hash table, with an ordered array of ranges and their corresponding values. Available for all dictionary sources.
  • CACHE: The dictionary is stored in a cache with a set number of cells. Available for MySQL, ClickHouse and HTTP dictionary sources.
  • COMPLEX_KEY_CACHE: Similar to CACHE, to be used with composite keys. Available for MySQL, ClickHouse and HTTP dictionary sources.
configSpec.
clickhouse.
config.
dictionaries[].
layout.
sizeInCells
string (int64)

Number of cells in the cache. Rounded up to a power of two. Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

configSpec.
clickhouse.
config.
dictionaries[].
fixedLifetime
string (int64)
configSpec.clickhouse.config.dictionaries[] includes only one of the fields fixedLifetime, lifetimeRange

Fixed interval between dictionaty updates.

configSpec.
clickhouse.
config.
dictionaries[].
lifetimeRange
object
configSpec.clickhouse.config.dictionaries[] includes only one of the fields fixedLifetime, lifetimeRange

configSpec.
clickhouse.
config.
dictionaries[].
lifetimeRange.
min
string (int64)

Minimum dictionary lifetime.

configSpec.
clickhouse.
config.
dictionaries[].
lifetimeRange.
max
string (int64)

Maximum dictionary lifetime.

configSpec.
clickhouse.
config.
dictionaries[].
httpSource
object
configSpec.clickhouse.config.dictionaries[] includes only one of the fields httpSource, mysqlSource, clickhouseSource, mongodbSource

configSpec.
clickhouse.
config.
dictionaries[].
httpSource.
url
string

Required. URL of the source dictionary available over HTTP.

configSpec.
clickhouse.
config.
dictionaries[].
httpSource.
format
string

Required. The data format. Valid values are all formats supported by ClickHouse SQL dialect.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource
object
configSpec.clickhouse.config.dictionaries[] includes only one of the fields httpSource, mysqlSource, clickhouseSource, mongodbSource

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
db
string

Required. Name of the MySQL database to connect to.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
table
string

Required. Name of the database table to use as a ClickHouse dictionary.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
port
string (int64)

Default port to use when connecting to a replica of the dictionary source.

Acceptable values are 0 to 65535, inclusive.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
user
string

Name of the default user for replicas of the dictionary source.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
password
string

Password of the default user for replicas of the dictionary source.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[]
object

Required. List of MySQL replicas of the database used as dictionary source.

Must contain at least one element.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[].
host
string

Required. MySQL host of the replica.

The maximum string length in characters is 253.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[].
priority
string (int64)

Required. The priority of the replica that ClickHouse takes into account when connecting. Replica with the highest priority should have this field set to the lowest number.

Value must be greater than 0.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[].
port
string (int64)

Port to use when connecting to the replica. If a port is not specified for a replica, ClickHouse uses the port specified for the source.

Acceptable values are 0 to 65535, inclusive.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[].
user
string

Name of the MySQL database user.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
replicas[].
password
string

Password of the MySQL database user.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
where
string

Selection criteria for the data in the specified MySQL table.

configSpec.
clickhouse.
config.
dictionaries[].
mysqlSource.
invalidateQuery
string

Query for checking the dictionary status, to pull only updated data. For more details, see ClickHouse documentation on dictionaries.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource
object
configSpec.clickhouse.config.dictionaries[] includes only one of the fields httpSource, mysqlSource, clickhouseSource, mongodbSource

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
db
string

Required. Name of the ClickHouse database.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
table
string

Required. Name of the table in the specified database to be used as the dictionary source.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
host
string

Required. ClickHouse host of the specified database.

The maximum string length in characters is 253.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
port
string (int64)

Port to use when connecting to the host.

Acceptable values are 0 to 65535, inclusive.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
user
string

Required. Name of the ClickHouse database user.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
password
string

Password of the ClickHouse database user.

configSpec.
clickhouse.
config.
dictionaries[].
clickhouseSource.
where
string

Selection criteria for the data in the specified ClickHouse table.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource
object
configSpec.clickhouse.config.dictionaries[] includes only one of the fields httpSource, mysqlSource, clickhouseSource, mongodbSource

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
db
string

Required. Name of the MongoDB database.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
collection
string

Required. Name of the collection in the specified database to be used as the dictionary source.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
host
string

Required. MongoDB host of the specified database.

The maximum string length in characters is 253.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
port
string (int64)

Port to use when connecting to the host.

Acceptable values are 0 to 65535, inclusive.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
user
string

Required. Name of the MongoDB database user.

configSpec.
clickhouse.
config.
dictionaries[].
mongodbSource.
password
string

Password of the MongoDB database user.

configSpec.
clickhouse.
config.
graphiteRollup[]
object

Rollup settings for the GraphiteMergeTree table engine.

configSpec.
clickhouse.
config.
graphiteRollup[].
name
string

Required. Name for the specified combination of settings for Graphite rollup.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[]
object

Required. Pattern to use for the rollup.

Must contain at least one element.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[].
regexp
string

Pattern for metric names.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[].
function
string

Required. Name of the aggregating function to apply to data of the age specified in retention.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[].
retention[]
object

Required. Age of data to use for thinning.

Must contain at least one element.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[].
retention[].
age
string (int64)

Minimum age of the data in seconds.

Value must be greater than 0.

configSpec.
clickhouse.
config.
graphiteRollup[].
patterns[].
retention[].
precision
string (int64)

Precision of determining the age of the data, in seconds.

Value must be greater than 0.

configSpec.
clickhouse.
config.
maxConnections
integer (int64)

Maximum number of inbound connections.

The minimum value is 10.

configSpec.
clickhouse.
config.
maxConcurrentQueries
integer (int64)

Maximum number of simultaneously processed requests.

The minimum value is 10.

configSpec.
clickhouse.
config.
keepAliveTimeout
integer (int64)

Number of milliseconds that ClickHouse waits for incoming requests before closing the connection.

configSpec.
clickhouse.
config.
uncompressedCacheSize
integer (int64)

Cache size (in bytes) for uncompressed data used by MergeTree tables. See in-depth description in ClickHouse documentation.

configSpec.
clickhouse.
config.
markCacheSize
integer (int64)

Approximate size (in bytes) of the cache of "marks" used by MergeTree tables. See details in ClickHouse documentation.

Value must be greater than 5368709120.

configSpec.
clickhouse.
config.
maxTableSizeToDrop
integer (int64)

Maximum size of the table that can be deleted using a DROP query. See in-depth description in ClickHouse documentation.

configSpec.
clickhouse.
config.
builtinDictionariesReloadInterval
integer (int64)

Time interval for reloading built-in dictionaries. See in-depth description in ClickHouse documentation.

configSpec.
clickhouse.
resources
object

Resources allocated to ClickHouse hosts.

configSpec.
clickhouse.
resources.
resourcePresetId
string

ID of the preset for computational resources available to a host (CPU, memory etc.). All available presets are listed in the documentation

configSpec.
clickhouse.
resources.
diskSize
string (int64)

Volume of the storage available to a host, in bytes.

configSpec.
clickhouse.
resources.
diskTypeId
string

Type of the storage environment for the host. Possible values:

  • network-hdd — network HDD drive,
  • network-nvme — network SSD drive,
  • local-nvme — local SSD storage.
configSpec.
zookeeper
object

Configuration and resources for a ZooKeeper server.

configSpec.
zookeeper.
resources
object

Resources allocated to ZooKeeper hosts.

configSpec.
zookeeper.
resources.
resourcePresetId
string

ID of the preset for computational resources available to a host (CPU, memory etc.). All available presets are listed in the documentation

configSpec.
zookeeper.
resources.
diskSize
string (int64)

Volume of the storage available to a host, in bytes.

configSpec.
zookeeper.
resources.
diskTypeId
string

Type of the storage environment for the host. Possible values:

  • network-hdd — network HDD drive,
  • network-nvme — network SSD drive,
  • local-nvme — local SSD storage.

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 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. This value is 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
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.