diff --git a/crates/clickhouse-cloud-api/CHANGELOG.md b/crates/clickhouse-cloud-api/CHANGELOG.md index 7c0bc6d5..fa249dc6 100644 --- a/crates/clickhouse-cloud-api/CHANGELOG.md +++ b/crates/clickhouse-cloud-api/CHANGELOG.md @@ -161,6 +161,33 @@ The beta `organization_public_previews_get_list` method lists the organization's Every `Client` method sends each path parameter (organization, service, key, pipe or provider ID, UDF or setting name) as one percent-encoded URL segment, so `/`, `?`, `#` or `%` in an ID can no longer change the request path; the API answers 400 or 404 for a malformed ID instead. The same applies to the service ID in the Query API URLs. A parameter that is empty, `.` or `..` cannot be one segment, because URL parsing drops or resolves it, so the method returns `Error::InvalidPathParameter` without sending a request. Each method takes its HTTP method and path template from its generated `meta::operations` descriptor. +`Service`, `ServiceScalingPatchResponse`, `ServicePostRequest` and +`ServicePatchRequest` gain optional `deletion_protection` (`deletionProtection`, +a `bool`). While it is `true`, `instance_delete` fails with +`Error::Api { status: 409, .. }` until it is turned off. Setting it on create +requires `control-plane:service:delete` for all services in the organization; +changing it on update requires `control-plane:service:delete` on the service. +`ServicePostRequest::new` leaves it `None`. Struct-literal callers need +`deletion_protection: None` or `..Default::default()` (PATCH body only). +`ActivityType` adds `Service_update_deletion_protection`. The spec now types +`Activity.type` as an open string and lists the known values in its +description; `ActivityType` keeps those values as variants, and any other value +still lands in `ActivityType::Unknown`. + +The twelve UDF operations in `meta::operations` (`UDF_CREATE`, `UDF_GET`, +`UDF_ATTACH` and the rest) now require the dedicated +`control-plane:organization:manage-udfs` and +`control-plane:organization:view-udfs` permissions instead of +`control-plane:organization:manage` and `control-plane:organization:view`. + +The spec now types `settings` in `ClickPipePostRequest` and +`ClickPipePatchRequest` as `ClickPipeSettingsPutRequest`, the schema the +settings PUT already took, so both fields are now +`Option`. The two structs had the same fields, so +the request body is unchanged, and `ClickPipeSettings` remains as a type alias +of `ClickPipeSettingsPutRequest`: existing code compiles unchanged. Responses +still use `ClickPipeSettingsResponse`. + ## 0.5.1 No changes to this crate; released in lockstep with `clickhousectl` 0.5.1. diff --git a/crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json b/crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json index 2dbb75be..3f2e33bf 100644 --- a/crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json +++ b/crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json @@ -5,7 +5,7 @@ "version": "1.0", "contact": { "name": "ClickHouse Support", - "url": "https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-1415590", + "url": "https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-1418320", "email": "support@clickhouse.com" } }, @@ -2386,7 +2386,7 @@ }, "delete": { "summary": "Delete service", - "description": "Deletes the service. The service must be in stopped state and is deleted asynchronously after this method call.", + "description": "Deletes the service. The service must be in stopped state and is deleted asynchronously after this method call. Returns 409 if deletion protection is enabled for the service.", "operationId": "instanceDelete", "parameters": [ { @@ -3223,7 +3223,7 @@ "/v1/organizations/{organizationId}/services/{serviceId}/replicaScaling": { "patch": { "summary": "Update service auto scaling settings", - "description": "Updates minimum and maximum memory limits per replica and idle mode scaling behavior for the service. Supports both vertical autoscaling (fixed replica count, variable memory) and horizontal autoscaling (variable replica count, fixed memory). The memory settings are available only for \"production\" services and must be a multiple of 4 starting from 8GB. For horizontal autoscaling (autoscalingMode \"horizontal\" with minReplicas/maxReplicas), contact support to enable the feature for your organization. An optional profile changes the custom instance profile in place. Omit it to keep the current profile. Gen 2 (v2-default) services use a fixed size and cannot idle: minReplicaMemoryGb must equal maxReplicaMemoryGb, the replica count is fixed (numReplicas, or equal minReplicas and maxReplicas in either mode), and idleScaling cannot be true.", + "description": "Updates minimum and maximum memory limits per replica and idle mode scaling behavior for the service. Supports both vertical autoscaling (fixed replica count, variable memory) and horizontal autoscaling (variable replica count, fixed memory). The memory settings are available only for \"production\" services and must be a multiple of 4 starting from 8GB. For horizontal autoscaling (autoscalingMode \"horizontal\" with minReplicas/maxReplicas), contact support to enable the feature for your organization. An optional profile changes the custom instance profile in place. Omit it to keep the current profile. On a BYOC service, equal memory values without a profile must be one of the following sizes: 48, 116, 172, 232; send a BYOC profile to pin a size from the infrastructure's catalogue. When BYOC vertical autoscaling is enabled for the organization (contact support), a minReplicaMemoryGb lower than maxReplicaMemoryGb scales the service vertically between sizes listed by the serviceProfiles endpoint; this unpins any BYOC profile, and the service then reports 'v1-default'. Gen 2 (v2-default) services use a fixed size and cannot idle: minReplicaMemoryGb must equal maxReplicaMemoryGb, the replica count is fixed (numReplicas, or equal minReplicas and maxReplicas in either mode), and idleScaling cannot be true.", "operationId": "instanceReplicaScalingUpdate", "parameters": [ { @@ -4553,7 +4553,7 @@ }, "post": { "summary": "Create service JWT provider", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Adds a JWT authentication provider to the service. Users can then connect to the service with a JWT issued by the provider; they are signed in as the `default` user and receive the roles listed in the roles claim. The JWKS URL is fetched and validated before the provider is saved. If the service already has a provider with this name and the same configuration, the request succeeds without changing it, so it is safe to retry.\n\nErrors:\n- 400: invalid field values, the JWKS URL is unreachable or does not return a valid RS256 key set, or the service already has 5 providers.\n- 401: missing, invalid, or disabled API key.\n- 403: caller lacks `control-plane:service:manage` on the service, or the organization does not have the JWT authentication providers feature (Enterprise tier).\n- 404: service does not exist or is not visible to the caller.\n- 409: the service already has a provider with this name and a different configuration.", + "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Adds a JWT authentication provider to the service. Users can then connect to the service with a JWT issued by the provider; they are signed in as the `default` user and receive the roles listed in the roles claim. The JWKS URL is fetched and validated before the provider is saved. If the service already has a provider with this name and the same configuration, the request succeeds without changing it, so it is safe to retry.\n\nErrors:\n- 400: invalid field values, the JWKS URL is unreachable or does not return a key set with a supported signing key, or the service already has 5 providers.\n- 401: missing, invalid, or disabled API key.\n- 403: caller lacks `control-plane:service:manage` on the service, or the organization does not have the JWT authentication providers feature (Enterprise tier).\n- 404: service does not exist or is not visible to the caller.\n- 409: the service already has a provider with this name and a different configuration.", "operationId": "jwtProviderCreate", "parameters": [ { @@ -4817,7 +4817,7 @@ }, "put": { "summary": "Update service JWT provider", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Replaces the configuration of a JWT authentication provider. The JWKS URL is fetched and validated before the change is saved.\n\nErrors:\n- 400: invalid provider name or field values, or the JWKS URL is unreachable or does not return a valid RS256 key set.\n- 401: missing, invalid, or disabled API key.\n- 403: caller lacks `control-plane:service:manage` on the service, or the organization does not have the JWT authentication providers feature (Enterprise tier).\n- 404: service does not exist, is not visible to the caller, or has no provider with this name.", + "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Replaces the configuration of a JWT authentication provider. The JWKS URL is fetched and validated before the change is saved.\n\nErrors:\n- 400: invalid provider name or field values, or the JWKS URL is unreachable or does not return a key set with a supported signing key.\n- 401: missing, invalid, or disabled API key.\n- 403: caller lacks `control-plane:service:manage` on the service, or the organization does not have the JWT authentication providers feature (Enterprise tier).\n- 404: service does not exist, is not visible to the caller, or has no provider with this name.", "operationId": "jwtProviderUpdate", "parameters": [ { @@ -11249,7 +11249,7 @@ }, "put": { "summary": "Update ClickPipe settings", - "description": "Update the advanced settings for the specified ClickPipe. Send key-value pairs where values can be strings, numbers, or booleans.", + "description": "Update the advanced settings for the specified ClickPipe. Send key-value pairs where values can be strings, numbers, or booleans. Omitted keys keep their current value. `null` is not accepted; to reset a setting, send its default value.", "operationId": "clickPipeSettingsUpdate", "parameters": [ { @@ -12828,7 +12828,7 @@ "/v1/organizations/{organizationId}/services/{serviceId}/clickstack/alerts": { "get": { "summary": "ClickStack: List Alerts", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

ClickStack: Retrieves alerts for the authenticated team (paginated). Results are capped at `limit` (default and maximum 1000). When `totalCount` exceeds the number of returned items, page with `limit`/`offset` to retrieve them all.", + "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

ClickStack: Retrieves alerts for the authenticated team (paginated). Results are capped at `limit` (default and maximum 1000). When `totalCount` exceeds the number of returned items, page with `limit`/`offset` to retrieve them all. Optional filters narrow the result set, and `totalCount` counts only the matching alerts.", "operationId": "clickStackListAlerts", "parameters": [ { @@ -12871,6 +12871,62 @@ "minimum": 0, "default": 0 } + }, + { + "in": "query", + "name": "tag", + "description": "Only return alerts that have any of the given tags. Repeat the parameter to pass several tags. Matches the tags stored on the alert, not tags inherited from the linked dashboard or saved search.", + "schema": { + "type": "array", + "items": { + "type": "string", + "maxLength": 32 + }, + "maxItems": 50 + } + }, + { + "in": "query", + "name": "search", + "description": "Only return alerts whose display name contains this text (case-insensitive). Matches the display name stored on the alert, not a name derived from the linked dashboard or saved search.", + "schema": { + "type": "string", + "maxLength": 512 + } + }, + { + "in": "query", + "name": "source", + "description": "Only return alerts of any of the given sources. Repeat the parameter to pass several sources.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "saved_search", + "tile", + "inline" + ] + } + } + }, + { + "in": "query", + "name": "state", + "description": "Only return alerts in any of the given states. Repeat the parameter to pass several states.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "ALERT", + "OK", + "INSUFFICIENT_DATA", + "DISABLED", + "PENDING" + ] + } + } } ], "responses": { @@ -16309,7 +16365,7 @@ }, "get": { "summary": "List of organization Postgres services", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns a list of all Postgres services in the organization.", + "description": "Returns a list of all Postgres services in the organization.", "operationId": "postgresServiceGetList", "parameters": [ { @@ -16414,19 +16470,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/prometheus": { "get": { "summary": "Get organization PostgreSQL metrics", - "description": "**Disclaimer:** This beta endpoint is evolving; the API contract may change.

Returns Prometheus metrics for all PostgreSQL services in an organization. Maximum 100 services supported.", + "description": "Returns Prometheus metrics for all PostgreSQL services in an organization. Maximum 100 services supported.", "operationId": "postgresOrgPrometheusGet", "parameters": [ { @@ -16513,19 +16563,13 @@ ], "tags": [ "Prometheus" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}": { "get": { "summary": "Get PostgreSQL service details", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns a Postgres service that belongs to the organization", + "description": "Returns a Postgres service that belongs to the organization", "operationId": "postgresServiceGet", "parameters": [ { @@ -16637,17 +16681,11 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] }, "delete": { "summary": "Delete a PostgreSQL service", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Deletes a Postgres service that belongs to the organization. Returns 409 if deletion protection is enabled for the service.", + "description": "Deletes a Postgres service that belongs to the organization. Returns 409 if deletion protection is enabled for the service.", "operationId": "postgresServiceDelete", "parameters": [ { @@ -16756,17 +16794,11 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] }, "patch": { "summary": "Update a PostgreSQL service", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Update a Postgres service that belongs to the organization. **WARNING:** Changing the name also updates the host name and certificates for the service.", + "description": "Update a Postgres service that belongs to the organization. **WARNING:** Changing the name also updates the host name and certificates for the service.", "operationId": "postgresServicePatch", "parameters": [ { @@ -16887,19 +16919,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/caCertificates": { "get": { "summary": "Get Postgres CA certs", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Download CA certificates for a PostgreSQL service", + "description": "Download CA certificates for a PostgreSQL service", "operationId": "postgresServiceCertsGet", "parameters": [ { @@ -17004,19 +17030,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/restoredService": { "post": { "summary": "Restore a Postgres service", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Restore a Postgres database from continuous backup, optionally at a specific point in time.", + "description": "Restore a Postgres database from continuous backup, optionally at a specific point in time.", "operationId": "postgresInstanceRestore", "parameters": [ { @@ -17138,19 +17158,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/password": { "patch": { "summary": "Update Postgres superuser password", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Sets a new password for a Postgres service's superuser account.", + "description": "Sets a new password for a Postgres service's superuser account.", "operationId": "postgresServiceSetPassword", "parameters": [ { @@ -17271,19 +17285,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/state": { "patch": { "summary": "Update Postgres service state", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Initiate a process for a Postgres service:\n* restart: Initiates a service restart\n* promote: Promotes a read replica to primary\n* switchover: Switch a primary over to a standby. If there is no standby, replace the primary with a newly provisioned server and switch over to it.\n", + "description": "Initiate a process for a Postgres service:\n* restart: Initiates a service restart\n* promote: Promotes a read replica to primary\n* switchover: Switch a primary over to a standby. If there is no standby, replace the primary with a newly provisioned server and switch over to it.\n", "operationId": "postgresServicePatchState", "parameters": [ { @@ -17404,19 +17412,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/readReplica": { "post": { "summary": "Create a read replica for a Postgres service", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Initiate the process to create a new read replica for a Postgres service.", + "description": "Initiate the process to create a new read replica for a Postgres service.", "operationId": "postgresInstanceCreateReadReplica", "parameters": [ { @@ -17538,19 +17540,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/config": { "get": { "summary": "Get PostgreSQL service configuration", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns the configuration data for a Postgres service and its PgBouncer service.", + "description": "Returns the configuration data for a Postgres service and its PgBouncer service.", "operationId": "postgresInstanceConfigGet", "parameters": [ { @@ -17662,17 +17658,11 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] }, "post": { "summary": "Replace Postgres service configuration", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Replace the existing Postgres service and pgBouncer configuration.", + "description": "Replace the existing Postgres service and pgBouncer configuration.", "operationId": "postgresInstanceConfigPost", "parameters": [ { @@ -17793,17 +17783,11 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] }, "patch": { "summary": "Update Postgres service configuration", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Update the existing Postgres service and pgBouncer configuration.", + "description": "Update the existing Postgres service and pgBouncer configuration.", "operationId": "postgresInstanceConfigPatch", "parameters": [ { @@ -17924,19 +17908,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/prometheus": { "get": { "summary": "Get PostgreSQL service metrics", - "description": "**Disclaimer:** This beta endpoint is evolving; the API contract may change.

Returns Prometheus metrics for a PostgreSQL service.", + "description": "Returns Prometheus metrics for a PostgreSQL service.", "operationId": "postgresInstancePrometheusGet", "parameters": [ { @@ -18033,19 +18011,13 @@ ], "tags": [ "Prometheus" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/metrics": { "get": { "summary": "Get Postgres time-series metrics", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns bucketed time-series metrics for a PostgreSQL service over the requested window (CPU, memory, disk, network, connections, cache hit ratio, throughput, transactions, wait events, lock waits, and more). Use this to chart or analyze how a service behaved over time.", + "description": "Returns bucketed time-series metrics for a PostgreSQL service over the requested window (CPU, memory, disk, network, connections, cache hit ratio, throughput, transactions, wait events, lock waits, and more). Use this to chart or analyze how a service behaved over time.", "operationId": "postgresInstanceMetricsGet", "parameters": [ { @@ -18186,19 +18158,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/backups": { "get": { "summary": "List of Postgres service backups", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns a list of the base backups retained for a Postgres service, ordered by last modified date, newest first. Results are capped at `limit` (default and maximum 100) per page. Every response carries `limit`, `totalCount` and `nextCursor`; pass `nextCursor` as the `cursor` query parameter to fetch the next page, repeating until it is null. A Postgres service is recovered to a point in time rather than to a single backup, so restore it with the restore endpoint and a timestamp between the service's `earliestRestoreTime` and now, rather than with a backup key from this list.", + "description": "Returns a list of the base backups retained for a Postgres service, ordered by last modified date, newest first. Results are capped at `limit` (default and maximum 100) per page. Every response carries `limit`, `totalCount` and `nextCursor`; pass `nextCursor` as the `cursor` query parameter to fetch the next page, repeating until it is null. A Postgres service is recovered to a point in time rather than to a single backup, so restore it with the restore endpoint and a timestamp between the service's `earliestRestoreTime` and now, rather than with a backup key from this list.", "operationId": "postgresServiceBackupGetList", "parameters": [ { @@ -18350,19 +18316,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns": { "get": { "summary": "List Postgres slow query patterns", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns aggregate metrics for the slowest query patterns observed on a Postgres service during the given time window. Use this to discover which queries dominate total execution time, CPU, I/O, or WAL generation.", + "description": "Returns aggregate metrics for the slowest query patterns observed on a Postgres service during the given time window. Use this to discover which queries dominate total execution time, CPU, I/O, or WAL generation.", "operationId": "slowQueryPatternsGetList", "parameters": [ { @@ -18587,19 +18547,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns/{queryId}": { "get": { "summary": "Get a Postgres slow query pattern with recent executions", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns aggregate metrics for a single slow query pattern together with its most recent individual executions.", + "description": "Returns aggregate metrics for a single slow query pattern together with its most recent individual executions.", "operationId": "slowQueryPatternGet", "parameters": [ { @@ -18764,19 +18718,13 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, "/v1/organizations/{organizationId}/postgres/{postgresId}/logs": { "get": { "summary": "List Postgres server logs", - "description": "**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future.

Returns PostgreSQL server log entries for a Postgres service within the given time window, most recent first by default (override with `sort_order`). Results are paginated with `limit`/`offset`; advance `offset` until a page returns fewer than `limit` entries to read the full window. The time range must not exceed 30 days, and `to_date` must be after `from_date`.", + "description": "Returns PostgreSQL server log entries for a Postgres service within the given time window, most recent first by default (override with `sort_order`). Results are paginated with `limit`/`offset`; advance `offset` until a page returns fewer than `limit` entries to read the full window. The time range must not exceed 30 days, and `to_date` must be after `from_date`.", "operationId": "postgresLogsGetList", "parameters": [ { @@ -18971,12 +18919,6 @@ ], "tags": [ "Postgres" - ], - "x-badges": [ - { - "name": "Beta", - "position": "after" - } ] } }, @@ -23689,7 +23631,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -23857,7 +23799,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:view" + "control-plane:organization:view-udfs" ] } ], @@ -24077,7 +24019,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -24353,7 +24295,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -24592,7 +24534,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:view" + "control-plane:organization:view-udfs" ] } ], @@ -24804,7 +24746,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:view" + "control-plane:organization:view-udfs" ] } ], @@ -25070,7 +25012,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -25321,7 +25263,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:view" + "control-plane:organization:view-udfs" ] } ], @@ -25543,7 +25485,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -25882,7 +25824,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:view" + "control-plane:organization:view-udfs" ] } ], @@ -26146,7 +26088,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -26466,7 +26408,7 @@ "security": [ { "basicAuth": [ - "control-plane:organization:manage" + "control-plane:organization:manage-udfs" ] } ], @@ -27305,7 +27247,7 @@ ] }, "byocId": { - "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and the maxReplicaGb parameters are required too, with values included among the following sizes: 48, 116, 172, 232.", + "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and maxReplicaMemoryGb parameters are required too. With a BYOC profile, both must equal that profile's memory size. Without a profile, equal values must be one of the following sizes: 48, 116, 172, 232. When BYOC vertical autoscaling is enabled for the organization (contact support), a minReplicaMemoryGb lower than maxReplicaMemoryGb, without a profile, creates a service that scales vertically between the two. Both values must be memory sizes listed by the serviceProfiles endpoint, and the service reports the profile 'v1-default'.", "type": "string" }, "hasTransparentDataEncryption": { @@ -27313,7 +27255,7 @@ "type": "boolean" }, "profile": { - "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. Use the serviceProfiles endpoint to list the profiles available to the organization.", + "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. A BYOC service that scales vertically within a memory range has no BYOC profile and reports 'v1-default'. Use the serviceProfiles endpoint to list the profiles available to the organization.", "type": "string" }, "transparentDataEncryptionKeyId": { @@ -27344,6 +27286,10 @@ "description": "True if the service's underline infra is enabled for collecting core dumps. This is an experimental feature", "type": "boolean" }, + "deletionProtection": { + "description": "When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off.", + "type": "boolean" + }, "scalingSchedule": { "$ref": "#/components/schemas/ScalingSchedule" }, @@ -29003,7 +28949,7 @@ "example": "my-clickpipe-consumer-group" }, "authentication": { - "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", + "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, SCRAM-SHA-512, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", "type": "string", "enum": [ "PLAIN", @@ -29122,7 +29068,7 @@ "example": "my-clickpipe-consumer-group" }, "authentication": { - "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", + "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, SCRAM-SHA-512, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", "type": "string", "enum": [ "PLAIN", @@ -29232,7 +29178,7 @@ "ClickPipePatchKafkaSource": { "properties": { "authentication": { - "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", + "description": "Authentication method of the Kafka source. SERVICE_ACCOUNT_WORKLOAD_IDENTITY is in Private Preview. ClickPipes uses the GCP service account returned in gcpWorkloadIdentity.principal by the operation with operationId clickPipesServiceContextGet; grant it access to the source resources. Supported authentication methods: kafka: PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, msk: SCRAM-SHA-512, IAM_ROLE, IAM_USER, MUTUAL_TLS, gcmk: PLAIN, MUTUAL_TLS, SERVICE_ACCOUNT_WORKLOAD_IDENTITY, confluent: PLAIN, SCRAM-SHA-512, MUTUAL_TLS, warpstream: PLAIN, azureeventhub: PLAIN, redpanda: SCRAM-SHA-256, SCRAM-SHA-512, MUTUAL_TLS, dokafka: SCRAM-SHA-256, MUTUAL_TLS", "type": [ "string", "null" @@ -32501,37 +32447,6 @@ "database" ] }, - "ClickPipePatchDestination": { - "properties": { - "columns": { - "type": "array", - "description": "Columns of the destination table. This will not update the table schema, only the ClickPipe configuration.", - "items": { - "$ref": "#/components/schemas/ClickPipeDestinationColumn" - } - } - } - }, - "ClickPipesCdcScaling": { - "properties": { - "replicaCpuMillicores": { - "description": "CPU in millicores for DB ClickPipes.", - "type": "integer", - "minimum": 1000, - "maximum": 32000, - "multipleOf": 1000, - "example": 2000 - }, - "replicaMemoryGb": { - "description": "Memory in GiB for DB ClickPipes. Must be 4\u00d7 the CPU core count.", - "type": "number", - "minimum": 4, - "maximum": 128, - "multipleOf": 4, - "example": 8 - } - } - }, "ClickPipeSettingsPutRequest": { "properties": { "streaming_max_insert_wait_ms": { @@ -32628,6 +32543,37 @@ } } }, + "ClickPipePatchDestination": { + "properties": { + "columns": { + "type": "array", + "description": "Columns of the destination table. This will not update the table schema, only the ClickPipe configuration.", + "items": { + "$ref": "#/components/schemas/ClickPipeDestinationColumn" + } + } + } + }, + "ClickPipesCdcScaling": { + "properties": { + "replicaCpuMillicores": { + "description": "CPU in millicores for DB ClickPipes.", + "type": "integer", + "minimum": 1000, + "maximum": 32000, + "multipleOf": 1000, + "example": 2000 + }, + "replicaMemoryGb": { + "description": "Memory in GiB for DB ClickPipes. Must be 4\u00d7 the CPU core count.", + "type": "number", + "minimum": 4, + "maximum": 128, + "multipleOf": 4, + "example": 8 + } + } + }, "ClickPipeSchemaDiscoverySource": { "properties": { "kafka": { @@ -32719,140 +32665,9 @@ "format": "date-time" }, "type": { - "description": "Type of the activity.", - "type": "string", - "enum": [ - "create_organization", - "delete_organization", - "organization_update_name", - "transfer_service_in", - "transfer_service_out", - "save_payment_method", - "marketplace_subscription", - "migrate_marketplace_billing_details_in", - "migrate_marketplace_billing_details_out", - "organization_update_tier", - "organization_invite_create", - "organization_invite_delete", - "organization_member_join", - "organization_member_add", - "organization_member_leave", - "organization_member_delete", - "organization_member_update_role", - "organization_member_update_roles", - "organization_member_update_mfa_method", - "organization_saml_connection_create", - "organization_saml_connection_update", - "user_login", - "user_login_failed", - "user_logout", - "key_create", - "key_delete", - "openapi_key_update", - "service_create", - "service_start", - "service_stop", - "service_awaken", - "service_idle", - "service_running", - "service_partially_running", - "service_delete", - "service_update_name", - "service_update_ip_access_list", - "service_update_autoscaling_memory", - "service_update_autoscaling_idling", - "service_update_password", - "service_update_autoscaling_replicas", - "service_update_max_allowable_replicas", - "service_update_backup_configuration", - "service_restore_backup", - "service_update_release_channel", - "service_update_gpt_usage_consent", - "service_update_private_endpoints", - "service_import_to_organization", - "service_export_from_organization", - "service_maintenance_start", - "service_maintenance_end", - "service_update_core_dump", - "service_update_autoscaling_schedule", - "service_update_query_endpoints", - "service_update_direct_connection", - "service_update_sql_console_jwt_auth", - "service_update_snapshot_configuration", - "service_update_collector_ip_access_list", - "service_update_mysql_interface", - "service_update_upgrade_window", - "service_delete_upgrade_window", - "service_trigger_failover", - "service_trigger_recovery", - "service_mcp_enabled", - "service_mcp_disabled", - "service_upgrade", - "service_scaled_down_for_tier_change", - "service_encryption_key_check_failed", - "service_encryption_key_rotation_failed", - "service_encryption_key_rotated", - "service_stop_encryption_key_inaccessible", - "service_restart_encryption_key_rotation", - "backup_delete", - "backup_bucket_create", - "backup_bucket_update", - "backup_bucket_delete", - "backup_bucket_archive", - "warehouse_update_name", - "warehouse_update_release_channel", - "role_create", - "role_update", - "role_delete", - "role_resources_delete", - "organization_member_remove_roles", - "scim_user_profile_update", - "scim_group_create", - "scim_group_update", - "scim_group_delete", - "organization_saml_connection_delete", - "organization_update_saml_query_ownership_migration", - "organization_approved_domain_verify", - "organization_approved_domain_update", - "organization_approved_domain_delete", - "organization_approved_domain_auto_join", - "organization_approved_domain_auto_invite", - "datadog_integration_create", - "datadog_integration_delete", - "organization_update_spend_alert", - "organization_update_core_dumps", - "organization_update_private_endpoints", - "organization_update_pci_compliance", - "organization_update_hipaa_status", - "organization_security_contact_add", - "organization_security_contact_remove", - "organization_security_contact_replace", - "organization_update_public_preview", - "byoc_infrastructure_update_customer_authorized_access", - "transfer_credits_in", - "transfer_credits_out", - "promo_code_claim", - "schema_advisor_seed", - "schema_advisor_generate_plan", - "schema_advisor_approve_plan", - "schema_advisor_start_deployment", - "schema_advisor_start_benchmark", - "schema_advisor_run_benchmark", - "schema_advisor_start_promotion", - "schema_advisor_exchange_tables", - "schema_advisor_drop_sandbox", - "udf_create", - "udf_update", - "udf_delete", - "udf_version_create", - "udf_version_delete", - "udf_attach", - "udf_detach", - "udf_update_services", - "udf_redeploy", - "udf_rebuild", - "postgres_action" - ] + "description": "Type of the activity. One of 'create_organization', 'delete_organization', 'organization_update_name', 'transfer_service_in', 'transfer_service_out', 'save_payment_method', 'marketplace_subscription', 'migrate_marketplace_billing_details_in', 'migrate_marketplace_billing_details_out', 'organization_update_tier', 'organization_invite_create', 'organization_invite_delete', 'organization_member_join', 'organization_member_add', 'organization_member_leave', 'organization_member_delete', 'organization_member_update_role', 'organization_member_update_roles', 'organization_member_update_mfa_method', 'organization_saml_connection_create', 'organization_saml_connection_update', 'user_login', 'user_login_failed', 'user_logout', 'key_create', 'key_delete', 'openapi_key_update', 'service_create', 'service_start', 'service_stop', 'service_awaken', 'service_idle', 'service_running', 'service_partially_running', 'service_delete', 'service_update_name', 'service_update_ip_access_list', 'service_update_autoscaling_memory', 'service_update_autoscaling_idling', 'service_update_password', 'service_update_autoscaling_replicas', 'service_update_max_allowable_replicas', 'service_update_backup_configuration', 'service_restore_backup', 'service_update_release_channel', 'service_update_gpt_usage_consent', 'service_update_private_endpoints', 'service_import_to_organization', 'service_export_from_organization', 'service_maintenance_start', 'service_maintenance_end', 'service_update_core_dump', 'service_update_deletion_protection', 'service_update_autoscaling_schedule', 'service_update_query_endpoints', 'service_update_direct_connection', 'service_update_sql_console_jwt_auth', 'service_update_snapshot_configuration', 'service_update_collector_ip_access_list', 'service_update_mysql_interface', 'service_update_upgrade_window', 'service_delete_upgrade_window', 'service_trigger_failover', 'service_trigger_recovery', 'service_mcp_enabled', 'service_mcp_disabled', 'service_upgrade', 'service_scaled_down_for_tier_change', 'service_encryption_key_check_failed', 'service_encryption_key_rotation_failed', 'service_encryption_key_rotated', 'service_stop_encryption_key_inaccessible', 'service_restart_encryption_key_rotation', 'backup_delete', 'backup_bucket_create', 'backup_bucket_update', 'backup_bucket_delete', 'backup_bucket_archive', 'warehouse_update_name', 'warehouse_update_release_channel', 'role_create', 'role_update', 'role_delete', 'role_resources_delete', 'organization_member_remove_roles', 'scim_user_profile_update', 'scim_group_create', 'scim_group_update', 'scim_group_delete', 'organization_saml_connection_delete', 'organization_update_saml_query_ownership_migration', 'organization_approved_domain_verify', 'organization_approved_domain_update', 'organization_approved_domain_delete', 'organization_approved_domain_auto_join', 'organization_approved_domain_auto_invite', 'datadog_integration_create', 'datadog_integration_delete', 'organization_update_spend_alert', 'organization_update_core_dumps', 'organization_update_private_endpoints', 'organization_update_pci_compliance', 'organization_update_hipaa_status', 'organization_security_contact_add', 'organization_security_contact_remove', 'organization_security_contact_replace', 'organization_update_public_preview', 'byoc_infrastructure_update_customer_authorized_access', 'transfer_credits_in', 'transfer_credits_out', 'promo_code_claim', 'schema_advisor_seed', 'schema_advisor_generate_plan', 'schema_advisor_approve_plan', 'schema_advisor_start_deployment', 'schema_advisor_start_benchmark', 'schema_advisor_run_benchmark', 'schema_advisor_start_promotion', 'schema_advisor_exchange_tables', 'schema_advisor_drop_sandbox', 'udf_create', 'udf_update', 'udf_delete', 'udf_version_create', 'udf_version_delete', 'udf_attach', 'udf_detach', 'udf_update_services', 'udf_redeploy', 'udf_rebuild', 'postgres_action'. New values may be added; treat unknown values as valid.", + "type": "string", + "example": "service_create" }, "actorType": { "description": "Type of the actor: 'user', 'support', 'system', 'api'.", @@ -38285,6 +38100,7 @@ "Role", "Notebook", "SchemaMigration", + "App", "all" ], "example": "Dashboard" @@ -38398,6 +38214,7 @@ "Role", "Notebook", "SchemaMigration", + "App", "all" ], "example": "Dashboard" @@ -39590,6 +39407,11 @@ "null" ], "example": "507f1f77bcf86cd799439011" + }, + "minAutoGranularity": { + "description": "Floor for the auto-inferred chart granularity. Set it to the scrape/report interval of the metrics so a short time range does not produce buckets smaller than that interval (sparse, steppy series). Only constrains \"Auto\" granularity; an explicit granularity picked on a tile is never overridden. Omit for no minimum. Uses the SQL interval format (a positive integer followed by second, minute, hour, or day), not the short form of the materialized view granularity fields.", + "type": "string", + "example": "1 minute" } }, "required": [ @@ -39729,6 +39551,11 @@ "description": "Required by the API for all source kinds; not used by PromQL queries.", "type": "string", "example": "timestamp" + }, + "minAutoGranularity": { + "description": "Floor for the auto-inferred chart granularity, and the scrape interval that `$__rate_interval` is computed from. Set it to the Prometheus scrape interval so a short time range does not produce buckets smaller than that interval. Only constrains \"Auto\" granularity; an explicit granularity picked on a tile is never overridden. Omit for no minimum. Uses the SQL interval format (a positive integer followed by second, minute, hour, or day), not the short form of the materialized view granularity fields.", + "type": "string", + "example": "1 minute" } }, "required": [ @@ -42203,7 +42030,7 @@ "type": "number" }, "memoryGi": { - "description": "Memory per replica in GiB. When creating a BYOC service with this profile, minReplicaMemoryGb and maxReplicaMemoryGb must both equal this value. For v2-default, ignore this value: a Gen 2 service's size is set by the minReplicaMemoryGb and maxReplicaMemoryGb you send when creating or scaling it, not by the profile.", + "description": "Memory per replica in GiB. A BYOC service pinned to this profile must send minReplicaMemoryGb and maxReplicaMemoryGb equal to this value. A BYOC service that scales vertically (no profile, minReplicaMemoryGb lower than maxReplicaMemoryGb) takes both bounds from the memoryGi values in this list. For v2-default, ignore this value: a Gen 2 service's size is set by the minReplicaMemoryGb and maxReplicaMemoryGb you send when creating or scaling it, not by the profile.", "type": "number" } } @@ -43475,13 +43302,22 @@ }, "pgHaType": { "type": "string", - "description": "Type of high availability: \u201cnone\u201d for no replication, \u201casync\u201d for asynchronous replication to a single standby, and \u201csync\u201d for synchronous replication to two standbys.", + "description": "Type of high availability: \u201cnone\u201d for no replication, \u201casync\u201d for asynchronous replication to a single standby, and \u201csync\u201d for synchronous replication to the number of standbys in `standbyCount` (two by default).", "enum": [ "none", "async", "sync" ] }, + "pgStandbyCount": { + "type": "integer", + "description": "Number of hot standby instances. Accepted values and defaults depend on `haType`:\n- \u201cnone\u201d: 0 (default)\n- \u201casync\u201d: 1 (default)\n- \u201csync\u201d: 1, or 2 (default)\n\nWhen `haType` is updated without `standbyCount`, the default for the new `haType` applies.", + "enum": [ + 0, + 1, + 2 + ] + }, "pgProvider": { "type": "string", "enum": [ @@ -43580,6 +43416,9 @@ "haType": { "$ref": "#/components/schemas/pgHaType" }, + "standbyCount": { + "$ref": "#/components/schemas/pgStandbyCount" + }, "tags": { "$ref": "#/components/schemas/pgTags" } @@ -43605,6 +43444,9 @@ "haType": { "$ref": "#/components/schemas/pgHaType" }, + "standbyCount": { + "$ref": "#/components/schemas/pgStandbyCount" + }, "tags": { "$ref": "#/components/schemas/pgTags" }, @@ -43676,6 +43518,9 @@ "haType": { "$ref": "#/components/schemas/pgHaType" }, + "standbyCount": { + "$ref": "#/components/schemas/pgStandbyCount" + }, "tags": { "$ref": "#/components/schemas/pgTags" }, @@ -43714,6 +43559,9 @@ "haType": { "$ref": "#/components/schemas/pgHaType" }, + "standbyCount": { + "$ref": "#/components/schemas/pgStandbyCount" + }, "tags": { "$ref": "#/components/schemas/pgTags" }, @@ -43805,6 +43653,9 @@ "haType": { "$ref": "#/components/schemas/pgHaType" }, + "standbyCount": { + "$ref": "#/components/schemas/pgStandbyCount" + }, "tags": { "$ref": "#/components/schemas/pgTags" }, @@ -44436,7 +44287,7 @@ "maxLength": 256 }, "jwksUrl": { - "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one RS256 (RSA) key; it is fetched and validated when the provider is created or updated.", + "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one supported signing key: RS256 (RSA), or on ClickHouse 26.8 and later also ES256, ES384 or ES512 (EC); it is fetched and validated when the provider is created or updated.", "type": "string", "example": "https://auth.example.com/.well-known/jwks.json", "maxLength": 256 @@ -44476,7 +44327,7 @@ "maxLength": 256 }, "jwksUrl": { - "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one RS256 (RSA) key; it is fetched and validated when the provider is created or updated.", + "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one supported signing key: RS256 (RSA), or on ClickHouse 26.8 and later also ES256, ES384 or ES512 (EC); it is fetched and validated when the provider is created or updated.", "type": "string", "example": "https://auth.example.com/.well-known/jwks.json", "maxLength": 256 @@ -44509,7 +44360,7 @@ "maxLength": 256 }, "jwksUrl": { - "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one RS256 (RSA) key; it is fetched and validated when the provider is created or updated.", + "description": "Public `https://` URL of the JSON Web Key Set used to verify token signatures, at most 256 characters. The key set must contain at least one supported signing key: RS256 (RSA), or on ClickHouse 26.8 and later also ES256, ES384 or ES512 (EC); it is fetched and validated when the provider is created or updated.", "type": "string", "example": "https://auth.example.com/.well-known/jwks.json", "maxLength": 256 @@ -44766,7 +44617,7 @@ ] }, "byocId": { - "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and the maxReplicaGb parameters are required too, with values included among the following sizes: 48, 116, 172, 232.", + "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and maxReplicaMemoryGb parameters are required too. With a BYOC profile, both must equal that profile's memory size. Without a profile, equal values must be one of the following sizes: 48, 116, 172, 232. When BYOC vertical autoscaling is enabled for the organization (contact support), a minReplicaMemoryGb lower than maxReplicaMemoryGb, without a profile, creates a service that scales vertically between the two. Both values must be memory sizes listed by the serviceProfiles endpoint, and the service reports the profile 'v1-default'.", "type": "string" }, "hasTransparentDataEncryption": { @@ -44781,7 +44632,7 @@ } }, "profile": { - "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. Use the serviceProfiles endpoint to list the profiles available to the organization. Creating a 'v2-default' service needs Gen 2 enabled for the organization and included in its plan (SCALE or ENTERPRISE) or settings, an AWS region where Gen 2 is available, and no byocId (BYOC infrastructure is not supported). Gen 2 services use a fixed size: minReplicaMemoryGb must equal maxReplicaMemoryGb and the replica count is fixed (numReplicas, or equal minReplicas and maxReplicas). Gen 2 services cannot idle: send idleScaling as false, since it defaults to true.", + "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. A BYOC service that scales vertically within a memory range has no BYOC profile and reports 'v1-default'. Use the serviceProfiles endpoint to list the profiles available to the organization. Creating a 'v2-default' service needs Gen 2 enabled for the organization and included in its plan (SCALE or ENTERPRISE) or settings, an AWS region where Gen 2 is available, and no byocId (BYOC infrastructure is not supported). Gen 2 services use a fixed size: minReplicaMemoryGb must equal maxReplicaMemoryGb and the replica count is fixed (numReplicas, or equal minReplicas and maxReplicas). Gen 2 services cannot idle: send idleScaling as false, since it defaults to true.", "type": "string" }, "complianceType": { @@ -44803,6 +44654,10 @@ "enableCoreDumps": { "description": "Enables the underlying infra for collecting core dumps. Default is enabled.", "type": "boolean" + }, + "deletionProtection": { + "description": "When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off. Default is false. Setting it to true requires the `control-plane:service:delete` permission granted for all services in the organization (not service by service), in addition to `control-plane:organization:create-service`.", + "type": "boolean" } }, "required": [ @@ -44852,6 +44707,10 @@ "enableCoreDumps": { "description": "If true, the underlying infra is enabled for collecting core dumps.", "type": "boolean" + }, + "deletionProtection": { + "description": "When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off. Changing it in either direction requires the `control-plane:service:delete` permission on the service, in addition to `control-plane:service:manage`; sending the current value changes nothing and needs no extra permission. ClickStack services can't be updated through the API; manage their deletion protection in the console.", + "type": "boolean" } } }, @@ -45149,7 +45008,7 @@ ] }, "byocId": { - "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and the maxReplicaGb parameters are required too, with values included among the following sizes: 48, 116, 172, 232.", + "description": "This is the ID returned after setting up a region for Bring Your Own Cloud (BYOC). When the byocId parameter is specified, the minReplicaMemoryGb and maxReplicaMemoryGb parameters are required too. With a BYOC profile, both must equal that profile's memory size. Without a profile, equal values must be one of the following sizes: 48, 116, 172, 232. When BYOC vertical autoscaling is enabled for the organization (contact support), a minReplicaMemoryGb lower than maxReplicaMemoryGb, without a profile, creates a service that scales vertically between the two. Both values must be memory sizes listed by the serviceProfiles endpoint, and the service reports the profile 'v1-default'.", "type": "string" }, "hasTransparentDataEncryption": { @@ -45157,7 +45016,7 @@ "type": "boolean" }, "profile": { - "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. Use the serviceProfiles endpoint to list the profiles available to the organization.", + "description": "Custom instance profile. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. 'v2-default' is Gen 2 hardware. BYOC services may instead use a dynamic BYOC profile configured for their infrastructure (e.g. 'v1-standard-byoc-4'); it requires byocId, and minReplicaMemoryGb and maxReplicaMemoryGb must both equal the profile's memory size. A BYOC service that scales vertically within a memory range has no BYOC profile and reports 'v1-default'. Use the serviceProfiles endpoint to list the profiles available to the organization.", "type": "string" }, "transparentDataEncryptionKeyId": { @@ -45188,6 +45047,10 @@ "description": "True if the service's underline infra is enabled for collecting core dumps. This is an experimental feature", "type": "boolean" }, + "deletionProtection": { + "description": "When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off.", + "type": "boolean" + }, "scalingSchedule": { "$ref": "#/components/schemas/ScalingSchedule" }, @@ -45257,7 +45120,7 @@ "type": "number" }, "profile": { - "description": "Custom instance profile. Omit to leave the current profile unchanged. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. A BYOC profile (e.g. 'v1-standard-byoc-16') is a pin: minReplicaMemoryGb and maxReplicaMemoryGb must both be sent and equal that profile's memory size, and a memory range cannot be combined with it. A non-BYOC custom profile other than v2-default cannot be combined with a memory change; send the profile alone to change only the name. The profile cannot switch a service between Gen 1 and Gen 2 hardware (to or from 'v2-default'): the request is rejected with a 400 error; contact support to move it. While a schedule entry is active the new profile is stored on the schedule base config and the running service keeps the entry profile until the window ends. Use the serviceProfiles endpoint to list the profiles available to the organization.", + "description": "Custom instance profile. Omit to leave the current profile unchanged. Profiles other than v1-default and v2-default are only available for ENTERPRISE and BYOC organization tiers. Standard values: 'v1-default', 'v2-default', 'v1-highmem-xs', 'v1-highmem-s', 'v1-highmem-m', 'v1-highmem-l', 'v1-highmem-xl'. A BYOC profile (e.g. 'v1-standard-byoc-16') is a pin: minReplicaMemoryGb and maxReplicaMemoryGb must both be sent and equal that profile's memory size, and a memory range cannot be combined with it. To move a pinned BYOC service to a memory range, send the range without a profile, or with 'v1-default'. A non-BYOC custom profile other than v2-default cannot be combined with a memory change; send the profile alone to change only the name. The profile cannot switch a service between Gen 1 and Gen 2 hardware (to or from 'v2-default'): the request is rejected with a 400 error; contact support to move it. While a schedule entry is active the new profile is stored on the schedule base config and the running service keeps the entry profile until the window ends. Use the serviceProfiles endpoint to list the profiles available to the organization.", "type": "string" } } @@ -45560,7 +45423,7 @@ "$ref": "#/components/schemas/ClickPipeScaling" }, "settings": { - "$ref": "#/components/schemas/ClickPipeSettings" + "$ref": "#/components/schemas/ClickPipeSettingsPutRequest" }, "startPaused": { "description": "Create the ClickPipe in the Stopped state instead of starting ingestion immediately. Start it later with the state endpoint. Not supported for database ClickPipes.", @@ -45603,7 +45466,7 @@ } }, "settings": { - "$ref": "#/components/schemas/ClickPipeSettings" + "$ref": "#/components/schemas/ClickPipeSettingsPutRequest" } } }, @@ -46995,6 +46858,12 @@ "scheme": "basic", "description": "Use key ID and key secret obtained in ClickHouse Cloud console: https://clickhouse.com/docs/cloud/manage/openapi", "x-permission-scopes": "The scope list of a `security` requirement holds ClickHouse Cloud API key permission ids (for example `control-plane:organization:view`), not OAuth scopes. OpenAPI has no field for API key permissions, so this is the closest available place. A key must hold every permission listed on an operation to call it; an operation with no scopes needs none beyond a valid key. Every operation declares at most one requirement object, always for this scheme, so the list is only ever conjunctive \u2014 alternative sets of permissions are never expressed." + }, + "bearerJwt": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT", + "description": "ClickHouse Cloud user access token, sent as `Authorization: Bearer `. API keys are rejected. The token audience must be one of the `x-jwt-audiences` listed on the operation." } } }, diff --git a/crates/clickhouse-cloud-api/src/meta/operations.rs b/crates/clickhouse-cloud-api/src/meta/operations.rs index 5784faa3..2fd27c2e 100644 --- a/crates/clickhouse-cloud-api/src/meta/operations.rs +++ b/crates/clickhouse-cloud-api/src/meta/operations.rs @@ -1533,7 +1533,7 @@ pub const UDF_ATTACH: OperationMetadata = OperationMetadata { rust_method: "udf_attach", method: "PUT", path: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `GET /v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}` (`udfAttachmentGet`). @@ -1542,7 +1542,7 @@ pub const UDF_ATTACHMENT_GET: OperationMetadata = OperationMetadata { rust_method: "udf_attachment_get", method: "GET", path: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}", - required_permissions: &["control-plane:organization:view"], + required_permissions: &["control-plane:organization:view-udfs"], }; /// `GET /v1/organizations/{organizationId}/udfs/{functionName}/attachments` (`udfAttachmentList`). @@ -1551,7 +1551,7 @@ pub const UDF_ATTACHMENT_LIST: OperationMetadata = OperationMetadata { rust_method: "udf_attachment_list", method: "GET", path: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments", - required_permissions: &["control-plane:organization:view"], + required_permissions: &["control-plane:organization:view-udfs"], }; /// `POST /v1/organizations/{organizationId}/udfs` (`udfCreate`). @@ -1560,7 +1560,7 @@ pub const UDF_CREATE: OperationMetadata = OperationMetadata { rust_method: "udf_create", method: "POST", path: "/v1/organizations/{organizationId}/udfs", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `DELETE /v1/organizations/{organizationId}/udfs/{functionName}` (`udfDelete`). @@ -1569,7 +1569,7 @@ pub const UDF_DELETE: OperationMetadata = OperationMetadata { rust_method: "udf_delete", method: "DELETE", path: "/v1/organizations/{organizationId}/udfs/{functionName}", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `DELETE /v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}` (`udfDetach`). @@ -1578,7 +1578,7 @@ pub const UDF_DETACH: OperationMetadata = OperationMetadata { rust_method: "udf_detach", method: "DELETE", path: "/v1/organizations/{organizationId}/udfs/{functionName}/attachments/{serviceId}", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `GET /v1/organizations/{organizationId}/udfs/{functionName}` (`udfGet`). @@ -1587,7 +1587,7 @@ pub const UDF_GET: OperationMetadata = OperationMetadata { rust_method: "udf_get", method: "GET", path: "/v1/organizations/{organizationId}/udfs/{functionName}", - required_permissions: &["control-plane:organization:view"], + required_permissions: &["control-plane:organization:view-udfs"], }; /// `GET /v1/organizations/{organizationId}/udfs` (`udfList`). @@ -1596,7 +1596,7 @@ pub const UDF_LIST: OperationMetadata = OperationMetadata { rust_method: "udf_list", method: "GET", path: "/v1/organizations/{organizationId}/udfs", - required_permissions: &["control-plane:organization:view"], + required_permissions: &["control-plane:organization:view-udfs"], }; /// `POST /v1/organizations/{organizationId}/udfUploads/url` (`udfUploadSessionCreate`). @@ -1605,7 +1605,7 @@ pub const UDF_UPLOAD_SESSION_CREATE: OperationMetadata = OperationMetadata { rust_method: "udf_upload_session_create", method: "POST", path: "/v1/organizations/{organizationId}/udfUploads/url", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `POST /v1/organizations/{organizationId}/udfs/{functionName}/versions` (`udfVersionCreate`). @@ -1614,7 +1614,7 @@ pub const UDF_VERSION_CREATE: OperationMetadata = OperationMetadata { rust_method: "udf_version_create", method: "POST", path: "/v1/organizations/{organizationId}/udfs/{functionName}/versions", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `DELETE /v1/organizations/{organizationId}/udfs/{functionName}/versions/{version}` (`udfVersionDelete`). @@ -1623,7 +1623,7 @@ pub const UDF_VERSION_DELETE: OperationMetadata = OperationMetadata { rust_method: "udf_version_delete", method: "DELETE", path: "/v1/organizations/{organizationId}/udfs/{functionName}/versions/{version}", - required_permissions: &["control-plane:organization:manage"], + required_permissions: &["control-plane:organization:manage-udfs"], }; /// `GET /v1/organizations/{organizationId}/udfs/{functionName}/versions` (`udfVersionList`). @@ -1632,7 +1632,7 @@ pub const UDF_VERSION_LIST: OperationMetadata = OperationMetadata { rust_method: "udf_version_list", method: "GET", path: "/v1/organizations/{organizationId}/udfs/{functionName}/versions", - required_permissions: &["control-plane:organization:view"], + required_permissions: &["control-plane:organization:view-udfs"], }; /// `DELETE /v1/organizations/{organizationId}/services/{serviceId}/upgradeWindow` (`upgradeWindowDelete`). diff --git a/crates/clickhouse-cloud-api/src/models/activity.rs b/crates/clickhouse-cloud-api/src/models/activity.rs index aef85783..cdb79f9c 100644 --- a/crates/clickhouse-cloud-api/src/models/activity.rs +++ b/crates/clickhouse-cloud-api/src/models/activity.rs @@ -78,7 +78,11 @@ impl std::fmt::Display for ActivityKeyupdatetype { } } -/// Inline enum for `Activity.type`. +/// Known values of `Activity.type`. +/// +/// The spec types the field as an open string and lists these values in its +/// description ("New values may be added; treat unknown values as valid"), so +/// any other value deserializes into [`ActivityType::Unknown`]. #[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] pub enum ActivityType { #[serde(rename = "create_organization")] @@ -186,6 +190,8 @@ pub enum ActivityType { Service_maintenance_end, #[serde(rename = "service_update_core_dump")] Service_update_core_dump, + #[serde(rename = "service_update_deletion_protection")] + Service_update_deletion_protection, #[serde(rename = "backup_delete")] Backup_delete, #[serde(rename = "backup_bucket_archive")] @@ -426,6 +432,9 @@ impl std::fmt::Display for ActivityType { Self::Service_maintenance_start => write!(f, "service_maintenance_start"), Self::Service_maintenance_end => write!(f, "service_maintenance_end"), Self::Service_update_core_dump => write!(f, "service_update_core_dump"), + Self::Service_update_deletion_protection => { + write!(f, "service_update_deletion_protection") + } Self::Backup_delete => write!(f, "backup_delete"), Self::Backup_bucket_archive => write!(f, "backup_bucket_archive"), Self::Backup_bucket_create => write!(f, "backup_bucket_create"), diff --git a/crates/clickhouse-cloud-api/src/models/clickpipes/mod.rs b/crates/clickhouse-cloud-api/src/models/clickpipes/mod.rs index 859bc4bc..cbba7716 100644 --- a/crates/clickhouse-cloud-api/src/models/clickpipes/mod.rs +++ b/crates/clickhouse-cloud-api/src/models/clickpipes/mod.rs @@ -309,7 +309,7 @@ pub struct ClickPipePatchRequest { #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, + pub settings: Option, #[serde(skip_serializing_if = "Option::is_none")] pub source: Option, } @@ -349,7 +349,7 @@ pub struct ClickPipePostRequest { pub scaling: Option, // settings default-serializes as `{}` which the API also rejects. #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, + pub settings: Option, pub source: ClickPipePostSource, /// Create stopped and start ingestion later; unsupported for database ClickPipes. #[serde(rename = "startPaused", skip_serializing_if = "Option::is_none")] @@ -446,47 +446,18 @@ pub struct ClickPipeScalingPatchRequest { pub replicas: Option, } -/// `ClickPipeSettings` from the ClickHouse Cloud API. -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] -pub struct ClickPipeSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_max_download_threads: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_max_insert_threads: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_max_threads: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_min_insert_block_size_bytes: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_parallel_distributed_insert_select: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub clickhouse_parallel_view_processing: Option, - // The control plane rejected this key on an object-storage create on - // 2026-09-05, even when false. It must be absent outside Kafka creates. - #[serde( - rename = "kafka_read_committed", - skip_serializing_if = "Option::is_none" - )] - pub kafka_read_committed: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_concurrency: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_max_file_count: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_max_file_size: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_max_insert_bytes: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_polling_interval_ms: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub object_storage_use_cluster_function: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub streaming_max_insert_wait_ms: Option, -} +/// Former request-position name for ClickPipe settings. +/// +/// The spec now types `settings` in [`ClickPipePostRequest`] and +/// [`ClickPipePatchRequest`] as `ClickPipeSettingsPutRequest`, leaving the +/// `ClickPipeSettings` schema response-only ([`ClickPipeSettingsResponse`]). +/// The two request structs had identical fields, so this alias keeps existing +/// callers compiling with an unchanged wire body. +pub type ClickPipeSettings = ClickPipeSettingsPutRequest; /// `ClickPipeSettings` from the ClickHouse Cloud API, in response position. /// -/// Response variant of [`ClickPipeSettings`]: every field is `Option`, so a +/// Every field is `Option`, so a /// field the API drops or sends as `null` deserializes to `None` instead of /// failing. #[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] @@ -541,8 +512,8 @@ pub struct ClickPipeSettingsPutRequest { pub clickhouse_parallel_view_processing: Option, /// Kafka-only: the API rejects this key outright for any other source /// ("Setting 'kafka_read_committed' is only supported for Kafka - /// ClickPipes"), so absence — not `false` — is how a non-Kafka settings - /// update expresses "this setting does not apply". + /// ClickPipes"), so absence — not `false` — is how a non-Kafka create, + /// PATCH or settings update expresses "this setting does not apply". #[serde( rename = "kafka_read_committed", skip_serializing_if = "Option::is_none" diff --git a/crates/clickhouse-cloud-api/src/models/services.rs b/crates/clickhouse-cloud-api/src/models/services.rs index 880e73ad..81519b46 100644 --- a/crates/clickhouse-cloud-api/src/models/services.rs +++ b/crates/clickhouse-cloud-api/src/models/services.rs @@ -1540,6 +1540,10 @@ pub struct Service { pub current_scaling: Option, #[serde(rename = "dataWarehouseId", skip_serializing_if = "Option::is_none")] pub data_warehouse_id: Option, + /// When true, the service cannot be deleted: the delete endpoint returns + /// 409 until deletion protection is turned off. + #[serde(rename = "deletionProtection", skip_serializing_if = "Option::is_none")] + pub deletion_protection: Option, #[serde(rename = "enableCoreDumps", skip_serializing_if = "Option::is_none")] pub enable_core_dumps: Option, #[serde( @@ -1785,6 +1789,13 @@ pub struct ServicePasswordPatchResponse { /// `ServicePatchRequest` from the ClickHouse Cloud API. #[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] pub struct ServicePatchRequest { + /// When true, the service cannot be deleted: the delete endpoint returns + /// 409 until deletion protection is turned off. Changing it in either + /// direction requires `control-plane:service:delete` on the service, in + /// addition to `control-plane:service:manage`; sending the current value + /// changes nothing. ClickStack services cannot be updated through the API. + #[serde(rename = "deletionProtection", skip_serializing_if = "Option::is_none")] + pub deletion_protection: Option, #[serde(rename = "enableCoreDumps", skip_serializing_if = "Option::is_none")] pub enable_core_dumps: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1834,6 +1845,13 @@ pub struct ServicePostRequest { pub compliance_type: Option, #[serde(rename = "dataWarehouseId", skip_serializing_if = "Option::is_none")] pub data_warehouse_id: Option, + /// When true, the service cannot be deleted: the delete endpoint returns + /// 409 until deletion protection is turned off. Defaults to false. Setting + /// it to true requires `control-plane:service:delete` granted for all + /// services in the organization, in addition to + /// `control-plane:organization:create-service`. + #[serde(rename = "deletionProtection", skip_serializing_if = "Option::is_none")] + pub deletion_protection: Option, #[serde(rename = "enableCoreDumps", skip_serializing_if = "Option::is_none")] pub enable_core_dumps: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1905,6 +1923,7 @@ impl ServicePostRequest { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -2045,6 +2064,10 @@ pub struct ServiceScalingPatchResponse { pub current_scaling: Option, #[serde(rename = "dataWarehouseId", skip_serializing_if = "Option::is_none")] pub data_warehouse_id: Option, + /// When true, the service cannot be deleted: the delete endpoint returns + /// 409 until deletion protection is turned off. + #[serde(rename = "deletionProtection", skip_serializing_if = "Option::is_none")] + pub deletion_protection: Option, #[serde(rename = "enableCoreDumps", skip_serializing_if = "Option::is_none")] pub enable_core_dumps: Option, #[serde( diff --git a/crates/clickhouse-cloud-api/tests/client/client.rs b/crates/clickhouse-cloud-api/tests/client/client.rs index 8650a83e..76e46eae 100644 --- a/crates/clickhouse-cloud-api/tests/client/client.rs +++ b/crates/clickhouse-cloud-api/tests/client/client.rs @@ -150,6 +150,7 @@ async fn api_error_403_forbidden() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -390,6 +391,7 @@ async fn api_error_422_validation() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, diff --git a/crates/clickhouse-cloud-api/tests/client/services.rs b/crates/clickhouse-cloud-api/tests/client/services.rs index 66efd417..80386d11 100644 --- a/crates/clickhouse-cloud-api/tests/client/services.rs +++ b/crates/clickhouse-cloud-api/tests/client/services.rs @@ -78,6 +78,7 @@ async fn create_service() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -199,6 +200,107 @@ async fn update_service() { assert_eq!(svc.name.as_deref(), Some("renamed-svc")); } +#[tokio::test] +async fn create_service_sends_and_reads_deletion_protection() { + let (s, c) = setup().await; + + Mock::given(method("POST")) + .and(path("/v1/organizations/org-1/services")) + .and(body_partial_json(serde_json::json!({ + "name": "protected", + "deletionProtection": true + }))) + .respond_with(ok_json(serde_json::json!({ + "service": {"id": "11111111-2222-3333-4444-555555555555", "name": "protected", "deletionProtection": true}, + "password": "pw" + }))) + .expect(1) + .mount(&s) + .await; + + let mut body = ServicePostRequest::new( + "protected".to_string(), + ServicePostRequestProvider::Aws, + ServicePostRequestRegion::Us_east_1, + Vec::new(), + ); + body.deletion_protection = Some(true); + let resp = c.instance_create("org-1", &body).await.unwrap(); + let service = resp.result.unwrap().service.unwrap(); + assert_eq!(service.deletion_protection, Some(true)); +} + +#[tokio::test] +async fn update_service_toggles_deletion_protection() { + let (s, c) = setup().await; + + Mock::given(method("PATCH")) + .and(path("/v1/organizations/org-1/services/svc-1")) + .and(body_json(serde_json::json!({"deletionProtection": false}))) + .respond_with(ok_json(serde_json::json!({ + "id": "11111111-2222-3333-4444-555555555555", + "deletionProtection": false + }))) + .expect(1) + .mount(&s) + .await; + + let body = ServicePatchRequest { + deletion_protection: Some(false), + ..Default::default() + }; + let resp = c.instance_update("org-1", "svc-1", &body).await.unwrap(); + assert_eq!(resp.result.unwrap().deletion_protection, Some(false)); +} + +/// The spec documents a 409 from delete while deletion protection is on. +#[tokio::test] +async fn delete_protected_service_surfaces_409() { + let (s, c) = setup().await; + + Mock::given(method("DELETE")) + .and(path("/v1/organizations/org-1/services/svc-1")) + .respond_with(ResponseTemplate::new(409).set_body_json(serde_json::json!({ + "status": 409, + "error": "deletion protection is enabled" + }))) + .expect(1) + .mount(&s) + .await; + + match c.instance_delete("org-1", "svc-1").await { + Err(clickhouse_cloud_api::Error::Api { status, .. }) => assert_eq!(status, 409), + other => panic!("expected a 409 API error, got {other:?}"), + } +} + +#[tokio::test] +async fn scaling_update_reads_deletion_protection() { + let (s, c) = setup().await; + + Mock::given(method("PATCH")) + .and(path( + "/v1/organizations/org-1/services/svc-1/replicaScaling", + )) + .respond_with(ok_json(serde_json::json!({ + "id": "11111111-2222-3333-4444-555555555555", + "deletionProtection": true + }))) + .expect(1) + .mount(&s) + .await; + + let resp = c + .instance_replica_scaling_update( + "org-1", + "svc-1", + &ServiceReplicaScalingPatchRequest::default(), + ) + .await + .unwrap(); + assert_eq!(resp.result.unwrap().deletion_protection, Some(true)); +} + #[tokio::test] async fn delete_service() { let mock_server = MockServer::start().await; diff --git a/crates/clickhouse-cloud-api/tests/common/support.rs b/crates/clickhouse-cloud-api/tests/common/support.rs index 36e9b7bc..1bedd49e 100644 --- a/crates/clickhouse-cloud-api/tests/common/support.rs +++ b/crates/clickhouse-cloud-api/tests/common/support.rs @@ -1091,6 +1091,21 @@ async fn ensure_service_gone( match client.instance_get(org_id, service_id).await { Ok(resp) => { if let Some(svc) = resp.result { + // A protected service answers delete with 409, so a test that + // left protection on must not leak the service. + if svc.deletion_protection == Some(true) { + eprintln!(" cleanup: disabling deletion protection"); + let _ = client + .instance_update( + org_id, + service_id, + &ServicePatchRequest { + deletion_protection: Some(false), + ..Default::default() + }, + ) + .await; + } let state = service_state(&svc); if matches!(state.as_str(), "running" | "idle" | "starting" | "awaking") { eprintln!(" cleanup: stopping service before delete"); @@ -1485,6 +1500,7 @@ pub async fn provision_clickhouse( byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, diff --git a/crates/clickhouse-cloud-api/tests/integration_test.rs b/crates/clickhouse-cloud-api/tests/integration_test.rs index 1f7a5eb7..d3340dc5 100644 --- a/crates/clickhouse-cloud-api/tests/integration_test.rs +++ b/crates/clickhouse-cloud-api/tests/integration_test.rs @@ -937,6 +937,7 @@ async fn cloud_service_crud_lifecycle() -> TestResult<()> { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -3450,6 +3451,74 @@ async fn cloud_service_crud_lifecycle() -> TestResult<()> { }) .await?; + // Deletion protection: while it is on, delete answers 409 (documented in + // the instanceDelete description). Turning it off again happens in the + // same step so a failed assertion cannot block the real delete below; + // cleanup also turns it off before deleting a leaked service. + failures + .run( + &ctx, + StepKind::NonBlocking, + "deletion protection blocks delete with 409", + || { + let client = client.clone(); + let org_id = ctx.org_id.clone(); + let service_id = service_id.clone(); + async move { + let enabled = client + .instance_update( + &org_id, + &service_id, + &ServicePatchRequest { + deletion_protection: Some(true), + ..Default::default() + }, + ) + .await? + .result + .ok_or("service update returned no result")?; + let delete_result = client.instance_delete(&org_id, &service_id).await; + let disabled = client + .instance_update( + &org_id, + &service_id, + &ServicePatchRequest { + deletion_protection: Some(false), + ..Default::default() + }, + ) + .await? + .result + .ok_or("service update returned no result")?; + if enabled.deletion_protection != Some(true) { + return Err(format!( + "expected deletionProtection=true after enabling, got {:?}", + enabled.deletion_protection + ) + .into()); + } + match delete_result { + Err(clickhouse_cloud_api::Error::Api { status: 409, .. }) => {} + other => { + return Err(format!( + "expected 409 deleting a protected service, got {other:?}" + ) + .into()); + } + } + if disabled.deletion_protection != Some(false) { + return Err(format!( + "expected deletionProtection=false after disabling, got {:?}", + disabled.deletion_protection + ) + .into()); + } + Ok(()) + } + }, + ) + .await?; + failures .run(&ctx, StepKind::Blocking, "delete service", || { let client = client.clone(); diff --git a/crates/clickhouse-cloud-api/tests/integration_udf_test.rs b/crates/clickhouse-cloud-api/tests/integration_udf_test.rs index c32c1c57..fcf418ce 100644 --- a/crates/clickhouse-cloud-api/tests/integration_udf_test.rs +++ b/crates/clickhouse-cloud-api/tests/integration_udf_test.rs @@ -150,6 +150,7 @@ async fn cloud_udf_list_lifecycle() -> TestResult<()> { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, diff --git a/crates/clickhouse-cloud-api/tests/model_facade_test.rs b/crates/clickhouse-cloud-api/tests/model_facade_test.rs index 29237fc3..aa0f9f76 100644 --- a/crates/clickhouse-cloud-api/tests/model_facade_test.rs +++ b/crates/clickhouse-cloud-api/tests/model_facade_test.rs @@ -112,6 +112,12 @@ fn extracted_models_keep_root_and_models_paths() { PhantomData::, PhantomData::, ); + // `ClickPipeSettings` is kept as an alias of the request type the spec now + // uses for create/PATCH settings, so existing callers keep compiling. + assert_same_type( + PhantomData::, + PhantomData::, + ); assert_same_type( PhantomData::, PhantomData::, diff --git a/crates/clickhouse-cloud-api/tests/models/activity.rs b/crates/clickhouse-cloud-api/tests/models/activity.rs index 9bf818e4..dfcb532c 100644 --- a/crates/clickhouse-cloud-api/tests/models/activity.rs +++ b/crates/clickhouse-cloud-api/tests/models/activity.rs @@ -41,6 +41,10 @@ fn activity_type_new_wire_values_deserialize_to_typed_variants() { ("role_update", ActivityType::Role_update), ("service_mcp_enabled", ActivityType::Service_mcp_enabled), ("udf_create", ActivityType::Udf_create), + ( + "service_update_deletion_protection", + ActivityType::Service_update_deletion_protection, + ), ]; for (wire, expected) in cases { let parsed: ActivityType = serde_json::from_str(&format!("\"{wire}\"")).unwrap(); @@ -101,3 +105,19 @@ fn activity_type_postgres_action_round_trips() { assert_eq!(parsed.to_string(), "postgres_action"); assert_eq!(serde_json::to_value(&parsed).unwrap(), "postgres_action"); } + +/// The spec now types `Activity.type` as an open string ("treat unknown values +/// as valid"), so any value outside the known list must still deserialize. +#[test] +fn activity_type_accepts_unlisted_values() { + let activity: Activity = + serde_json::from_value(serde_json::json!({"type": "some_future_activity"})).unwrap(); + assert_eq!( + activity.r#type, + Some(ActivityType::Unknown("some_future_activity".to_string())) + ); + assert_eq!( + serde_json::to_value(&activity).unwrap(), + serde_json::json!({"type": "some_future_activity"}) + ); +} diff --git a/crates/clickhouse-cloud-api/tests/models/clickpipes.rs b/crates/clickhouse-cloud-api/tests/models/clickpipes.rs index 877f51d7..c0847918 100644 --- a/crates/clickhouse-cloud-api/tests/models/clickpipes.rs +++ b/crates/clickhouse-cloud-api/tests/models/clickpipes.rs @@ -745,6 +745,47 @@ fn click_pipe_post_kafka_source_requires_authentication() { } } +// The spec types create and PATCH `settings` as `ClickPipeSettingsPutRequest`, +// the same schema the settings PUT takes, so nested settings follow the same +// omission contract: unset keys (including the Kafka-only +// `kafka_read_committed`) never reach the wire. +#[test] +fn click_pipe_create_and_patch_settings_use_the_put_request_shape() { + let settings = ClickPipeSettingsPutRequest { + object_storage_max_file_count: Some(200), + ..Default::default() + }; + let create = ClickPipePostRequest { + destination: ClickPipeMutateDestination { + columns: None, + database: "db".to_string(), + managed_table: None, + roles: None, + table: None, + table_definition: None, + }, + field_mappings: None, + name: "pipe".to_string(), + scaling: None, + settings: Some(settings.clone()), + source: ClickPipePostSource::default(), + start_paused: None, + }; + let patch = ClickPipePatchRequest { + settings: Some(settings), + ..Default::default() + }; + for wire in [ + serde_json::to_value(&create).unwrap(), + serde_json::to_value(&patch).unwrap(), + ] { + assert_eq!( + wire["settings"], + serde_json::json!({ "object_storage_max_file_count": 200 }) + ); + } +} + // `kafka_read_committed` is only supported for Kafka pipes, so a settings PUT // for any other source must leave the key off the wire entirely — not send // `false` and not send `null`. diff --git a/crates/clickhouse-cloud-api/tests/models/services.rs b/crates/clickhouse-cloud-api/tests/models/services.rs index a24a5c34..ca7b1684 100644 --- a/crates/clickhouse-cloud-api/tests/models/services.rs +++ b/crates/clickhouse-cloud-api/tests/models/services.rs @@ -70,6 +70,7 @@ fn serialize_service_post_request() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -108,6 +109,7 @@ fn serialize_service_post_request_horizontal_autoscaling() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -147,6 +149,7 @@ fn serialize_service_post_request_horizontal_autoscaling() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -1023,6 +1026,7 @@ fn service_post_request_backup_encryption_config_serialization() { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, @@ -1127,3 +1131,75 @@ fn service_post_request_new_sends_only_required_fields() { }) ); } + +#[test] +fn service_deletion_protection_tolerates_missing_and_null() { + for wire in [ + serde_json::json!({}), + serde_json::json!({"deletionProtection": null}), + ] { + let service: Service = serde_json::from_value(wire.clone()).unwrap(); + assert_eq!(service.deletion_protection, None); + assert_eq!( + serde_json::to_value(service).unwrap(), + serde_json::json!({}) + ); + + let scaled: ServiceScalingPatchResponse = serde_json::from_value(wire).unwrap(); + assert_eq!(scaled.deletion_protection, None); + assert_eq!(serde_json::to_value(scaled).unwrap(), serde_json::json!({})); + } +} + +#[test] +fn service_deletion_protection_round_trips_both_values() { + for value in [true, false] { + let wire = serde_json::json!({"deletionProtection": value}); + + let service: Service = serde_json::from_value(wire.clone()).unwrap(); + assert_eq!(service.deletion_protection, Some(value)); + assert_eq!(serde_json::to_value(service).unwrap(), wire); + + let scaled: ServiceScalingPatchResponse = serde_json::from_value(wire.clone()).unwrap(); + assert_eq!(scaled.deletion_protection, Some(value)); + assert_eq!(serde_json::to_value(scaled).unwrap(), wire); + } +} + +/// Unset deletion protection is omitted, so a create or update that does not +/// mention it leaves the server default (create) or current value (update). +#[test] +fn service_requests_send_deletion_protection_only_when_set() { + let mut create = ServicePostRequest::new( + "protected".to_string(), + ServicePostRequestProvider::Aws, + ServicePostRequestRegion::Us_east_1, + Vec::new(), + ); + assert!( + serde_json::to_value(&create) + .unwrap() + .get("deletionProtection") + .is_none() + ); + create.deletion_protection = Some(true); + assert_eq!( + serde_json::to_value(&create).unwrap()["deletionProtection"], + true + ); + + assert_eq!( + serde_json::to_value(ServicePatchRequest::default()).unwrap(), + serde_json::json!({}) + ); + for value in [true, false] { + assert_eq!( + serde_json::to_value(ServicePatchRequest { + deletion_protection: Some(value), + ..Default::default() + }) + .unwrap(), + serde_json::json!({"deletionProtection": value}) + ); + } +} diff --git a/crates/clickhouse-openapi-analyzer/src/config.rs b/crates/clickhouse-openapi-analyzer/src/config.rs index 712b4b04..1101c658 100644 --- a/crates/clickhouse-openapi-analyzer/src/config.rs +++ b/crates/clickhouse-openapi-analyzer/src/config.rs @@ -119,7 +119,11 @@ const OPTIONAL_REQUEST_SCHEMAS: &[&str] = &[ // "Setting 'kafka_read_committed' is only supported for Kafka ClickPipes" // for every other source, so absence is the only way a non-Kafka update // can express "does not apply". `object_storage_max_file_size` is also a - // private-preview setting that orgs must have enabled by support. + // private-preview setting that orgs must have enabled by support. The + // same contract applies to settings nested in a ClickPipe create or PATCH, + // which the spec also types as this schema: on 2026-09-05 an + // object-storage create with `kafka_read_committed: false` was rejected, + // while omitting the key succeeded. "ClickPipeSettingsPutRequest", // Despite its non-Patch name and descriptions that omit the "Optional" // prefix, RoleUpdateRequest is used only by PATCH and the operation states @@ -176,15 +180,6 @@ const OPTIONALITY_EXEMPTIONS: &[(&str, &str)] = &[ // https://github.com/ClickHouse/terraform-provider-clickhouse/blob/7c1d20d485f260f410698a17936cf7793bb5d9e1/internal/service/clickhouse/resource/clickpipe_kafka_update_payload_test.go ("ClickPipePatchKafkaSource", "credentials"), ("ClickPipePatchKafkaSource", "reversePrivateEndpointIds"), - // ClickPipeSettingsPutRequest's source-conditional contract also applies to - // settings nested in a create request: on 2026-09-05 an object-storage create with the key set - // to false was rejected, while omitting it succeeded. - ("ClickPipeSettings", "kafka_read_committed"), - // object_storage_max_file_size is object-storage-only and private preview - // ("Contact support to enable it"), and can only lower the server's limit, - // so a create must be able to leave it out. The schema has no required[] - // and the field is not nullable, unlike its nullable neighbours. - ("ClickPipeSettings", "object_storage_max_file_size"), // Empty TLS/IAM strings fail validation for sources that do not use them. ("ClickPipeMutatePostgresSource", "caCertificate"), ("ClickPipeMutatePostgresSource", "iamRole"), diff --git a/crates/clickhousectl/src/cloud/services/lifecycle.rs b/crates/clickhousectl/src/cloud/services/lifecycle.rs index b62cee93..6aeee8f2 100644 --- a/crates/clickhousectl/src/cloud/services/lifecycle.rs +++ b/crates/clickhousectl/src/cloud/services/lifecycle.rs @@ -607,6 +607,8 @@ fn build_update_service_request( transparent_data_encryption_key_id: options.transparent_data_encryption_key_id.clone(), tags: parse_instance_tags_patch(&options.add_tags, &options.remove_tags)?, enable_core_dumps: options.enable_core_dumps, + // Not exposed by `cloud service update` yet: never sent. + deletion_protection: None, }) } @@ -2025,6 +2027,7 @@ mod tests { assert!(request.transparent_data_encryption_key_id.is_none()); assert!(request.tags.is_none()); assert!(request.enable_core_dumps.is_none()); + assert!(request.deletion_protection.is_none()); } #[test] @@ -2078,6 +2081,7 @@ mod tests { assert_eq!(tags.remove[0].key, "old"); assert_eq!(tags.remove[0].value.as_deref(), Some("tag")); assert_eq!(request.enable_core_dumps, Some(false)); + assert!(request.deletion_protection.is_none()); } #[test] diff --git a/crates/clickhousectl/tests/live_clickpipe_postgres_cdc_test.rs b/crates/clickhousectl/tests/live_clickpipe_postgres_cdc_test.rs index 538df81c..1bea6591 100644 --- a/crates/clickhousectl/tests/live_clickpipe_postgres_cdc_test.rs +++ b/crates/clickhousectl/tests/live_clickpipe_postgres_cdc_test.rs @@ -165,6 +165,7 @@ async fn cloud_clickpipe_postgres_cli_cdc() -> TestResult<()> { byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None, diff --git a/crates/clickhousectl/tests/live_service_query_bind_test.rs b/crates/clickhousectl/tests/live_service_query_bind_test.rs index 950eb682..630623e3 100644 --- a/crates/clickhousectl/tests/live_service_query_bind_test.rs +++ b/crates/clickhousectl/tests/live_service_query_bind_test.rs @@ -407,6 +407,7 @@ async fn create_running_service( byoc_id: None, compliance_type: None, data_warehouse_id: None, + deletion_protection: None, enable_core_dumps: None, endpoints: None, has_transparent_data_encryption: None,