跳转到主要内容
POST
/
v1
/
organizations
/
{organizationId}
/
services
创建新服务
curl --request POST \
  --url https://api.clickhouse.cloud/v1/organizations/{organizationId}/services \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "backupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "byocId": "<string>",
  "dataWarehouseId": "<string>",
  "encryptionAssumedRoleIdentifier": "<string>",
  "encryptionKey": "<string>",
  "endpoints": [
    {
      "enabled": true,
      "protocol": "mysql"
    }
  ],
  "hasTransparentDataEncryption": true,
  "idleScaling": true,
  "idleTimeoutMinutes": 123,
  "ipAccessList": [
    {
      "description": "<string>",
      "source": "<string>"
    }
  ],
  "isReadonly": true,
  "maxReplicaMemoryGb": 120,
  "maxTotalMemoryGb": 360,
  "minReplicaMemoryGb": 16,
  "minTotalMemoryGb": 48,
  "name": "<string>",
  "numReplicas": 3,
  "privateEndpointIds": [
    "<string>"
  ],
  "privatePreviewTermsChecked": true
}
'
{
  "requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "result": {
    "password": "<string>",
    "service": {
      "availablePrivateEndpointIds": [
        "<string>"
      ],
      "byocId": "<string>",
      "clickhouseVersion": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "dataWarehouseId": "<string>",
      "encryptionAssumedRoleIdentifier": "<string>",
      "encryptionKey": "<string>",
      "encryptionRoleId": "<string>",
      "endpoints": [
        {
          "host": "<string>",
          "port": 123,
          "protocol": "mysql",
          "username": "<string>"
        }
      ],
      "hasTransparentDataEncryption": true,
      "iamRole": "<string>",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "idleScaling": true,
      "idleTimeoutMinutes": 123,
      "ipAccessList": [
        {
          "description": "<string>",
          "source": "<string>"
        }
      ],
      "isPrimary": true,
      "isReadonly": true,
      "maxReplicaMemoryGb": 120,
      "maxTotalMemoryGb": 360,
      "minReplicaMemoryGb": 16,
      "minTotalMemoryGb": 48,
      "name": "<string>",
      "numReplicas": 3,
      "privateEndpointIds": [
        "<string>"
      ],
      "transparentDataEncryptionKeyId": "<string>"
    }
  },
  "status": 200
}

授权

Authorization
string
header
必填

使用在 ClickHouse Cloud 控制台中获取的 key ID 和 key secret:https://clickhouse.com/docs/cloud/manage/openapi

路径参数

organizationId
string<uuid>
必填

将拥有该服务的组织 ID。

请求体

application/json
backupId
string<uuid>

可选的备份 ID,用作新服务的初始状态。使用时,新实例的区域和层级必须与原始实例相同。

byocId
string

这是为自备 Cloud (BYOC) 设置区域后返回的 ID。指定 byocId 参数时,还必须同时提供 minReplicaMemoryGb 和 maxReplicaGb 参数,且其值必须是以下规格之一:48、116、172、232。

complianceType
enum<string>

服务的监管合规类型。

可用选项:
hipaa,
pci
dataWarehouseId
string

包含此服务的数据仓库

encryptionAssumedRoleIdentifier
string

用于磁盘加密的可选角色

encryptionKey
string

可选的客户提供磁盘加密密钥

endpoints
object[]

要启用或禁用的服务端点列表

hasTransparentDataEncryption
boolean

如果服务应启用透明数据加密(TDE),则为 true。TDE 仅适用于 ENTERPRISE 组织层级,且只能在创建服务时启用。

idleScaling
boolean

设置为 true 时,服务在空闲时可缩容到零。默认为 true。

idleTimeoutMinutes
number

设置最小空闲超时时间(分钟)。必须 >= 5 分钟。

ipAccessList
object[]

允许访问该服务的 IP 地址列表

isReadonly
boolean

如果此服务为只读,则为 true。仅在提供 dataWarehouseId 时才可设为只读。

maxReplicaMemoryGb
number

自动扩缩容期间每个副本的最大总内存(单位:Gb)。必须是 4 的倍数;对于非付费服务,小于或等于 120;对于付费服务,小于或等于 356。* - 副本最大规格取决于所选区域中云提供商硬件的可用性。

必填范围: 8 <= x <= 356必须是以下数值的倍数 4
示例:

120

maxTotalMemoryGb
number
已弃用

已弃用 - 对于副本数量非默认的服务,此值不准确。自动扩缩容期间三个工作线程的最大内存(单位:Gb)。仅适用于 'production' 服务。对于非付费服务,必须是 12 的倍数且小于或等于 360;对于付费服务,小于或等于 1068。

必填范围: 24 <= x <= 1068必须是以下数值的倍数 12
示例:

360

minReplicaMemoryGb
number

自动扩缩容期间每个副本的最小总内存(单位:Gb)。必须是 4 的倍数,且大于或等于 8。

必填范围: 8 <= x <= 356必须是以下数值的倍数 4
示例:

16

minTotalMemoryGb
number
已弃用

已弃用 - 对于副本数量非默认的服务,此值不准确。自动扩缩容期间三个工作线程的最小内存(单位:Gb)。仅适用于 'production' 服务。必须是 12 的倍数,且大于或等于 24。

必填范围: 24 <= x <= 1068必须是以下数值的倍数 12
示例:

48

name
string

服务名称。最多 50 个字符,可包含字母、数字和空格。

numReplicas
number

服务的副本数。对于仓库中的第一个服务,副本数必须在 2 到 20 之间。在现有仓库中创建的服务,副本数最低可为 1。根据组织的层级,可能还会有其他限制。默认情况下,BASIC 层级为 1,SCALE 和 ENTERPRISE 层级为 3。

必填范围: 1 <= x <= 20
示例:

3

privateEndpointIds
string[]
已弃用

要将服务与专用终结点关联,请先创建服务,然后使用 Update Service Basic Details 端点修改专用终结点。

privatePreviewTermsChecked
boolean

接受私有预览的条款和条件。仅在私有预览情况下创建组织中的第一个服务时才需要这样做

profile
enum<string>

自定义实例 profile。仅适用于 ENTERPRISE 组织层级。

可用选项:
v1-default,
v1-highmem-xs,
v1-highmem-s,
v1-highmem-m,
v1-highmem-l,
v1-highmem-xl,
v1-highcpu-s,
v1-highcpu-m,
v1-highcpu-l,
v1-highcpu-xl
provider
enum<string>

云提供商

可用选项:
aws,
gcp,
azure
region
enum<string>

服务区域。

可用选项:
ap-northeast-1,
ap-south-1,
ap-southeast-1,
ap-southeast-2,
eu-central-1,
eu-west-1,
eu-west-2,
me-central-1,
us-east-1,
us-east-2,
us-west-2,
us-east1,
us-central1,
europe-west4,
asia-southeast1,
eastus,
eastus2,
westus3,
germanywestcentral
releaseChannel
enum<string>

如果希望在新的 ClickHouse 发行版一发布就立即获取,请选择 fast。这样可以更快使用新功能,但出现缺陷的风险也更高。如果希望延后接收发行版,以便有更多时间进行测试,请选择 slow。此功能仅适用于 production 服务。默认为常规发布渠道。

可用选项:
slow,
default,
fast
tier
enum<string>
已弃用

对于 BASIC、SCALE 和 ENTERPRISE 组织层级,此字段已弃用。服务层级:'development'、'production'、'dedicated_high_mem'、'dedicated_high_cpu'、'dedicated_standard'、'dedicated_standard_n2d_standard_4'、'dedicated_standard_n2d_standard_8'、'dedicated_standard_n2d_standard_32'、'dedicated_standard_n2d_standard_128'、'dedicated_standard_n2d_standard_32_16SSD'、'dedicated_standard_n2d_standard_64_24SSD'。Production 服务支持扩缩容,Development 服务为固定大小。Azure 服务不支持 Development 层级

可用选项:
development,
production,
dedicated_high_mem,
dedicated_high_cpu,
dedicated_standard,
dedicated_standard_n2d_standard_4,
dedicated_standard_n2d_standard_8,
dedicated_standard_n2d_standard_32,
dedicated_standard_n2d_standard_128,
dedicated_standard_n2d_standard_32_16SSD,
dedicated_standard_n2d_standard_64_24SSD

响应

成功响应

requestId
string<uuid>

分配给每个请求的唯一 ID。UUIDv4

result
object
status
number

HTTP 状态码。

示例:

200

最后修改于 2026年6月10日