Managed Service for ClickHouse API, REST: Cluster.CreateExternalDictionary
Creates an external dictionary for the specified ClickHouse cluster.
HTTP request
POST https://mdb.api.yandexcloud.kz/managed-clickhouse/v1/clusters/{clusterId}:createExternalDictionary
Path parameters
|
Field |
Description |
|
clusterId |
string Required field. ID of the ClickHouse cluster to create the external dictionary for. The maximum string length in characters is 50. |
Body parameters
{
"externalDictionary": {
"name": "string",
"structure": {
"id": {
"name": "string"
},
"key": {
"attributes": [
{
"name": "string",
"type": "string",
"nullValue": "string",
"expression": "string",
"hierarchical": "boolean",
"injective": "boolean"
}
]
},
"rangeMin": {
"name": "string",
"type": "string",
"nullValue": "string",
"expression": "string",
"hierarchical": "boolean",
"injective": "boolean"
},
"rangeMax": {
"name": "string",
"type": "string",
"nullValue": "string",
"expression": "string",
"hierarchical": "boolean",
"injective": "boolean"
},
"attributes": [
{
"name": "string",
"type": "string",
"nullValue": "string",
"expression": "string",
"hierarchical": "boolean",
"injective": "boolean"
}
]
},
"layout": {
"type": "string",
"sizeInCells": "string",
"allowReadExpiredKeys": "boolean",
"maxUpdateQueueSize": "string",
"updateQueuePushTimeoutMilliseconds": "string",
"queryWaitTimeoutMilliseconds": "string",
"maxThreadsForUpdates": "string",
"initialArraySize": "string",
"maxArraySize": "string",
"accessToKeyFromAttributes": "boolean"
},
// Includes only one of the fields `fixedLifetime`, `lifetimeRange`
"fixedLifetime": "string",
"lifetimeRange": {
"min": "string",
"max": "string"
},
// end of the list of possible fields
// Includes only one of the fields `httpSource`, `mysqlSource`, `clickhouseSource`, `mongodbSource`, `postgresqlSource`
"httpSource": {
"url": "string",
"format": "string",
"headers": [
{
"name": "string",
"value": "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",
"closeConnection": "boolean",
"shareConnection": "boolean"
},
"clickhouseSource": {
"db": "string",
"table": "string",
"host": "string",
"port": "string",
"user": "string",
"password": "string",
"where": "string",
"secure": "boolean"
},
"mongodbSource": {
"db": "string",
"collection": "string",
"host": "string",
"port": "string",
"user": "string",
"password": "string",
"options": "string"
},
"postgresqlSource": {
"db": "string",
"table": "string",
"hosts": [
"string"
],
"port": "string",
"user": "string",
"password": "string",
"invalidateQuery": "string",
"sslMode": "string"
}
// end of the list of possible fields
}
}
|
Field |
Description |
|
externalDictionary |
Configuration of the external dictionary. |
ExternalDictionary
External dictionary configuration.
|
Field |
Description |
|
name |
string Required field. Name of the external dictionary. |
|
structure |
Required field. Structure of the external dictionary. |
|
layout |
Required field. Layout determining how to store the dictionary in memory. For details, see https://clickhouse.com/docs/sql-reference/dictionaries#ways-to-store-dictionaries-in-memory. |
|
fixedLifetime |
string (int64) Fixed interval between dictionary updates. Includes only one of the fields |
|
lifetimeRange |
Range of intervals between dictionary updates for ClickHouse to choose from. Includes only one of the fields |
|
httpSource |
HTTP source for the dictionary. Includes only one of the fields |
|
mysqlSource |
MySQL source for the dictionary. Includes only one of the fields |
|
clickhouseSource |
ClickHouse source for the dictionary. Includes only one of the fields |
|
mongodbSource |
MongoDB source for the dictionary. Includes only one of the fields |
|
postgresqlSource |
PostgreSQL source for the dictionary. Includes only one of the fields |
Structure
Configuration of external dictionary structure.
|
Field |
Description |
|
id |
Single numeric key column for the dictionary. |
|
key |
Composite key for the dictionary, containing of one or more key columns. For details, see ClickHouse documentation |
|
rangeMin |
Field holding the beginning of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation |
|
rangeMax |
Field holding the end of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation |
|
attributes[] |
Description of the fields available for database queries. For details, see ClickHouse documentation The number of elements must be greater than 0. |
Id
Numeric key.
|
Field |
Description |
|
name |
string Required field. Name of the numeric key. |
Key
Complex key.
|
Field |
Description |
|
attributes[] |
Attributes of a complex key. The number of elements must be greater than 0. |
Attribute
|
Field |
Description |
|
name |
string Required field. Name of the column. |
|
type |
string Required field. Type of the column. |
|
nullValue |
string Default value for an element without data (for example, an empty string). |
|
expression |
string Expression, describing the attribute, if applicable. |
|
hierarchical |
boolean Indication of hierarchy support. Default value: false. |
|
injective |
boolean Indication of injective mapping "id -> attribute". Default value: false. |
Layout
|
Field |
Description |
|
type |
enum (Type) Required field. Layout type. For details, see ClickHouse documentation
|
|
sizeInCells |
string (int64) Number of cells in the cache. Rounded up to a power of two. Default value: 1000000000. For details, see ClickHouse documentation The minimum value is 0. |
|
allowReadExpiredKeys |
boolean Allows to read expired keys. Default value: false. For details, see ClickHouse documentation |
|
maxUpdateQueueSize |
string (int64) Max size of update queue. Default value: 100000. For details, see ClickHouse documentation The minimum value is 0. |
|
updateQueuePushTimeoutMilliseconds |
string (int64) Max timeout in milliseconds for push update task into queue. Default value: 10. For details, see ClickHouse documentation The minimum value is 0. |
|
queryWaitTimeoutMilliseconds |
string (int64) Max wait timeout in milliseconds for update task to complete. Default value: 60000 (1 minute). For details, see ClickHouse documentation The minimum value is 0. |
|
maxThreadsForUpdates |
string (int64) Max threads for cache dictionary update. Default value: 4. For details, see ClickHouse documentation The minimum value is 0. |
|
initialArraySize |
string (int64) Initial dictionary key size. Default value: 1024. For details, see ClickHouse documentation The minimum value is 0. |
|
maxArraySize |
string (int64) Maximum dictionary key size. Default value: 500000. For details, see ClickHouse documentation The minimum value is 0. |
|
accessToKeyFromAttributes |
boolean Allows to retrieve key attribute using dictGetString function. For details, see ClickHouse documentation |
Range
|
Field |
Description |
|
min |
string (int64) Minimum dictionary lifetime. |
|
max |
string (int64) Maximum dictionary lifetime. |
HttpSource
|
Field |
Description |
|
url |
string Required field. URL of the source dictionary available over HTTP. |
|
format |
string Required field. The data format. Valid values are all formats supported by ClickHouse SQL dialect |
|
headers[] |
HTTP headers. |
Header
|
Field |
Description |
|
name |
string Required field. Header name. |
|
value |
string Required field. Header value. |
MysqlSource
|
Field |
Description |
|
db |
string Required field. Database name. |
|
table |
string Required field. Table name. |
|
port |
string (int64) Port to use when connecting to a replica of the dictionary source. Acceptable values are 0 to 65535, inclusive. |
|
user |
string Required field. Name of the user for replicas of the dictionary source. |
|
password |
string Password of the user for replicas of the dictionary source. |
|
replicas[] |
List of MySQL replicas of the database used as dictionary source. |
|
where |
string Selection criteria for the data in the specified MySQL table. |
|
invalidateQuery |
string Query for checking the dictionary status, to pull only updated data. |
|
closeConnection |
boolean Should a connection be closed after each request. |
|
shareConnection |
boolean Should a connection be shared for some requests. |
Replica
|
Field |
Description |
|
host |
string Required field. MySQL host of the replica. The maximum string length in characters is 253. |
|
priority |
string (int64) The priority of the replica that ClickHouse takes into account when connecting. The minimum value is 0. |
|
port |
string (int64) Port to use when connecting to the replica. Acceptable values are 0 to 65535, inclusive. |
|
user |
string Name of the MySQL database user. |
|
password |
string Password of the MySQL database user. |
ClickhouseSource
|
Field |
Description |
|
db |
string Required field. Database name. |
|
table |
string Required field. Table name. |
|
host |
string ClickHouse host. The maximum string length in characters is 253. |
|
port |
string (int64) Port to use when connecting to the host. Acceptable values are 0 to 65535, inclusive. |
|
user |
string Required field. Name of the ClickHouse database user. |
|
password |
string Password of the ClickHouse database user. |
|
where |
string Selection criteria for the data in the specified ClickHouse table. |
|
secure |
boolean Determines whether to use TLS for connection. |
MongodbSource
|
Field |
Description |
|
db |
string Required field. Database name. |
|
collection |
string Required field. Collection name. |
|
host |
string Required field. MongoDB host. The maximum string length in characters is 253. |
|
port |
string (int64) Port to use when connecting to the host. Acceptable values are 0 to 65535, inclusive. |
|
user |
string Required field. Name of the MongoDB database user. |
|
password |
string Password of the MongoDB database user. |
|
options |
string Dictionary source options. |
PostgresqlSource
|
Field |
Description |
|
db |
string Required field. Database name. |
|
table |
string Required field. Table name. |
|
hosts[] |
string PostgreSQL hosts. |
|
port |
string (int64) Port to use when connecting to the PostgreSQL hosts. Acceptable values are 0 to 65535, inclusive. |
|
user |
string Required field. Name of the PostrgreSQL database user. |
|
password |
string Password of the PostrgreSQL database user. |
|
invalidateQuery |
string Query for checking the dictionary status, to pull only updated data. |
|
sslMode |
enum (SslMode) Mode of SSL TCP/IP connection to the PostgreSQL host.
|
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": {
"clusterId": "string"
},
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": {
"id": "string",
"folderId": "string",
"createdAt": "string",
"name": "string",
"description": "string",
"labels": "object",
"environment": "string",
"monitoring": [
{
"name": "string",
"description": "string",
"link": "string"
}
],
"config": {
"version": "string",
"clickhouse": {
"config": {
"effectiveConfig": {
"backgroundPoolSize": "string",
"backgroundMergesMutationsConcurrencyRatio": "string",
"backgroundSchedulePoolSize": "string",
"backgroundFetchesPoolSize": "string",
"backgroundMovePoolSize": "string",
"backgroundDistributedSchedulePoolSize": "string",
"backgroundBufferFlushSchedulePoolSize": "string",
"backgroundMessageBrokerSchedulePoolSize": "string",
"backgroundCommonPoolSize": "string",
"dictionariesLazyLoad": "boolean",
"logLevel": "string",
"queryLogRetentionSize": "string",
"queryLogRetentionTime": "string",
"queryThreadLogEnabled": "boolean",
"queryThreadLogRetentionSize": "string",
"queryThreadLogRetentionTime": "string",
"partLogRetentionSize": "string",
"partLogRetentionTime": "string",
"metricLogEnabled": "boolean",
"metricLogRetentionSize": "string",
"metricLogRetentionTime": "string",
"traceLogEnabled": "boolean",
"traceLogRetentionSize": "string",
"traceLogRetentionTime": "string",
"textLogEnabled": "boolean",
"textLogRetentionSize": "string",
"textLogRetentionTime": "string",
"textLogLevel": "string",
"opentelemetrySpanLogEnabled": "boolean",
"opentelemetrySpanLogRetentionSize": "string",
"opentelemetrySpanLogRetentionTi