ClickPipe の設定を更新
この endpoint はベータです。 API コントラクトは安定しており、今後破壊的変更が加えられる予定はありません。
指定した ClickPipe の詳細設定を更新します。値には文字列、数値、またはブール値を指定したキー・バリューのペアを送信してください。
curl --request PUT \
--url https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": false,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": true,
"streaming_max_insert_wait_ms": 5000
}
'import requests
url = "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings"
payload = {
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": False,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": True,
"streaming_max_insert_wait_ms": 5000
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clickhouse_max_download_threads: 4,
clickhouse_max_insert_threads: 1,
clickhouse_max_threads: 8,
clickhouse_min_insert_block_size_bytes: 1073741824,
clickhouse_parallel_distributed_insert_select: 2,
clickhouse_parallel_view_processing: false,
object_storage_concurrency: 1,
object_storage_max_file_count: 100,
object_storage_max_insert_bytes: 10737418240,
object_storage_polling_interval_ms: 30000,
object_storage_use_cluster_function: true,
streaming_max_insert_wait_ms: 5000
})
};
fetch('https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'clickhouse_max_download_threads' => 4,
'clickhouse_max_insert_threads' => 1,
'clickhouse_max_threads' => 8,
'clickhouse_min_insert_block_size_bytes' => 1073741824,
'clickhouse_parallel_distributed_insert_select' => 2,
'clickhouse_parallel_view_processing' => false,
'object_storage_concurrency' => 1,
'object_storage_max_file_count' => 100,
'object_storage_max_insert_bytes' => 10737418240,
'object_storage_polling_interval_ms' => 30000,
'object_storage_use_cluster_function' => true,
'streaming_max_insert_wait_ms' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings"
payload := strings.NewReader("{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": {
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": false,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": true,
"streaming_max_insert_wait_ms": 5000
},
"status": 200
}{
"error": "<string>",
"status": 400
}承認
ClickHouse Cloud コンソールで取得した key ID と key secret を使用してください: https://clickhouse.com/docs/cloud/manage/openapi
パスパラメータ
サービスを所有する組織の ID。
ClickPipe を所有するサービスの ID。
設定を更新する対象の ClickPipe の ID。
ボディ
最大ダウンロードスレッド数。同時実行するダウンロードスレッドの最大数。
0 <= x <= 324
最大挿入スレッド数。同時実行する挿入スレッドの最大数。
0 <= x <= 161
最大スレッド数。ファイル処理を同時実行するスレッドの最大数。
0 <= x <= 648
最小挿入ブロックサイズ(バイト)。挿入時のデータブロックの最小サイズ(バイト単位)。
0 <= x <= 107374182401073741824
parallel distributed insert select。parallel distributed insert select の設定。
0 <= x <= 22
並列ビュー処理。attached ビューへのプッシュを順次ではなく同時実行で有効にするかどうか。
false
オブジェクトストレージの同時実行数。ファイル処理を同時実行するスレッド数。
1 <= x <= 351
最大ファイル数。1 回の挿入バッチで処理するファイルの最大数。
1 <= x <= 10000100
最大挿入バイト数。1 回の挿入バッチで処理するバイト数。
10485760 <= x <= 5368709120010737418240
オブジェクトストレージのポーリング間隔。新しいオブジェクトストレージデータを継続的に取り込むためのクエリの更新間隔を設定します。
100 <= x <= 360000030000
cluster 関数を使用。分散処理に ClickHouse の cluster 関数を使用するかどうか。
true
ストリーミングの最大挿入待機時間。データを ClickHouse に挿入する前の最大待機時間を設定します。
500 <= x <= 600005000
curl --request PUT \
--url https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": false,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": true,
"streaming_max_insert_wait_ms": 5000
}
'import requests
url = "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings"
payload = {
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": False,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": True,
"streaming_max_insert_wait_ms": 5000
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clickhouse_max_download_threads: 4,
clickhouse_max_insert_threads: 1,
clickhouse_max_threads: 8,
clickhouse_min_insert_block_size_bytes: 1073741824,
clickhouse_parallel_distributed_insert_select: 2,
clickhouse_parallel_view_processing: false,
object_storage_concurrency: 1,
object_storage_max_file_count: 100,
object_storage_max_insert_bytes: 10737418240,
object_storage_polling_interval_ms: 30000,
object_storage_use_cluster_function: true,
streaming_max_insert_wait_ms: 5000
})
};
fetch('https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'clickhouse_max_download_threads' => 4,
'clickhouse_max_insert_threads' => 1,
'clickhouse_max_threads' => 8,
'clickhouse_min_insert_block_size_bytes' => 1073741824,
'clickhouse_parallel_distributed_insert_select' => 2,
'clickhouse_parallel_view_processing' => false,
'object_storage_concurrency' => 1,
'object_storage_max_file_count' => 100,
'object_storage_max_insert_bytes' => 10737418240,
'object_storage_polling_interval_ms' => 30000,
'object_storage_use_cluster_function' => true,
'streaming_max_insert_wait_ms' => 5000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings"
payload := strings.NewReader("{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clickhouse.cloud/v1/organizations/{organizationId}/services/{serviceId}/clickpipes/{clickPipeId}/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clickhouse_max_download_threads\": 4,\n \"clickhouse_max_insert_threads\": 1,\n \"clickhouse_max_threads\": 8,\n \"clickhouse_min_insert_block_size_bytes\": 1073741824,\n \"clickhouse_parallel_distributed_insert_select\": 2,\n \"clickhouse_parallel_view_processing\": false,\n \"object_storage_concurrency\": 1,\n \"object_storage_max_file_count\": 100,\n \"object_storage_max_insert_bytes\": 10737418240,\n \"object_storage_polling_interval_ms\": 30000,\n \"object_storage_use_cluster_function\": true,\n \"streaming_max_insert_wait_ms\": 5000\n}"
response = http.request(request)
puts response.read_body{
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"result": {
"clickhouse_max_download_threads": 4,
"clickhouse_max_insert_threads": 1,
"clickhouse_max_threads": 8,
"clickhouse_min_insert_block_size_bytes": 1073741824,
"clickhouse_parallel_distributed_insert_select": 2,
"clickhouse_parallel_view_processing": false,
"object_storage_concurrency": 1,
"object_storage_max_file_count": 100,
"object_storage_max_insert_bytes": 10737418240,
"object_storage_polling_interval_ms": 30000,
"object_storage_use_cluster_function": true,
"streaming_max_insert_wait_ms": 5000
},
"status": 200
}{
"error": "<string>",
"status": 400
}