@distilled.cloud/clickhouse-cloud 0.0.0-stage → 1.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +138 -2
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +34 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +58 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +49 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +35 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/api_keys.d.ts +175 -0
  26. package/lib/services/api_keys.d.ts.map +1 -0
  27. package/lib/services/api_keys.js +2 -0
  28. package/lib/services/api_keys.js.map +1 -0
  29. package/lib/services/backup.d.ts +117 -0
  30. package/lib/services/backup.d.ts.map +1 -0
  31. package/lib/services/backup.js +2 -0
  32. package/lib/services/backup.js.map +1 -0
  33. package/lib/services/billing.d.ts +69 -0
  34. package/lib/services/billing.d.ts.map +1 -0
  35. package/lib/services/billing.js +2 -0
  36. package/lib/services/billing.js.map +1 -0
  37. package/lib/services/click_pipes.d.ts +1637 -0
  38. package/lib/services/click_pipes.d.ts.map +1 -0
  39. package/lib/services/click_pipes.js +31 -0
  40. package/lib/services/click_pipes.js.map +1 -0
  41. package/lib/services/index.d.ts +14 -0
  42. package/lib/services/index.d.ts.map +1 -0
  43. package/lib/services/index.js +13 -0
  44. package/lib/services/organization.d.ts +336 -0
  45. package/lib/services/organization.d.ts.map +1 -0
  46. package/lib/services/organization.js +2 -0
  47. package/lib/services/organization.js.map +1 -0
  48. package/lib/services/postgres.d.ts +726 -0
  49. package/lib/services/postgres.d.ts.map +1 -0
  50. package/lib/services/postgres.js +31 -0
  51. package/lib/services/postgres.js.map +1 -0
  52. package/lib/services/prometheus.d.ts +71 -0
  53. package/lib/services/prometheus.d.ts.map +1 -0
  54. package/lib/services/prometheus.js +2 -0
  55. package/lib/services/prometheus.js.map +1 -0
  56. package/lib/services/query_api_endpoints.d.ts +189 -0
  57. package/lib/services/query_api_endpoints.d.ts.map +1 -0
  58. package/lib/services/query_api_endpoints.js +2 -0
  59. package/lib/services/query_api_endpoints.js.map +1 -0
  60. package/lib/services/role_management.d.ts +159 -0
  61. package/lib/services/role_management.d.ts.map +1 -0
  62. package/lib/services/role_management.js +2 -0
  63. package/lib/services/role_management.js.map +1 -0
  64. package/lib/services/saved_queries.d.ts +129 -0
  65. package/lib/services/saved_queries.d.ts.map +1 -0
  66. package/lib/services/saved_queries.js +2 -0
  67. package/lib/services/saved_queries.js.map +1 -0
  68. package/lib/services/service.d.ts +886 -0
  69. package/lib/services/service.d.ts.map +1 -0
  70. package/lib/services/service.js +41 -0
  71. package/lib/services/service.js.map +1 -0
  72. package/lib/services/udf.d.ts +373 -0
  73. package/lib/services/udf.d.ts.map +1 -0
  74. package/lib/services/udf.js +24 -0
  75. package/lib/services/udf.js.map +1 -0
  76. package/lib/services/user_management.d.ts +150 -0
  77. package/lib/services/user_management.d.ts.map +1 -0
  78. package/lib/services/user_management.js +2 -0
  79. package/lib/services/user_management.js.map +1 -0
  80. package/lib/services.lazy/api_keys.js +1 -0
  81. package/lib/services.lazy/backup.js +1 -0
  82. package/lib/services.lazy/billing.js +1 -0
  83. package/lib/services.lazy/click_pipes.js +3 -0
  84. package/lib/services.lazy/index.js +3 -0
  85. package/lib/services.lazy/organization.js +1 -0
  86. package/lib/services.lazy/postgres.js +4 -0
  87. package/lib/services.lazy/prometheus.js +1 -0
  88. package/lib/services.lazy/query_api_endpoints.js +1 -0
  89. package/lib/services.lazy/role_management.js +1 -0
  90. package/lib/services.lazy/saved_queries.js +1 -0
  91. package/lib/services.lazy/service.js +4 -0
  92. package/lib/services.lazy/udf.js +3 -0
  93. package/lib/services.lazy/user_management.js +1 -0
  94. package/lib/traits.d.ts +11 -0
  95. package/lib/traits.d.ts.map +1 -0
  96. package/lib/traits.js +1 -0
  97. package/lib/unstable-services/backup.d.ts +165 -0
  98. package/lib/unstable-services/backup.d.ts.map +1 -0
  99. package/lib/unstable-services/backup.js +2 -0
  100. package/lib/unstable-services/backup.js.map +1 -0
  101. package/lib/unstable-services/billing.d.ts +84 -0
  102. package/lib/unstable-services/billing.d.ts.map +1 -0
  103. package/lib/unstable-services/billing.js +2 -0
  104. package/lib/unstable-services/billing.js.map +1 -0
  105. package/lib/unstable-services/click_pipes.d.ts +324 -0
  106. package/lib/unstable-services/click_pipes.d.ts.map +1 -0
  107. package/lib/unstable-services/click_pipes.js +2 -0
  108. package/lib/unstable-services/click_pipes.js.map +1 -0
  109. package/lib/unstable-services/click_stack.d.ts +3538 -0
  110. package/lib/unstable-services/click_stack.d.ts.map +1 -0
  111. package/lib/unstable-services/click_stack.js +60 -0
  112. package/lib/unstable-services/click_stack.js.map +1 -0
  113. package/lib/unstable-services/index.d.ts +11 -0
  114. package/lib/unstable-services/index.d.ts.map +1 -0
  115. package/lib/unstable-services/index.js +10 -0
  116. package/lib/unstable-services/notifications.d.ts +166 -0
  117. package/lib/unstable-services/notifications.d.ts.map +1 -0
  118. package/lib/unstable-services/notifications.js +2 -0
  119. package/lib/unstable-services/notifications.js.map +1 -0
  120. package/lib/unstable-services/organization.d.ts +403 -0
  121. package/lib/unstable-services/organization.d.ts.map +1 -0
  122. package/lib/unstable-services/organization.js +26 -0
  123. package/lib/unstable-services/organization.js.map +1 -0
  124. package/lib/unstable-services/postgres.d.ts +415 -0
  125. package/lib/unstable-services/postgres.d.ts.map +1 -0
  126. package/lib/unstable-services/postgres.js +2 -0
  127. package/lib/unstable-services/postgres.js.map +1 -0
  128. package/lib/unstable-services/service.d.ts +244 -0
  129. package/lib/unstable-services/service.d.ts.map +1 -0
  130. package/lib/unstable-services/service.js +2 -0
  131. package/lib/unstable-services/service.js.map +1 -0
  132. package/lib/unstable-services/snapshot.d.ts +146 -0
  133. package/lib/unstable-services/snapshot.d.ts.map +1 -0
  134. package/lib/unstable-services/snapshot.js +2 -0
  135. package/lib/unstable-services/snapshot.js.map +1 -0
  136. package/lib/unstable-services/user_management.d.ts +41 -0
  137. package/lib/unstable-services/user_management.d.ts.map +1 -0
  138. package/lib/unstable-services/user_management.js +2 -0
  139. package/lib/unstable-services/user_management.js.map +1 -0
  140. package/lib/unstable-services.lazy/backup.js +1 -0
  141. package/lib/unstable-services.lazy/billing.js +1 -0
  142. package/lib/unstable-services.lazy/click_pipes.js +1 -0
  143. package/lib/unstable-services.lazy/click_stack.js +4 -0
  144. package/lib/unstable-services.lazy/index.js +3 -0
  145. package/lib/unstable-services.lazy/notifications.js +1 -0
  146. package/lib/unstable-services.lazy/organization.js +4 -0
  147. package/lib/unstable-services.lazy/postgres.js +1 -0
  148. package/lib/unstable-services.lazy/service.js +1 -0
  149. package/lib/unstable-services.lazy/snapshot.js +1 -0
  150. package/lib/unstable-services.lazy/user_management.js +1 -0
  151. package/package.json +94 -3
  152. package/src/credentials.ts +88 -0
  153. package/src/errors.ts +76 -0
  154. package/src/index.ts +53 -0
  155. package/src/pagination.ts +9 -0
  156. package/src/protocol.ts +76 -0
  157. package/src/retry.ts +53 -0
  158. package/src/services/api_keys.ts +466 -0
  159. package/src/services/backup.ts +347 -0
  160. package/src/services/billing.ts +170 -0
  161. package/src/services/click_pipes.ts +3483 -0
  162. package/src/services/index.ts +14 -0
  163. package/src/services/organization.ts +901 -0
  164. package/src/services/postgres.ts +1967 -0
  165. package/src/services/prometheus.ts +271 -0
  166. package/src/services/query_api_endpoints.ts +466 -0
  167. package/src/services/role_management.ts +436 -0
  168. package/src/services/saved_queries.ts +384 -0
  169. package/src/services/service.ts +2112 -0
  170. package/src/services/udf.ts +1019 -0
  171. package/src/services/user_management.ts +508 -0
  172. package/src/traits.ts +45 -0
  173. package/src/unstable-services/backup.ts +422 -0
  174. package/src/unstable-services/billing.ts +232 -0
  175. package/src/unstable-services/click_pipes.ts +702 -0
  176. package/src/unstable-services/click_stack.ts +7114 -0
  177. package/src/unstable-services/index.ts +11 -0
  178. package/src/unstable-services/notifications.ts +451 -0
  179. package/src/unstable-services/organization.ts +1107 -0
  180. package/src/unstable-services/postgres.ts +1061 -0
  181. package/src/unstable-services/service.ts +795 -0
  182. package/src/unstable-services/snapshot.ts +397 -0
  183. package/src/unstable-services/user_management.ts +127 -0
@@ -0,0 +1,2112 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-clickhouse-cloud/specs/openapi.json). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import type * as Redacted from "effect/Redacted";
7
+ import { ClickHouseCloudServiceErrors } from "../errors.ts";
8
+ import {
9
+ ClickHouseCloudProtocol,
10
+ type ClickHouseCloudOpError,
11
+ type ClickHouseCloudOpContext,
12
+ } from "../protocol.ts";
13
+ import * as Retry from "../retry.ts";
14
+ import * as T from "../traits.ts";
15
+ // Schema table, filled on first reach (see __S at the end).
16
+ const __s: any[] = [];
17
+
18
+ export type { ClickHouseCloudOpError, ClickHouseCloudOpContext };
19
+
20
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
21
+ const TELEMETRY = {
22
+ system: "clickhouse-cloud-api",
23
+ responseHeaders: [
24
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
25
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
26
+ ],
27
+ prefix: "ClickhouseCloud",
28
+ service: "Services",
29
+ labels: "clickhouse_cloud",
30
+ propagate: "w3c",
31
+ } as const;
32
+
33
+ /** The service has deletion protection on. Turn it off (updateService with deletionProtection: false), then delete it. */
34
+ export class DeletionProtectionEnabled
35
+ extends /*@__PURE__*/ T.applyErrorMatchers(
36
+ /*@__PURE__*/ S.TaggedError<DeletionProtectionEnabled>()("DeletionProtectionEnabled", {
37
+ message: S.String,
38
+ body: /*@__PURE__*/ S.optional(S.Unknown),
39
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
40
+ }).pipe(C.withConflictError),
41
+ [{ status: 409, message: { includes: "Deletion protection is enabled" } }],
42
+ ) {}
43
+
44
+ /** The feature is not available to this organization or service: its plan does not include it, it is not enabled for the organization, or it is not set up. The message says which. */
45
+ export class FeatureUnavailable
46
+ extends /*@__PURE__*/ T.applyErrorMatchers(
47
+ /*@__PURE__*/ S.TaggedError<FeatureUnavailable>()("FeatureUnavailable", {
48
+ message: S.String,
49
+ body: /*@__PURE__*/ S.optional(S.Unknown),
50
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
51
+ }).pipe(C.withAuthError),
52
+ [
53
+ { status: 403, message: { includes: "pricing package" } },
54
+ { status: 403, message: { includes: "is not enabled for this organization" } },
55
+ { status: 403, message: { includes: "early access API endpoint" } },
56
+ ],
57
+ ) {}
58
+
59
+ /** The organization has as many services as its plan allows (`INSTANCE_LIMIT_REACHED`). Delete a service or raise the `services-per-organization` quota, then retry. */
60
+ export class InstanceLimitReached
61
+ extends /*@__PURE__*/ T.applyErrorMatchers(
62
+ /*@__PURE__*/ S.TaggedError<InstanceLimitReached>()("InstanceLimitReached", {
63
+ message: S.String,
64
+ body: /*@__PURE__*/ S.optional(S.Unknown),
65
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
66
+ }).pipe(C.withConflictError),
67
+ [{ status: 409, message: { includes: "INSTANCE_LIMIT_REACHED" } }],
68
+ ) {}
69
+
70
+ /** The service is not idle, so it cannot be awakened. Read its state and send start or stop instead. */
71
+ export class ServiceNotIdle
72
+ extends /*@__PURE__*/ T.applyErrorMatchers(
73
+ /*@__PURE__*/ S.TaggedError<ServiceNotIdle>()("ServiceNotIdle", {
74
+ message: S.String,
75
+ body: /*@__PURE__*/ S.optional(
76
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(136, __c17, 0)), S.String]),
77
+ ),
78
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
79
+ }).pipe(C.withBadRequestError),
80
+ [{ status: 400, message: { includes: "Service must be in idle state to awake" } }],
81
+ )
82
+ {
83
+ declare readonly body?: Error400Body | string;
84
+ }
85
+
86
+ /** The service is in a state that cannot be deleted (running or stopping). Stop it, wait for it to be stopped, and delete it again. */
87
+ export class ServiceNotTerminable
88
+ extends /*@__PURE__*/ T.applyErrorMatchers(
89
+ /*@__PURE__*/ S.TaggedError<ServiceNotTerminable>()("ServiceNotTerminable", {
90
+ message: S.String,
91
+ body: /*@__PURE__*/ S.optional(S.Unknown),
92
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
93
+ }).pipe(C.withConflictError),
94
+ [{ status: 409, message: { includes: "can be terminated" } }],
95
+ ) {}
96
+
97
+ /** Cloud provider */
98
+ export type CreateServiceRequestProvider = "aws" | "gcp" | "azure";
99
+ /** Service region. */
100
+ export type CreateServiceRequestRegion =
101
+ | "ap-northeast-1"
102
+ | "ap-northeast-2"
103
+ | "ap-south-1"
104
+ | "ap-southeast-1"
105
+ | "ap-southeast-2"
106
+ | "ca-central-1"
107
+ | "eu-central-1"
108
+ | "eu-west-1"
109
+ | "eu-west-2"
110
+ | "il-central-1"
111
+ | "us-east-1"
112
+ | "us-east-2"
113
+ | "us-west-2"
114
+ | "us-east1"
115
+ | "us-central1"
116
+ | "europe-west2"
117
+ | "europe-west4"
118
+ | "asia-southeast1"
119
+ | "asia-northeast1"
120
+ | "eastus"
121
+ | "eastus2"
122
+ | "westus3"
123
+ | "germanywestcentral"
124
+ | "centralus";
125
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. Azure services don't support Development tier */
126
+ export type CreateServiceRequestTier = "development" | "production";
127
+ export interface IpAccessListEntry {
128
+ /** IP or CIDR */
129
+ source?: string | undefined;
130
+ /** Optional description of IPv4 address or IPv4 CIDR to allow access from */
131
+ description?: string | undefined;
132
+ }
133
+ /** List of IP addresses allowed to access the service */
134
+ export type CreateServiceRequestIpAccessListList = Array<IpAccessListEntry>;
135
+ /** Autoscaling mode. "vertical" (the default when omitted) runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Horizontal requires the feature to be enabled for the organization. */
136
+ export type CreateServiceRequestAutoscalingMode = "vertical" | "horizontal";
137
+ /** The `encryption_config.json` stored alongside this backup in your bucket, passed through unchanged. Supply the file contents verbatim rather than constructing this object -- its shape is versioned and depends on your cloud provider. See [Export backups to your own cloud account](https://clickhouse.com/docs/cloud/manage/backups/export-backups-to-own-cloud-account) for what it contains. Accepted only for organizations enrolled in the private preview, and only when the backup is of a service that has transparent data encryption enabled. Such a restore always produces a service with transparent data encryption enabled, inherited from the source service. */
138
+ export type BackupEncryptionConfig = { [key: string]: unknown | undefined };
139
+ /** DEPRECATED. To associate the service with private endpoints, first create the service, then use the `Update Service Basic Details` endpoint with the `privateEndpointIds` field to modify private endpoints. */
140
+ export type CreateServiceRequestPrivateEndpointIdsList = Array<string>;
141
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
142
+ export type CreateServiceRequestReleaseChannel = "slow" | "default" | "fast";
143
+ /** Endpoint protocol */
144
+ export type ServiceEndpointChangeProtocol = "mysql";
145
+ export interface ServiceEndpointChange {
146
+ /** Endpoint protocol */
147
+ protocol?: ServiceEndpointChangeProtocol | (string & {}) | undefined;
148
+ /** Enable or disable the endpoint */
149
+ enabled?: boolean | undefined;
150
+ }
151
+ /** List of service endpoints to enable or disable */
152
+ export type CreateServiceRequestEndpointsList = Array<ServiceEndpointChange>;
153
+ /** Type of regulatory compliance for service. */
154
+ export type CreateServiceRequestComplianceType = "hipaa" | "pci";
155
+ export interface ResourceTagsV1 {
156
+ /** Tag key. Must be alphanumeric with dashes, underscores and dots. */
157
+ key: string;
158
+ /** Tag value. Must be alphanumeric with dashes, underscores and dots. */
159
+ value?: string | undefined;
160
+ }
161
+ /** Tags associated with the service. */
162
+ export type CreateServiceRequestTagsList = Array<ResourceTagsV1>;
163
+ export interface CreateServiceRequest {
164
+ /** ID of the organization that will own the service. */
165
+ organizationId: string;
166
+ /** Name of the service. Alphanumerical string with whitespaces up to 50 characters. */
167
+ name: string;
168
+ /** Cloud provider */
169
+ provider: CreateServiceRequestProvider | (string & {});
170
+ /** Service region. */
171
+ region: CreateServiceRequestRegion | (string & {});
172
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. Azure services don't support Development tier */
173
+ tier?: CreateServiceRequestTier | (string & {}) | undefined;
174
+ /** List of IP addresses allowed to access the service */
175
+ ipAccessList: CreateServiceRequestIpAccessListList;
176
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `minReplicaMemoryGb` instead. Minimum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and greater than or equal to 24. Always absent for horizontal-autoscaling services (replica count is variable). */
177
+ minTotalMemoryGb?: number | undefined;
178
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `maxReplicaMemoryGb` instead. Maximum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and lower than or equal to 360 for non paid services or 1068 for paid services. Always absent for horizontal-autoscaling services (replica count is variable). */
179
+ maxTotalMemoryGb?: number | undefined;
180
+ /** Autoscaling mode. "vertical" (the default when omitted) runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Horizontal requires the feature to be enabled for the organization. */
181
+ autoscalingMode?: CreateServiceRequestAutoscalingMode | (string & {}) | undefined;
182
+ /** Minimum total memory of each replica during auto-scaling in Gb. A range in vertical autoscaling; equal to maxReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). Must be a multiple of 4 and greater than or equal to 8. */
183
+ minReplicaMemoryGb?: number | undefined;
184
+ /** Maximum total memory of each replica during auto-scaling in Gb. A range in vertical autoscaling; equal to minReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). Must be a multiple of 4 and lower than or equal to 120* for non paid services or 356* for paid services.* - maximum replica size subject to cloud provider hardware availability in your selected region. */
185
+ maxReplicaMemoryGb?: number | undefined;
186
+ /** Fixed replica count for vertical autoscaling (autoscalingMode "vertical" or omitted). Mutually exclusive with minReplicas/maxReplicas. */
187
+ numReplicas?: number | undefined;
188
+ /** Minimum number of replicas. A minReplicas/maxReplicas band scales the replica count in horizontal autoscaling (autoscalingMode "horizontal"). Must be provided together with maxReplicas. Mutually exclusive with numReplicas. Requires horizontal autoscaling to be enabled for the organization, unless autoscalingMode is omitted or "vertical" and minReplicas equals maxReplicas (an equal band is then an accepted vertical fixed count and needs no horizontal entitlement). */
189
+ minReplicas?: number | undefined;
190
+ /** Maximum number of replicas. A minReplicas/maxReplicas band scales the replica count in horizontal autoscaling (autoscalingMode "horizontal"). Must be provided together with minReplicas. Mutually exclusive with numReplicas. Requires horizontal autoscaling to be enabled for the organization, unless autoscalingMode is omitted or "vertical" and minReplicas equals maxReplicas (an equal band is then an accepted vertical fixed count and needs no horizontal entitlement). */
191
+ maxReplicas?: number | undefined;
192
+ /** When set to true the service is allowed to scale down to zero when idle. True by default. */
193
+ idleScaling?: boolean | undefined;
194
+ /** Set minimum idling timeout (in minutes). Must be >= 5 minutes. */
195
+ idleTimeoutMinutes?: number | undefined;
196
+ /** True if this service is read-only. It can only be read-only if a dataWarehouseId is provided. */
197
+ isReadonly?: boolean | undefined;
198
+ /** Data warehouse containing this service */
199
+ dataWarehouseId?: string | undefined;
200
+ /** Optional backup ID used as an initial state for the new service. When used the region and the tier of the new instance must be the same as the values of the original instance. If the backup is stored in your organization's own bucket, `backupEncryptionConfig` is required; it must be omitted otherwise. */
201
+ backupId?: string | undefined;
202
+ backupEncryptionConfig?: BackupEncryptionConfig | undefined;
203
+ /** DEPRECATED. To associate the service with private endpoints, first create the service, then use the `Update Service Basic Details` endpoint with the `privateEndpointIds` field to modify private endpoints. */
204
+ privateEndpointIds?: CreateServiceRequestPrivateEndpointIdsList | undefined;
205
+ /** Accept the private preview terms and conditions. It is only needed when creating the first service in the organization in case of a private preview */
206
+ privatePreviewTermsChecked?: boolean | undefined;
207
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
208
+ releaseChannel?: CreateServiceRequestReleaseChannel | (string & {}) | undefined;
209
+ /** 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'. */
210
+ byocId?: string | undefined;
211
+ /** True if the service should have the Transparent Data Encryption (TDE) enabled. TDE is only available for ENTERPRISE organizations tiers and can only be enabled at service creation. */
212
+ hasTransparentDataEncryption?: boolean | undefined;
213
+ /** List of service endpoints to enable or disable */
214
+ endpoints?: CreateServiceRequestEndpointsList | undefined;
215
+ /** 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. */
216
+ profile?: string | undefined;
217
+ /** Type of regulatory compliance for service. */
218
+ complianceType?: CreateServiceRequestComplianceType | (string & {}) | undefined;
219
+ /** Tags associated with the service. */
220
+ tags?: CreateServiceRequestTagsList | undefined;
221
+ /** Enables the underlying infra for collecting core dumps. Default is enabled. */
222
+ enableCoreDumps?: boolean | undefined;
223
+ /** 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`. */
224
+ deletionProtection?: boolean | undefined;
225
+ }
226
+ /** Cloud provider */
227
+ export type ServiceProvider = "aws" | "gcp" | "azure";
228
+ /** Service region. */
229
+ export type ServiceRegion =
230
+ | "ap-northeast-1"
231
+ | "ap-northeast-2"
232
+ | "ap-south-1"
233
+ | "ap-southeast-1"
234
+ | "ap-southeast-2"
235
+ | "ca-central-1"
236
+ | "eu-central-1"
237
+ | "eu-west-1"
238
+ | "eu-west-2"
239
+ | "il-central-1"
240
+ | "us-east-1"
241
+ | "us-east-2"
242
+ | "us-west-2"
243
+ | "us-east1"
244
+ | "us-central1"
245
+ | "europe-west2"
246
+ | "europe-west4"
247
+ | "asia-southeast1"
248
+ | "asia-northeast1"
249
+ | "eastus"
250
+ | "eastus2"
251
+ | "westus3"
252
+ | "germanywestcentral"
253
+ | "centralus";
254
+ /** Current state of the service. */
255
+ export type ServiceState =
256
+ | "starting"
257
+ | "stopping"
258
+ | "terminating"
259
+ | "softdeleting"
260
+ | "awaking"
261
+ | "partially_running"
262
+ | "provisioning"
263
+ | "running"
264
+ | "stopped"
265
+ | "terminated"
266
+ | "softdeleted"
267
+ | "degraded"
268
+ | "failed"
269
+ | "idle";
270
+ /** Endpoint protocol: 'https', 'nativesecure', 'mysql'. */
271
+ export type ServiceEndpointProtocol = "https" | "nativesecure" | "mysql";
272
+ export interface ServiceEndpoint {
273
+ /** Endpoint protocol: 'https', 'nativesecure', 'mysql'. */
274
+ protocol?: ServiceEndpointProtocol | undefined;
275
+ /** Service host name */
276
+ host?: string | undefined;
277
+ /** Numeric port */
278
+ port?: number | undefined;
279
+ /** Optional username for the endpoint */
280
+ username?: string | null | undefined;
281
+ }
282
+ /** List of all service endpoints. */
283
+ export type ServiceEndpointsList = Array<ServiceEndpoint>;
284
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production', 'dedicated_high_mem', 'dedicated_high_cpu', 'dedicated_standard', 'dedicated_standard_n2d_standard_4', 'dedicated_standard_n2d_standard_8', 'dedicated_standard_n2d_standard_32', 'dedicated_standard_n2d_standard_128', 'dedicated_standard_n2d_standard_32_16SSD', 'dedicated_standard_n2d_standard_64_24SSD'. Production services scale, Development are fixed size. Azure services don't support Development tier */
285
+ export type ServiceTier =
286
+ | "development"
287
+ | "production"
288
+ | "dedicated_high_mem"
289
+ | "dedicated_high_cpu"
290
+ | "dedicated_standard"
291
+ | "dedicated_standard_n2d_standard_4"
292
+ | "dedicated_standard_n2d_standard_8"
293
+ | "dedicated_standard_n2d_standard_32"
294
+ | "dedicated_standard_n2d_standard_128"
295
+ | "dedicated_standard_n2d_standard_32_16SSD"
296
+ | "dedicated_standard_n2d_standard_64_24SSD";
297
+ /** Configured autoscaling mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory. This is the baseline configuration; the mode currently applied (which may differ while a schedule entry is active) is currentScaling.effectiveAutoscalingMode. */
298
+ export type ServiceAutoscalingMode = "vertical" | "horizontal";
299
+ /** List of IP addresses allowed to access the service */
300
+ export type ServiceIpAccessListList = Array<IpAccessListEntry>;
301
+ /** List of private endpoints */
302
+ export type ServicePrivateEndpointIdsList = Array<string>;
303
+ /** List of available private endpoints ids that can be attached to the service */
304
+ export type ServiceAvailablePrivateEndpointIdsList = Array<string>;
305
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
306
+ export type ServiceReleaseChannel = "slow" | "default" | "fast";
307
+ /** Type of regulatory compliance for service. */
308
+ export type ServiceComplianceType = "hipaa" | "pci";
309
+ /** Tags associated with the service. */
310
+ export type ServiceTagsList = Array<ResourceTagsV1>;
311
+ /** Days of the week this entry applies to. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
312
+ export type ScalingScheduleEntryWeekdaysList = Array<number>;
313
+ /** Autoscaling mode for this entry. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory. Defaults to "vertical" for entries persisted before the mode was exposed. */
314
+ export type ScalingScheduleEntryAutoscalingMode = "vertical" | "horizontal";
315
+ export interface ScalingScheduleEntry {
316
+ /** Unique identifier for this schedule entry. */
317
+ id: string;
318
+ /** Human-readable label for this schedule entry. */
319
+ name: string;
320
+ /** Days of the week this entry applies to. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
321
+ weekdays: ScalingScheduleEntryWeekdaysList;
322
+ /** UTC hour (0-23) when this entry becomes active (inclusive). */
323
+ startHourUtc: number;
324
+ /** UTC hour (1-24) when this entry deactivates (exclusive). Must differ from startHourUtc. Set to 24 to end at midnight. Values less than startHourUtc create an overnight window spanning midnight. */
325
+ endHourUtc: number;
326
+ /** Autoscaling mode for this entry. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory. Defaults to "vertical" for entries persisted before the mode was exposed. */
327
+ autoscalingMode: ScalingScheduleEntryAutoscalingMode;
328
+ /** Minimum memory per replica (Gb) during this window. A range in vertical; in horizontal it equals maxReplicaMemoryGb (memory is fixed while the replica count scales). */
329
+ minReplicaMemoryGb?: number | undefined;
330
+ /** Maximum memory per replica (Gb) during this window. A range in vertical; in horizontal it equals minReplicaMemoryGb (memory is fixed while the replica count scales). */
331
+ maxReplicaMemoryGb?: number | undefined;
332
+ /** Minimum number of replicas during this window. For a horizontal entry the replica count scales between minReplicas and maxReplicas; for a vertical entry minReplicas and maxReplicas are equal and report the fixed replica count (both omitted when the entry stored no count). */
333
+ minReplicas?: number | undefined;
334
+ /** Maximum number of replicas during this window. For a horizontal entry the replica count scales between minReplicas and maxReplicas; for a vertical entry minReplicas and maxReplicas are equal and report the fixed replica count (both omitted when the entry stored no count). */
335
+ maxReplicas?: number | undefined;
336
+ /** Whether idle scaling is enabled during this window. Never true on a Gen 2 (v2-default) service. */
337
+ idleScaling?: boolean | undefined;
338
+ /** Idle timeout in minutes during this window. */
339
+ idleTimeoutMinutes?: number | undefined;
340
+ /** Whether this entry is currently active. Scheduled times are indicative -- actions are applied on a best-effort basis and may be delayed by a few minutes. */
341
+ isActiveNow: boolean;
342
+ }
343
+ /** List of schedule entries. */
344
+ export type ScalingScheduleEntriesList = Array<ScalingScheduleEntry>;
345
+ /** Autoscaling mode applied when no schedule entry is active. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory. */
346
+ export type ScalingScheduleBaseConfigAutoscalingMode = "vertical" | "horizontal";
347
+ export interface ScalingScheduleBaseConfig {
348
+ /** Autoscaling mode applied when no schedule entry is active. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory. */
349
+ autoscalingMode?: ScalingScheduleBaseConfigAutoscalingMode | undefined;
350
+ /** Minimum memory per replica (Gb) when no schedule entry is active. Absent for services that do not autoscale memory. */
351
+ minReplicaMemoryGb?: number | undefined;
352
+ /** Maximum memory per replica (Gb) when no schedule entry is active. Absent for services that do not autoscale memory. */
353
+ maxReplicaMemoryGb?: number | undefined;
354
+ /** Minimum number of replicas when no schedule entry is active. */
355
+ minReplicas?: number | undefined;
356
+ /** Maximum number of replicas when no schedule entry is active. */
357
+ maxReplicas?: number | undefined;
358
+ /** Whether idle scaling is enabled when no schedule entry is active. */
359
+ idleScaling?: boolean | undefined;
360
+ /** Idle timeout in minutes when no schedule entry is active. */
361
+ idleTimeoutMinutes?: number | undefined;
362
+ }
363
+ export interface ScalingSchedule {
364
+ /** List of schedule entries. */
365
+ entries: ScalingScheduleEntriesList;
366
+ baseConfig: ScalingScheduleBaseConfig;
367
+ /** ID of the currently-active schedule entry. Absent when no entry is active and the base config is in effect. */
368
+ activeEntryId?: string | undefined;
369
+ }
370
+ /** Autoscaling mode currently in effect on the running service. May diverge from the configured baseline mode while a schedule entry is active. */
371
+ export type CurrentScalingEffectiveAutoscalingMode = "vertical" | "horizontal";
372
+ export interface CurrentScaling {
373
+ /** Autoscaling mode currently in effect on the running service. May diverge from the configured baseline mode while a schedule entry is active. */
374
+ effectiveAutoscalingMode?: CurrentScalingEffectiveAutoscalingMode | undefined;
375
+ /** Minimum memory per replica (Gb) currently applied to the running service. May diverge from the top-level `minReplicaMemoryGb` baseline while a schedule entry is active. */
376
+ effectiveMinReplicaMemoryGb?: number | undefined;
377
+ /** Maximum memory per replica (Gb) currently applied to the running service. May diverge from the top-level `maxReplicaMemoryGb` baseline while a schedule entry is active. Reflects the stored value: normally equal to `effectiveMinReplicaMemoryGb` in horizontal mode, but a legacy service stored with an unequal memory range reports the stored bounds as-is. */
378
+ effectiveMaxReplicaMemoryGb?: number | undefined;
379
+ /** Minimum number of replicas currently applied to the running service. May diverge from the baseline while a schedule entry is active. Reflects the stored value: normally equal to `effectiveMaxReplicas` in vertical mode (a fixed replica count), but a legacy service stored with an unequal replica range reports the stored bounds as-is. */
380
+ effectiveMinReplicas?: number | undefined;
381
+ /** Maximum number of replicas currently applied to the running service. May diverge from the baseline while a schedule entry is active. */
382
+ effectiveMaxReplicas?: number | undefined;
383
+ /** Whether idle scaling is currently in effect on the service. May diverge from the top-level `idleScaling` baseline while a schedule entry is active. */
384
+ effectiveIdleScaling?: boolean | undefined;
385
+ /** Idle timeout in minutes currently in effect on the service. May diverge from the top-level `idleTimeoutMinutes` baseline while a schedule entry is active. */
386
+ effectiveIdleTimeoutMinutes?: number | undefined;
387
+ /** ID of the schedule entry whose values are currently applied to the service. Absent when no entry is active. */
388
+ activeEntryId?: string | undefined;
389
+ }
390
+ export interface Service {
391
+ /** Unique service ID. */
392
+ id: string;
393
+ /** Name of the service. Alphanumerical string with whitespaces up to 50 characters. */
394
+ name?: string | undefined;
395
+ /** Cloud provider */
396
+ provider?: ServiceProvider | undefined;
397
+ /** Service region. */
398
+ region?: ServiceRegion | undefined;
399
+ /** Current state of the service. */
400
+ state?: ServiceState | undefined;
401
+ /** ClickHouse version of the service. */
402
+ clickhouseVersion?: string | undefined;
403
+ /** List of all service endpoints. */
404
+ endpoints?: ServiceEndpointsList | undefined;
405
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production', 'dedicated_high_mem', 'dedicated_high_cpu', 'dedicated_standard', 'dedicated_standard_n2d_standard_4', 'dedicated_standard_n2d_standard_8', 'dedicated_standard_n2d_standard_32', 'dedicated_standard_n2d_standard_128', 'dedicated_standard_n2d_standard_32_16SSD', 'dedicated_standard_n2d_standard_64_24SSD'. Production services scale, Development are fixed size. Azure services don't support Development tier */
406
+ tier?: ServiceTier | undefined;
407
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `minReplicaMemoryGb` instead. Minimum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and greater than or equal to 24. Always absent for horizontal-autoscaling services (replica count is variable). */
408
+ minTotalMemoryGb?: number | undefined;
409
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `maxReplicaMemoryGb` instead. Maximum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and lower than or equal to 360 for non paid services or 1068 for paid services. Always absent for horizontal-autoscaling services (replica count is variable). */
410
+ maxTotalMemoryGb?: number | undefined;
411
+ /** Minimum total memory of each replica during auto-scaling in Gb. A range in vertical autoscaling; equal to maxReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). Must be a multiple of 4 and greater than or equal to 8. */
412
+ minReplicaMemoryGb?: number | undefined;
413
+ /** Maximum total memory of each replica during auto-scaling in Gb. A range in vertical autoscaling; equal to minReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). Must be a multiple of 4 and lower than or equal to 120* for non paid services or 356* for paid services.* - maximum replica size subject to cloud provider hardware availability in your selected region. */
414
+ maxReplicaMemoryGb?: number | undefined;
415
+ /** Number of replicas for the service. The number of replicas must be between 1 and 50. Further restrictions may apply based on your organization's tier and its per-warehouse replica limit. It defaults to 1 for the BASIC tier and 3 for the SCALE and ENTERPRISE tiers. Present only when the service uses vertical autoscaling. For horizontal autoscaling, use minReplicas and maxReplicas instead. */
416
+ numReplicas?: number | undefined;
417
+ /** Minimum number of replicas for horizontal autoscaling. Present only when the service uses horizontal autoscaling. */
418
+ minReplicas?: number | undefined;
419
+ /** Maximum number of replicas for horizontal autoscaling. Present only when the service uses horizontal autoscaling. */
420
+ maxReplicas?: number | undefined;
421
+ /** Configured autoscaling mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory. This is the baseline configuration; the mode currently applied (which may differ while a schedule entry is active) is currentScaling.effectiveAutoscalingMode. */
422
+ autoscalingMode: ServiceAutoscalingMode;
423
+ /** Fixed memory per replica in Gb for horizontal autoscaling. Present only when the service uses horizontal autoscaling. Must be a multiple of 4, at least 8 Gb, and at most 120 Gb for non paid services or 356 Gb for paid services. */
424
+ replicaMemoryGb?: number | undefined;
425
+ /** When set to true the service is allowed to scale down to zero when idle. True by default. */
426
+ idleScaling?: boolean | undefined;
427
+ /** Set minimum idling timeout (in minutes). Must be >= 5 minutes. */
428
+ idleTimeoutMinutes?: number | undefined;
429
+ /** List of IP addresses allowed to access the service */
430
+ ipAccessList?: ServiceIpAccessListList | undefined;
431
+ /** Service creation timestamp. ISO-8601. */
432
+ createdAt?: string | undefined;
433
+ /** Optional customer provided disk encryption key */
434
+ encryptionKey?: string | Redacted.Redacted<string> | undefined;
435
+ /** Optional role to use for disk encryption */
436
+ encryptionAssumedRoleIdentifier?: string | undefined;
437
+ /** IAM role used for accessing objects in s3 */
438
+ iamRole?: string | undefined;
439
+ /** List of private endpoints */
440
+ privateEndpointIds?: ServicePrivateEndpointIdsList | undefined;
441
+ /** List of available private endpoints ids that can be attached to the service */
442
+ availablePrivateEndpointIds?: ServiceAvailablePrivateEndpointIdsList | undefined;
443
+ /** Data warehouse containing this service */
444
+ dataWarehouseId?: string | undefined;
445
+ /** True if this service is the primary service in the data warehouse */
446
+ isPrimary?: boolean | undefined;
447
+ /** True if this service is read-only. It can only be read-only if a dataWarehouseId is provided. */
448
+ isReadonly?: boolean | undefined;
449
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
450
+ releaseChannel?: ServiceReleaseChannel | undefined;
451
+ /** 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'. */
452
+ byocId?: string | undefined;
453
+ /** True if the service should have the Transparent Data Encryption (TDE) enabled. TDE is only available for ENTERPRISE organizations tiers and can only be enabled at service creation. */
454
+ hasTransparentDataEncryption?: boolean | undefined;
455
+ /** 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. */
456
+ profile?: string | undefined;
457
+ /** The ID of the Transparent Data Encryption key used for the service. This is only available if hasTransparentDataEncryption is true. */
458
+ transparentDataEncryptionKeyId?: string | undefined;
459
+ /** The ID of the IAM role used for encryption. This is only available if hasTransparentDataEncryption is true. */
460
+ encryptionRoleId?: string | undefined;
461
+ /** Type of regulatory compliance for service. */
462
+ complianceType?: ServiceComplianceType | undefined;
463
+ /** Tags associated with the service. */
464
+ tags?: ServiceTagsList | undefined;
465
+ /** True if the service's underline infra is enabled for collecting core dumps. This is an experimental feature */
466
+ enableCoreDumps?: boolean | undefined;
467
+ /** When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off. */
468
+ deletionProtection?: boolean | undefined;
469
+ scalingSchedule?: ScalingSchedule | undefined;
470
+ currentScaling: CurrentScaling;
471
+ }
472
+ export interface ServicePostResponse {
473
+ service: Service;
474
+ /** Password for the newly created service. */
475
+ password?: string | Redacted.Redacted<string> | undefined;
476
+ }
477
+ export interface CreateServicePrivateEndpointRequest {
478
+ /** ID of the requested organization. */
479
+ organizationId: string;
480
+ /** ID of the requested service. */
481
+ serviceId: string;
482
+ /** Private endpoint identifier */
483
+ id: string;
484
+ /** Description of private endpoint */
485
+ description?: string | undefined;
486
+ }
487
+ /** Cloud provider in which the private endpoint is lcoated */
488
+ export type InstancePrivateEndpointCloudProvider = "gcp" | "aws" | "azure";
489
+ /** Region in which the private endpoint is located */
490
+ export type InstancePrivateEndpointRegion =
491
+ | "ap-northeast-1"
492
+ | "ap-northeast-2"
493
+ | "ap-south-1"
494
+ | "ap-southeast-1"
495
+ | "ap-southeast-2"
496
+ | "ca-central-1"
497
+ | "eu-central-1"
498
+ | "eu-west-1"
499
+ | "eu-west-2"
500
+ | "il-central-1"
501
+ | "us-east-1"
502
+ | "us-east-2"
503
+ | "us-west-2"
504
+ | "us-east1"
505
+ | "us-central1"
506
+ | "europe-west2"
507
+ | "europe-west4"
508
+ | "asia-southeast1"
509
+ | "asia-northeast1"
510
+ | "eastus"
511
+ | "eastus2"
512
+ | "westus3"
513
+ | "germanywestcentral"
514
+ | "centralus";
515
+ export interface InstancePrivateEndpoint {
516
+ /** Private endpoint identifier */
517
+ id?: string | undefined;
518
+ /** Description of private endpoint */
519
+ description?: string | undefined;
520
+ /** Cloud provider in which the private endpoint is lcoated */
521
+ cloudProvider?: InstancePrivateEndpointCloudProvider | undefined;
522
+ /** Region in which the private endpoint is located */
523
+ region?: InstancePrivateEndpointRegion | undefined;
524
+ }
525
+ export interface DeleteScalingScheduleRequest {
526
+ /** ID of the organization that owns the service. */
527
+ organizationId: string;
528
+ /** ID of the service. */
529
+ serviceId: string;
530
+ }
531
+ export interface DeleteScalingScheduleResponse {
532
+ /** HTTP status code. */
533
+ status?: number | undefined;
534
+ /** Unique id assigned to every request. UUIDv4 */
535
+ requestId?: string | undefined;
536
+ }
537
+ export interface DeleteServiceRequest {
538
+ /** ID of the organization that owns the service. */
539
+ organizationId: string;
540
+ /** ID of the service to delete. */
541
+ serviceId: string;
542
+ }
543
+ export interface DeleteServiceResponse {
544
+ /** HTTP status code. */
545
+ status?: number | undefined;
546
+ /** Unique id assigned to every request. UUIDv4 */
547
+ requestId?: string | undefined;
548
+ }
549
+ export interface DeleteServiceQueryEndpointRequest {
550
+ /** ID of the requested organization. */
551
+ organizationId: string;
552
+ /** ID of the requested service. */
553
+ serviceId: string;
554
+ }
555
+ export interface DeleteServiceQueryEndpointResponse {
556
+ /** HTTP status code. */
557
+ status?: number | undefined;
558
+ /** Unique id assigned to every request. UUIDv4 */
559
+ requestId?: string | undefined;
560
+ }
561
+ export interface DeleteUpgradeWindowRequest {
562
+ /** ID of the organization that owns the service. */
563
+ organizationId: string;
564
+ /** ID of the service. */
565
+ serviceId: string;
566
+ }
567
+ export interface DeleteUpgradeWindowResponse {
568
+ /** HTTP status code. */
569
+ status?: number | undefined;
570
+ /** Unique id assigned to every request. UUIDv4 */
571
+ requestId?: string | undefined;
572
+ }
573
+ export interface GetScalingScheduleRequest {
574
+ /** ID of the organization that owns the service. */
575
+ organizationId: string;
576
+ /** ID of the service. */
577
+ serviceId: string;
578
+ }
579
+ export interface GetServiceRequest {
580
+ /** ID of the organization that owns the service. */
581
+ organizationId: string;
582
+ /** ID of the requested service. */
583
+ serviceId: string;
584
+ }
585
+ export interface GetServicePrivateEndpointConfigRequest {
586
+ /** ID of the requested organization. */
587
+ organizationId: string;
588
+ /** ID of the requested service. */
589
+ serviceId: string;
590
+ }
591
+ export interface PrivateEndpointConfig {
592
+ /** Unique identifier of the interface endpoint you created in your VPC with the AWS(Service Name), GCP(Target Service) or AZURE (Private Link Service) resource */
593
+ endpointServiceId?: string | undefined;
594
+ /** Private DNS Hostname of the VPC you created */
595
+ privateDnsHostname?: string | undefined;
596
+ }
597
+ export interface GetServiceQueryEndpointRequest {
598
+ /** ID of the requested organization. */
599
+ organizationId: string;
600
+ /** ID of the requested service. */
601
+ serviceId: string;
602
+ }
603
+ /** List of OpenAPI keys that can access the service query endpoint */
604
+ export type ServiceQueryAPIEndpointOpenApiKeysList = Array<string>;
605
+ export type ServiceQueryAPIEndpointRolesItem = "sql_console_read_only" | "sql_console_admin";
606
+ /** List of roles that can access the service query endpoint */
607
+ export type ServiceQueryAPIEndpointRolesList = Array<ServiceQueryAPIEndpointRolesItem>;
608
+ export interface ServiceQueryAPIEndpoint {
609
+ /** The id of the service query endpoint */
610
+ id?: string | undefined;
611
+ /** List of OpenAPI keys that can access the service query endpoint */
612
+ openApiKeys?: ServiceQueryAPIEndpointOpenApiKeysList | undefined;
613
+ /** List of roles that can access the service query endpoint */
614
+ roles?: ServiceQueryAPIEndpointRolesList | undefined;
615
+ /** The allowed origins as comma separated list of domains */
616
+ allowedOrigins?: string | undefined;
617
+ }
618
+ export interface GetUpgradeWindowRequest {
619
+ /** ID of the organization that owns the service. */
620
+ organizationId: string;
621
+ /** ID of the service. */
622
+ serviceId: string;
623
+ }
624
+ /** UTC hour when the upgrade window starts. Must be one of 0, 6, 12, or 18. */
625
+ export type UpgradeWindowStartHourUtc = 0 | 6 | 12 | 18;
626
+ /** Length of the upgrade window in hours. Currently only a 6-hour window is supported. */
627
+ export type UpgradeWindowDuration = 6;
628
+ export interface UpgradeWindow {
629
+ /** Day of the week the upgrade window starts. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
630
+ weekday: number;
631
+ /** UTC hour when the upgrade window starts. Must be one of 0, 6, 12, or 18. */
632
+ startHourUtc: UpgradeWindowStartHourUtc;
633
+ /** Length of the upgrade window in hours. Currently only a 6-hour window is supported. */
634
+ duration: UpgradeWindowDuration;
635
+ }
636
+ export interface ListServiceProfilesRequest {
637
+ /** ID of the organization to list available profiles for. */
638
+ organizationId: string;
639
+ /** Region to list profiles for, e.g. us-east-1. Required unless byoc_id is set; when both are set it must match the BYOC infrastructure's region. */
640
+ region_id?: string | undefined;
641
+ /** ID of the BYOC infrastructure to list profiles for. BYOC profiles are only returned when this is set. */
642
+ byoc_id?: string | undefined;
643
+ }
644
+ export interface ServiceProfile {
645
+ /** Profile name to pass as `profile` when creating a service (e.g. 'v1-standard-byoc-4'). */
646
+ profile?: string | undefined;
647
+ /** Number of vCPUs per replica. 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. */
648
+ cpuCores?: number | undefined;
649
+ /** 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. */
650
+ memoryGi?: number | undefined;
651
+ }
652
+ export type ListServiceProfilesResponseBodyList = Array<ServiceProfile>;
653
+ export type ListServiceProfilesResponse = ListServiceProfilesResponseBodyList;
654
+ export type ListServicesRequestFilterList = Array<string>;
655
+ export interface ListServicesRequest {
656
+ /** ID of the requested organization. */
657
+ organizationId: string;
658
+ /** Filter criteria to apply when retrieving the resource. Currently, only filtering by resource tags is supported. */
659
+ filter?: ListServicesRequestFilterList | undefined;
660
+ }
661
+ export type ListServicesResponseBodyList = Array<Service>;
662
+ export type ListServicesResponse = ListServicesResponseBodyList;
663
+ /** Elements to add. Executed after "remove" part is processed. */
664
+ export type IpAccessListPatchAddList = Array<IpAccessListEntry>;
665
+ /** Elements to remove. Executed before "add" part is processed. */
666
+ export type IpAccessListPatchRemoveList = Array<IpAccessListEntry>;
667
+ export interface IpAccessListPatch {
668
+ /** Elements to add. Executed after "remove" part is processed. */
669
+ add?: IpAccessListPatchAddList | undefined;
670
+ /** Elements to remove. Executed before "add" part is processed. */
671
+ remove?: IpAccessListPatchRemoveList | undefined;
672
+ }
673
+ /** Elements to add. Executed after "remove" part is processed. */
674
+ export type InstancePrivateEndpointsPatchAddList = Array<string>;
675
+ /** Elements to remove. Executed before "add" part is processed. */
676
+ export type InstancePrivateEndpointsPatchRemoveList = Array<string>;
677
+ export interface InstancePrivateEndpointsPatch {
678
+ /** Elements to add. Executed after "remove" part is processed. */
679
+ add?: InstancePrivateEndpointsPatchAddList | undefined;
680
+ /** Elements to remove. Executed before "add" part is processed. */
681
+ remove?: InstancePrivateEndpointsPatchRemoveList | undefined;
682
+ }
683
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. All services in a warehouse share one release channel, so changing it on one service changes it for all of them. Changing it through a secondary service also requires the `control-plane:service:manage` permission on the warehouse's primary service. */
684
+ export type UpdateServiceRequestReleaseChannel = "slow" | "default" | "fast";
685
+ /** List of service endpoints to change */
686
+ export type UpdateServiceRequestEndpointsList = Array<ServiceEndpointChange>;
687
+ /** Elements to add. Executed after "remove" part is processed. */
688
+ export type InstanceTagsPatchAddList = Array<ResourceTagsV1>;
689
+ /** Elements to remove. Executed before "add" part is processed. */
690
+ export type InstanceTagsPatchRemoveList = Array<ResourceTagsV1>;
691
+ export interface InstanceTagsPatch {
692
+ /** Elements to add. Executed after "remove" part is processed. */
693
+ add?: InstanceTagsPatchAddList | undefined;
694
+ /** Elements to remove. Executed before "add" part is processed. */
695
+ remove?: InstanceTagsPatchRemoveList | undefined;
696
+ }
697
+ export interface UpdateServiceRequest {
698
+ /** ID of the organization that owns the service. */
699
+ organizationId: string;
700
+ /** ID of the service to update. */
701
+ serviceId: string;
702
+ /** Name of the service. Alphanumerical string with whitespaces up to 50 characters. */
703
+ name?: string | undefined;
704
+ ipAccessList?: IpAccessListPatch | undefined;
705
+ privateEndpointIds?: InstancePrivateEndpointsPatch | undefined;
706
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. All services in a warehouse share one release channel, so changing it on one service changes it for all of them. Changing it through a secondary service also requires the `control-plane:service:manage` permission on the warehouse's primary service. */
707
+ releaseChannel?: UpdateServiceRequestReleaseChannel | (string & {}) | undefined;
708
+ /** List of service endpoints to change */
709
+ endpoints?: UpdateServiceRequestEndpointsList | undefined;
710
+ /** The id of the key to rotate */
711
+ transparentDataEncryptionKeyId?: string | undefined;
712
+ tags?: InstanceTagsPatch | undefined;
713
+ /** If true, the underlying infra is enabled for collecting core dumps. */
714
+ enableCoreDumps?: boolean | undefined;
715
+ /** 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. */
716
+ deletionProtection?: boolean | undefined;
717
+ }
718
+ export interface UpdateServicePasswordRequest {
719
+ /** ID of the organization that owns the service. */
720
+ organizationId: string;
721
+ /** ID of the service to update password. */
722
+ serviceId: string;
723
+ /** Optional password hash. Used to avoid password transmission over network. If not provided a new password is generated and is provided in the response. Otherwise this hash is used. Algorithm: echo -n "yourpassword" | sha256sum | tr -d '-' | xxd -r -p | base64 */
724
+ newPasswordHash?: string | Redacted.Redacted<string> | undefined;
725
+ /** Optional double SHA1 password hash for MySQL protocol. If newPasswordHash is not provided this key will be ignored and the generated password will be used. Algorithm: echo -n "yourpassword" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-' */
726
+ newDoubleSha1Hash?: string | Redacted.Redacted<string> | undefined;
727
+ }
728
+ export interface ServicePasswordPatchResponse {
729
+ /** New service password. Provided only if there was no 'newPasswordHash' in the request */
730
+ password?: string | Redacted.Redacted<string> | undefined;
731
+ }
732
+ /** Target autoscaling mode. Omit to keep the service on its current mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Switching to horizontal requires the feature to be enabled for the organization. */
733
+ export type UpdateServiceReplicaScalingRequestAutoscalingMode = "vertical" | "horizontal";
734
+ export interface UpdateServiceReplicaScalingRequest {
735
+ /** ID of the organization that owns the service. */
736
+ organizationId: string;
737
+ /** ID of the service to update scaling parameters. */
738
+ serviceId: string;
739
+ /** Minimum auto-scaling memory in Gb for a single replica. Available only for 'production' services. Must be a multiple of 4 and greater than or equal to 8. A range in vertical autoscaling; equal to maxReplicaMemoryGb in horizontal. */
740
+ minReplicaMemoryGb?: number | undefined;
741
+ /** Maximum auto-scaling memory in Gb for a single replica. Available only for 'production' services. Must be a multiple of 4 and lower than or equal to 120 for non paid services or 356 for paid services. A range in vertical autoscaling; equal to minReplicaMemoryGb in horizontal. */
742
+ maxReplicaMemoryGb?: number | undefined;
743
+ /** Target autoscaling mode. Omit to keep the service on its current mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Switching to horizontal requires the feature to be enabled for the organization. */
744
+ autoscalingMode?: UpdateServiceReplicaScalingRequestAutoscalingMode | (string & {}) | undefined;
745
+ /** Fixed replica count for vertical autoscaling (autoscalingMode "vertical"). Mutually exclusive with minReplicas/maxReplicas. When switching to vertical (autoscalingMode "vertical") with numReplicas and no memory, the service's stored baseline per-replica memory is kept as the new vertical range. */
746
+ numReplicas?: number | undefined;
747
+ /** Minimum number of replicas. A minReplicas/maxReplicas band scales the replica count in horizontal autoscaling (autoscalingMode "horizontal"). Must be provided together with maxReplicas. Mutually exclusive with numReplicas. Requires horizontal autoscaling to be enabled for the service, unless autoscalingMode is omitted or "vertical" and minReplicas equals maxReplicas (an equal band is then an accepted vertical fixed count and needs no horizontal entitlement). */
748
+ minReplicas?: number | undefined;
749
+ /** Maximum number of replicas. A minReplicas/maxReplicas band scales the replica count in horizontal autoscaling (autoscalingMode "horizontal"). Must be provided together with minReplicas. Mutually exclusive with numReplicas. Requires horizontal autoscaling to be enabled for the service, unless autoscalingMode is omitted or "vertical" and minReplicas equals maxReplicas (an equal band is then an accepted vertical fixed count and needs no horizontal entitlement). */
750
+ maxReplicas?: number | undefined;
751
+ /** When set to true the service is allowed to scale down to zero when idle. True by default. */
752
+ idleScaling?: boolean | undefined;
753
+ /** Set minimum idling timeout (in minutes). Must be >= 5 minutes. */
754
+ idleTimeoutMinutes?: number | undefined;
755
+ /** 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. */
756
+ profile?: string | undefined;
757
+ }
758
+ /** Cloud provider */
759
+ export type ServiceScalingPatchResponseProvider = "aws" | "gcp" | "azure";
760
+ /** Service region. */
761
+ export type ServiceScalingPatchResponseRegion =
762
+ | "ap-northeast-1"
763
+ | "ap-northeast-2"
764
+ | "ap-south-1"
765
+ | "ap-southeast-1"
766
+ | "ap-southeast-2"
767
+ | "ca-central-1"
768
+ | "eu-central-1"
769
+ | "eu-west-1"
770
+ | "eu-west-2"
771
+ | "il-central-1"
772
+ | "us-east-1"
773
+ | "us-east-2"
774
+ | "us-west-2"
775
+ | "us-east1"
776
+ | "us-central1"
777
+ | "europe-west2"
778
+ | "europe-west4"
779
+ | "asia-southeast1"
780
+ | "asia-northeast1"
781
+ | "eastus"
782
+ | "eastus2"
783
+ | "westus3"
784
+ | "germanywestcentral"
785
+ | "centralus";
786
+ /** Current state of the service. */
787
+ export type ServiceScalingPatchResponseState =
788
+ | "starting"
789
+ | "stopping"
790
+ | "terminating"
791
+ | "softdeleting"
792
+ | "awaking"
793
+ | "partially_running"
794
+ | "provisioning"
795
+ | "running"
796
+ | "stopped"
797
+ | "terminated"
798
+ | "softdeleted"
799
+ | "degraded"
800
+ | "failed"
801
+ | "idle";
802
+ /** List of all service endpoints. */
803
+ export type ServiceScalingPatchResponseEndpointsList = Array<ServiceEndpoint>;
804
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production', 'dedicated_high_mem', 'dedicated_high_cpu', 'dedicated_standard', 'dedicated_standard_n2d_standard_4', 'dedicated_standard_n2d_standard_8', 'dedicated_standard_n2d_standard_32', 'dedicated_standard_n2d_standard_128', 'dedicated_standard_n2d_standard_32_16SSD', 'dedicated_standard_n2d_standard_64_24SSD'. Production services scale, Development are fixed size. Azure services don't support Development tier */
805
+ export type ServiceScalingPatchResponseTier =
806
+ | "development"
807
+ | "production"
808
+ | "dedicated_high_mem"
809
+ | "dedicated_high_cpu"
810
+ | "dedicated_standard"
811
+ | "dedicated_standard_n2d_standard_4"
812
+ | "dedicated_standard_n2d_standard_8"
813
+ | "dedicated_standard_n2d_standard_32"
814
+ | "dedicated_standard_n2d_standard_128"
815
+ | "dedicated_standard_n2d_standard_32_16SSD"
816
+ | "dedicated_standard_n2d_standard_64_24SSD";
817
+ /** Configured autoscaling mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory. This is the baseline configuration; the mode currently applied (which may differ while a schedule entry is active) is currentScaling.effectiveAutoscalingMode. */
818
+ export type ServiceScalingPatchResponseAutoscalingMode = "vertical" | "horizontal";
819
+ /** List of IP addresses allowed to access the service */
820
+ export type ServiceScalingPatchResponseIpAccessListList = Array<IpAccessListEntry>;
821
+ /** List of private endpoints */
822
+ export type ServiceScalingPatchResponsePrivateEndpointIdsList = Array<string>;
823
+ /** List of available private endpoints ids that can be attached to the service */
824
+ export type ServiceScalingPatchResponseAvailablePrivateEndpointIdsList = Array<string>;
825
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
826
+ export type ServiceScalingPatchResponseReleaseChannel = "slow" | "default" | "fast";
827
+ /** Type of regulatory compliance for service. */
828
+ export type ServiceScalingPatchResponseComplianceType = "hipaa" | "pci";
829
+ /** Tags associated with the service. */
830
+ export type ServiceScalingPatchResponseTagsList = Array<ResourceTagsV1>;
831
+ export interface ServiceScalingPatchResponse {
832
+ /** Unique service ID. */
833
+ id?: string | undefined;
834
+ /** Name of the service. Alphanumerical string with whitespaces up to 50 characters. */
835
+ name?: string | undefined;
836
+ /** Cloud provider */
837
+ provider?: ServiceScalingPatchResponseProvider | undefined;
838
+ /** Service region. */
839
+ region?: ServiceScalingPatchResponseRegion | undefined;
840
+ /** Current state of the service. */
841
+ state?: ServiceScalingPatchResponseState | undefined;
842
+ /** ClickHouse version of the service. */
843
+ clickhouseVersion?: string | undefined;
844
+ /** List of all service endpoints. */
845
+ endpoints?: ServiceScalingPatchResponseEndpointsList | undefined;
846
+ /** DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas` instead. Tier of the service: 'development', 'production', 'dedicated_high_mem', 'dedicated_high_cpu', 'dedicated_standard', 'dedicated_standard_n2d_standard_4', 'dedicated_standard_n2d_standard_8', 'dedicated_standard_n2d_standard_32', 'dedicated_standard_n2d_standard_128', 'dedicated_standard_n2d_standard_32_16SSD', 'dedicated_standard_n2d_standard_64_24SSD'. Production services scale, Development are fixed size. Azure services don't support Development tier */
847
+ tier?: ServiceScalingPatchResponseTier | undefined;
848
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `minReplicaMemoryGb` instead. Minimum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and greater than or equal to 24. Always absent for horizontal-autoscaling services (replica count is variable). */
849
+ minTotalMemoryGb?: number | undefined;
850
+ /** DEPRECATED - inaccurate for services with non-default numbers of replicas. Use `maxReplicaMemoryGb` instead. Maximum memory of three workers during auto-scaling in Gb. Available only for 'production' services. Must be a multiple of 12 and lower than or equal to 360 for non paid services or 1068 for paid services. Always absent for horizontal-autoscaling services (replica count is variable). */
851
+ maxTotalMemoryGb?: number | undefined;
852
+ /** Minimum auto-scaling memory in Gb for a single replica. Available only for 'production' services. Must be a multiple of 4 and greater than or equal to 8. A range in vertical autoscaling; equal to maxReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). */
853
+ minReplicaMemoryGb?: number | undefined;
854
+ /** Maximum auto-scaling memory in Gb for a single replica. Available only for 'production' services. Must be a multiple of 4 and lower than or equal to 120 for non paid services or 356 for paid services. A range in vertical autoscaling; equal to minReplicaMemoryGb in horizontal (memory is fixed while the replica count scales). */
855
+ maxReplicaMemoryGb?: number | undefined;
856
+ /** Number of replicas for the service. The number of replicas must be between 1 and 50. Further restrictions may apply based on your organization's tier and its per-warehouse replica limit. It defaults to 1 for the BASIC tier and 3 for the SCALE and ENTERPRISE tiers. Present only when the service uses vertical autoscaling. For horizontal autoscaling, use minReplicas and maxReplicas instead. */
857
+ numReplicas?: number | undefined;
858
+ /** Minimum number of replicas for horizontal autoscaling. Present only when the service uses horizontal autoscaling. */
859
+ minReplicas?: number | undefined;
860
+ /** Maximum number of replicas for horizontal autoscaling. Present only when the service uses horizontal autoscaling. */
861
+ maxReplicas?: number | undefined;
862
+ /** Configured autoscaling mode. "vertical" runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory. This is the baseline configuration; the mode currently applied (which may differ while a schedule entry is active) is currentScaling.effectiveAutoscalingMode. */
863
+ autoscalingMode: ServiceScalingPatchResponseAutoscalingMode;
864
+ /** Fixed memory per replica in Gb for horizontal autoscaling. Present only when the service uses horizontal autoscaling. Must be a multiple of 4, at least 8 Gb, and at most 120 Gb for non paid services or 356 Gb for paid services. */
865
+ replicaMemoryGb?: number | undefined;
866
+ /** When set to true the service is allowed to scale down to zero when idle. True by default. */
867
+ idleScaling?: boolean | undefined;
868
+ /** Set minimum idling timeout (in minutes). Must be >= 5 minutes. */
869
+ idleTimeoutMinutes?: number | undefined;
870
+ /** List of IP addresses allowed to access the service */
871
+ ipAccessList?: ServiceScalingPatchResponseIpAccessListList | undefined;
872
+ /** Service creation timestamp. ISO-8601. */
873
+ createdAt?: string | undefined;
874
+ /** Optional customer provided disk encryption key */
875
+ encryptionKey?: string | Redacted.Redacted<string> | undefined;
876
+ /** Optional role to use for disk encryption */
877
+ encryptionAssumedRoleIdentifier?: string | undefined;
878
+ /** IAM role used for accessing objects in s3 */
879
+ iamRole?: string | undefined;
880
+ /** List of private endpoints */
881
+ privateEndpointIds?: ServiceScalingPatchResponsePrivateEndpointIdsList | undefined;
882
+ /** List of available private endpoints ids that can be attached to the service */
883
+ availablePrivateEndpointIds?:
884
+ | ServiceScalingPatchResponseAvailablePrivateEndpointIdsList
885
+ | undefined;
886
+ /** Data warehouse containing this service */
887
+ dataWarehouseId?: string | undefined;
888
+ /** True if this service is the primary service in the data warehouse */
889
+ isPrimary?: boolean | undefined;
890
+ /** True if this service is read-only. It can only be read-only if a dataWarehouseId is provided. */
891
+ isReadonly?: boolean | undefined;
892
+ /** Select fast if you want to get new ClickHouse releases as soon as they are available. You'll get new features faster, but with a higher risk of bugs. Select slow if you would like to defer releases to give yourself more time to test. This feature is only available for production services. default is the regular release channel. */
893
+ releaseChannel?: ServiceScalingPatchResponseReleaseChannel | undefined;
894
+ /** 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'. */
895
+ byocId?: string | undefined;
896
+ /** True if the service should have the Transparent Data Encryption (TDE) enabled. TDE is only available for ENTERPRISE organizations tiers and can only be enabled at service creation. */
897
+ hasTransparentDataEncryption?: boolean | undefined;
898
+ /** 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. */
899
+ profile?: string | undefined;
900
+ /** The ID of the Transparent Data Encryption key used for the service. This is only available if hasTransparentDataEncryption is true. */
901
+ transparentDataEncryptionKeyId?: string | undefined;
902
+ /** The ID of the IAM role used for encryption. This is only available if hasTransparentDataEncryption is true. */
903
+ encryptionRoleId?: string | undefined;
904
+ /** Type of regulatory compliance for service. */
905
+ complianceType?: ServiceScalingPatchResponseComplianceType | undefined;
906
+ /** Tags associated with the service. */
907
+ tags?: ServiceScalingPatchResponseTagsList | undefined;
908
+ /** True if the service's underline infra is enabled for collecting core dumps. This is an experimental feature */
909
+ enableCoreDumps?: boolean | undefined;
910
+ /** When true, the service cannot be deleted: the delete endpoint returns 409 until deletion protection is turned off. */
911
+ deletionProtection?: boolean | undefined;
912
+ scalingSchedule?: ScalingSchedule | undefined;
913
+ currentScaling: CurrentScaling;
914
+ }
915
+ /** Command to change the state: 'start', 'stop', 'awake'. */
916
+ export type UpdateServiceStateRequestCommand = "start" | "stop" | "awake";
917
+ export interface UpdateServiceStateRequest {
918
+ /** ID of the organization that owns the service. */
919
+ organizationId: string;
920
+ /** ID of the service to update state. */
921
+ serviceId: string;
922
+ /** Command to change the state: 'start', 'stop', 'awake'. */
923
+ command: UpdateServiceStateRequestCommand | (string & {});
924
+ }
925
+ /** UTC hour when the upgrade window starts. Must be one of 0, 6, 12, or 18. The upgrade window currently lasts 6 hours from this start time. */
926
+ export type UpdateUpgradeWindowRequestStartHourUtc = 0 | 6 | 12 | 18;
927
+ export interface UpdateUpgradeWindowRequest {
928
+ /** ID of the organization that owns the service. */
929
+ organizationId: string;
930
+ /** ID of the service. */
931
+ serviceId: string;
932
+ /** Day of the week the upgrade window starts. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
933
+ weekday: number;
934
+ /** UTC hour when the upgrade window starts. Must be one of 0, 6, 12, or 18. The upgrade window currently lasts 6 hours from this start time. */
935
+ startHourUtc: UpdateUpgradeWindowRequestStartHourUtc | (number & {});
936
+ }
937
+ /** Days of the week this entry applies to. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
938
+ export type ScalingScheduleEntryRequestWeekdaysList = Array<number>;
939
+ /** Autoscaling mode for this entry. "vertical" (the default when omitted) runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Horizontal requires the feature to be enabled for the organization. */
940
+ export type ScalingScheduleEntryRequestAutoscalingMode = "vertical" | "horizontal";
941
+ export interface ScalingScheduleEntryRequest {
942
+ /** Human-readable label for this schedule entry. */
943
+ name: string;
944
+ /** Days of the week this entry applies to. 0 = Sunday, 1 = Monday, ..., 6 = Saturday. */
945
+ weekdays: ScalingScheduleEntryRequestWeekdaysList;
946
+ /** UTC hour (0-23) when this entry becomes active (inclusive). */
947
+ startHourUtc: number;
948
+ /** UTC hour (1-24) when this entry deactivates (exclusive). Must differ from startHourUtc. Set to 24 to end at midnight. Values less than startHourUtc create an overnight window spanning midnight. */
949
+ endHourUtc: number;
950
+ /** Autoscaling mode for this entry. "vertical" (the default when omitted) runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Horizontal requires the feature to be enabled for the organization. */
951
+ autoscalingMode?: ScalingScheduleEntryRequestAutoscalingMode | (string & {}) | undefined;
952
+ /** Minimum memory per replica (Gb). Optional for vertical entries -- provide both bounds for a memory range, or omit both to inherit memory from the base scaling config. Required for horizontal (both bounds, equal to maxReplicaMemoryGb -- memory is fixed while the replica count scales). The upper bound is tier-dependent (lower for non-paid organizations) and enforced when the entry is applied. */
953
+ minReplicaMemoryGb?: number | undefined;
954
+ /** Maximum memory per replica (Gb). Optional for vertical entries -- provide both bounds for a memory range, or omit both to inherit memory from the base scaling config. Required for horizontal (both bounds, equal to minReplicaMemoryGb -- memory is fixed while the replica count scales). The upper bound is tier-dependent (lower for non-paid organizations) and enforced when the entry is applied. */
955
+ maxReplicaMemoryGb?: number | undefined;
956
+ /** Fixed replica count for a vertical entry (autoscalingMode "vertical" or omitted). Mutually exclusive with minReplicas/maxReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time. */
957
+ numReplicas?: number | undefined;
958
+ /** Minimum number of replicas. A minReplicas/maxReplicas band scales the replica count in a horizontal entry (autoscalingMode "horizontal"); when autoscalingMode is omitted or "vertical", an equal band (minReplicas === maxReplicas) is instead an accepted vertical fixed count and needs no horizontal entitlement. Must be provided together with maxReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time. */
959
+ minReplicas?: number | undefined;
960
+ /** Maximum number of replicas. A minReplicas/maxReplicas band scales the replica count in a horizontal entry (autoscalingMode "horizontal"); when autoscalingMode is omitted or "vertical", an equal band (minReplicas === maxReplicas) is instead an accepted vertical fixed count and needs no horizontal entitlement. Must be provided together with minReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time. */
961
+ maxReplicas?: number | undefined;
962
+ /** Whether idle scaling is enabled during this window. Cannot be true on a Gen 2 (v2-default) service. */
963
+ idleScaling?: boolean | undefined;
964
+ /** Idle timeout in minutes during this window. */
965
+ idleTimeoutMinutes?: number | undefined;
966
+ }
967
+ /** List of schedule entries. Pass an empty array to clear the schedule. */
968
+ export type UpsertScalingScheduleRequestEntriesList = Array<ScalingScheduleEntryRequest>;
969
+ export interface UpsertScalingScheduleRequest {
970
+ /** ID of the organization that owns the service. */
971
+ organizationId: string;
972
+ /** ID of the service. */
973
+ serviceId: string;
974
+ /** List of schedule entries. Pass an empty array to clear the schedule. */
975
+ entries: UpsertScalingScheduleRequestEntriesList;
976
+ }
977
+ export type UpsertServiceQueryEndpointRequestRolesItem =
978
+ | "sql_console_read_only"
979
+ | "sql_console_admin";
980
+ /** The roles */
981
+ export type UpsertServiceQueryEndpointRequestRolesList = Array<
982
+ UpsertServiceQueryEndpointRequestRolesItem | (string & {})
983
+ >;
984
+ /** The version of the service query endpoint */
985
+ export type UpsertServiceQueryEndpointRequestOpenApiKeysList = Array<string>;
986
+ export interface UpsertServiceQueryEndpointRequest {
987
+ /** ID of the requested organization. */
988
+ organizationId: string;
989
+ /** ID of the requested service. */
990
+ serviceId: string;
991
+ /** The roles */
992
+ roles: UpsertServiceQueryEndpointRequestRolesList;
993
+ /** The version of the service query endpoint */
994
+ openApiKeys: UpsertServiceQueryEndpointRequestOpenApiKeysList;
995
+ /** The allowed origins as comma separated list of domains */
996
+ allowedOrigins?: string | undefined;
997
+ }
998
+ export interface Error400Body {
999
+ /** HTTP status code. */
1000
+ status?: number | undefined;
1001
+ /** Detailed error description. */
1002
+ error?: string | undefined;
1003
+ /** Unique id assigned to every request. UUIDv4 */
1004
+ requestId?: string | undefined;
1005
+ }
1006
+ export type CreateServiceError = InstanceLimitReached | ClickHouseCloudOpError;
1007
+ /** Create new service Creates a new service in the organization, and returns the current service state and a password to access the service. The service is started asynchronously. */
1008
+ export const createService: API.OperationMethod<
1009
+ CreateServiceRequest,
1010
+ ServicePostResponse,
1011
+ CreateServiceError,
1012
+ ClickHouseCloudOpContext
1013
+ > = /*@__PURE__*/ API.make(() => ({
1014
+ input: __S(145, __c18, 1) as any as S.Schema<CreateServiceRequest>,
1015
+ output: __S(146, __c18, 2) as any as S.Schema<ServicePostResponse>,
1016
+ errors: [InstanceLimitReached],
1017
+ serviceErrors: ClickHouseCloudServiceErrors,
1018
+ protocol: ClickHouseCloudProtocol,
1019
+ retry: Retry.Retry,
1020
+ telemetry: TELEMETRY,
1021
+ span: "CreateService",
1022
+ }));
1023
+
1024
+ export type CreateServicePrivateEndpointError = ClickHouseCloudOpError;
1025
+ /** Create a private endpoint Create a new private endpoint. The private endpoint will be associated with this service and organization */
1026
+ export const createServicePrivateEndpoint: API.OperationMethod<
1027
+ CreateServicePrivateEndpointRequest,
1028
+ InstancePrivateEndpoint,
1029
+ CreateServicePrivateEndpointError,
1030
+ ClickHouseCloudOpContext
1031
+ > = /*@__PURE__*/ API.make(() => ({
1032
+ input: __S(192, __c24, 0) as any as S.Schema<CreateServicePrivateEndpointRequest>,
1033
+ output: __S(193, __c24, 1) as any as S.Schema<InstancePrivateEndpoint>,
1034
+ errors: [],
1035
+ serviceErrors: ClickHouseCloudServiceErrors,
1036
+ protocol: ClickHouseCloudProtocol,
1037
+ retry: Retry.Retry,
1038
+ telemetry: TELEMETRY,
1039
+ span: "CreateServicePrivateEndpoint",
1040
+ }));
1041
+
1042
+ export type DeleteScalingScheduleError = ClickHouseCloudOpError;
1043
+ /** Delete service scheduled scaling Deletes the autoscaling schedule for a service. If a schedule entry is currently active, the base scaling config is restored to the instance before the schedule is removed. Returns 404 if no schedule exists. Requires the scheduled autoscaling feature to be enabled for the organization. */
1044
+ export const deleteScalingSchedule: API.OperationMethod<
1045
+ DeleteScalingScheduleRequest,
1046
+ DeleteScalingScheduleResponse,
1047
+ DeleteScalingScheduleError,
1048
+ ClickHouseCloudOpContext
1049
+ > = /*@__PURE__*/ API.make(() => ({
1050
+ input: __S(200, __c25, 0) as any as S.Schema<DeleteScalingScheduleRequest>,
1051
+ output: __S(208, __c26, 0) as any as S.Schema<DeleteScalingScheduleResponse>,
1052
+ errors: [],
1053
+ serviceErrors: ClickHouseCloudServiceErrors,
1054
+ protocol: ClickHouseCloudProtocol,
1055
+ retry: Retry.Retry,
1056
+ telemetry: TELEMETRY,
1057
+ span: "DeleteScalingSchedule",
1058
+ }));
1059
+
1060
+ export type DeleteServiceError =
1061
+ | DeletionProtectionEnabled
1062
+ | ServiceNotTerminable
1063
+ | ClickHouseCloudOpError;
1064
+ /** Delete service 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. */
1065
+ export const deleteService: API.OperationMethod<
1066
+ DeleteServiceRequest,
1067
+ DeleteServiceResponse,
1068
+ DeleteServiceError,
1069
+ ClickHouseCloudOpContext
1070
+ > = /*@__PURE__*/ API.make(() => ({
1071
+ input: __S(216, __c27, 0) as any as S.Schema<DeleteServiceRequest>,
1072
+ output: __S(208, __c26, 0) as any as S.Schema<DeleteServiceResponse>,
1073
+ errors: [DeletionProtectionEnabled, ServiceNotTerminable],
1074
+ serviceErrors: ClickHouseCloudServiceErrors,
1075
+ protocol: ClickHouseCloudProtocol,
1076
+ retry: Retry.Retry,
1077
+ telemetry: TELEMETRY,
1078
+ span: "DeleteService",
1079
+ }));
1080
+
1081
+ export type DeleteServiceQueryEndpointError = ClickHouseCloudOpError;
1082
+ /** Delete the service query endpoint for a given instance Removes the service query endpoint. */
1083
+ export const deleteServiceQueryEndpoint: API.OperationMethod<
1084
+ DeleteServiceQueryEndpointRequest,
1085
+ DeleteServiceQueryEndpointResponse,
1086
+ DeleteServiceQueryEndpointError,
1087
+ ClickHouseCloudOpContext
1088
+ > = /*@__PURE__*/ API.make(() => ({
1089
+ input: __S(224, __c28, 0) as any as S.Schema<DeleteServiceQueryEndpointRequest>,
1090
+ output: __S(208, __c26, 0) as any as S.Schema<DeleteServiceQueryEndpointResponse>,
1091
+ errors: [],
1092
+ serviceErrors: ClickHouseCloudServiceErrors,
1093
+ protocol: ClickHouseCloudProtocol,
1094
+ retry: Retry.Retry,
1095
+ telemetry: TELEMETRY,
1096
+ span: "DeleteServiceQueryEndpoint",
1097
+ }));
1098
+
1099
+ export type DeleteUpgradeWindowError = ClickHouseCloudOpError;
1100
+ /** Delete service upgrade window Deletes the upgrade window for a service, restoring the default scheduling behaviour. The upgrade window can only be deleted on primary services. Deletion succeeds even if the organization has lost the scheduled upgrades entitlement, so a window can be cleared after entitlement loss. Errors: - 400: the service is a secondary service. - 401: missing, invalid, or disabled API key. - 403: caller lacks `control-plane:service:manage` on the service. - 404: service does not exist, is not visible to the caller, or no upgrade window is configured. */
1101
+ export const deleteUpgradeWindow: API.OperationMethod<
1102
+ DeleteUpgradeWindowRequest,
1103
+ DeleteUpgradeWindowResponse,
1104
+ DeleteUpgradeWindowError,
1105
+ ClickHouseCloudOpContext
1106
+ > = /*@__PURE__*/ API.make(() => ({
1107
+ input: __S(0, __c0, 0) as any as S.Schema<DeleteUpgradeWindowRequest>,
1108
+ output: __S(208, __c26, 0) as any as S.Schema<DeleteUpgradeWindowResponse>,
1109
+ errors: [],
1110
+ serviceErrors: ClickHouseCloudServiceErrors,
1111
+ protocol: ClickHouseCloudProtocol,
1112
+ retry: Retry.Retry,
1113
+ telemetry: TELEMETRY,
1114
+ span: "DeleteUpgradeWindow",
1115
+ }));
1116
+
1117
+ export type GetScalingScheduleError = ClickHouseCloudOpError;
1118
+ /** Get service autoscaling schedule Returns the autoscaling schedule for a service. Returns 404 if no schedule has been configured or if the schedule was cleared. Requires the scheduled autoscaling feature to be enabled for the organization. On a Gen 2 (v2-default) service, no entry has a memory range, a replica range or idling on; fields an entry leaves to the base config are omitted. */
1119
+ export const getScalingSchedule: API.OperationMethod<
1120
+ GetScalingScheduleRequest,
1121
+ ScalingSchedule,
1122
+ GetScalingScheduleError,
1123
+ ClickHouseCloudOpContext
1124
+ > = /*@__PURE__*/ API.make(() => ({
1125
+ input: __S(8, __c1, 0) as any as S.Schema<GetScalingScheduleRequest>,
1126
+ output: __S(156, __c19, 4) as any as S.Schema<ScalingSchedule>,
1127
+ errors: [],
1128
+ serviceErrors: ClickHouseCloudServiceErrors,
1129
+ protocol: ClickHouseCloudProtocol,
1130
+ retry: Retry.Retry,
1131
+ telemetry: TELEMETRY,
1132
+ span: "GetScalingSchedule",
1133
+ }));
1134
+
1135
+ export type GetServiceError = ClickHouseCloudOpError;
1136
+ /** Get service details Returns a service that belongs to the organization */
1137
+ export const getService: API.OperationMethod<
1138
+ GetServiceRequest,
1139
+ Service,
1140
+ GetServiceError,
1141
+ ClickHouseCloudOpContext
1142
+ > = /*@__PURE__*/ API.make(() => ({
1143
+ input: __S(16, __c2, 0) as any as S.Schema<GetServiceRequest>,
1144
+ output: __S(176, __c22, 0) as any as S.Schema<Service>,
1145
+ errors: [],
1146
+ serviceErrors: ClickHouseCloudServiceErrors,
1147
+ protocol: ClickHouseCloudProtocol,
1148
+ retry: Retry.Retry,
1149
+ telemetry: TELEMETRY,
1150
+ span: "GetService",
1151
+ }));
1152
+
1153
+ export type GetServicePrivateEndpointConfigError = ClickHouseCloudOpError;
1154
+ /** Get private endpoint configuration Information required to set up a private endpoint */
1155
+ export const getServicePrivateEndpointConfig: API.OperationMethod<
1156
+ GetServicePrivateEndpointConfigRequest,
1157
+ PrivateEndpointConfig,
1158
+ GetServicePrivateEndpointConfigError,
1159
+ ClickHouseCloudOpContext
1160
+ > = /*@__PURE__*/ API.make(() => ({
1161
+ input: __S(24, __c3, 0) as any as S.Schema<GetServicePrivateEndpointConfigRequest>,
1162
+ output: __S(25, __c3, 1) as any as S.Schema<PrivateEndpointConfig>,
1163
+ errors: [],
1164
+ serviceErrors: ClickHouseCloudServiceErrors,
1165
+ protocol: ClickHouseCloudProtocol,
1166
+ retry: Retry.Retry,
1167
+ telemetry: TELEMETRY,
1168
+ span: "GetServicePrivateEndpointConfig",
1169
+ }));
1170
+
1171
+ export type GetServiceQueryEndpointError = ClickHouseCloudOpError;
1172
+ /** Get the service query endpoint for a given instance Get the configuration for the service query endpoint that allows executing queries via API. */
1173
+ export const getServiceQueryEndpoint: API.OperationMethod<
1174
+ GetServiceQueryEndpointRequest,
1175
+ ServiceQueryAPIEndpoint,
1176
+ GetServiceQueryEndpointError,
1177
+ ClickHouseCloudOpContext
1178
+ > = /*@__PURE__*/ API.make(() => ({
1179
+ input: __S(32, __c4, 0) as any as S.Schema<GetServiceQueryEndpointRequest>,
1180
+ output: __S(41, __c5, 1) as any as S.Schema<ServiceQueryAPIEndpoint>,
1181
+ errors: [],
1182
+ serviceErrors: ClickHouseCloudServiceErrors,
1183
+ protocol: ClickHouseCloudProtocol,
1184
+ retry: Retry.Retry,
1185
+ telemetry: TELEMETRY,
1186
+ span: "GetServiceQueryEndpoint",
1187
+ }));
1188
+
1189
+ export type GetUpgradeWindowError = ClickHouseCloudOpError;
1190
+ /** Get service upgrade window Returns the configured upgrade window for a service. Errors: - 401: missing, invalid, or disabled API key. - 403: caller lacks `control-plane:service:view` on the service. - 404: service does not exist, is not visible to the caller, or no upgrade window has been configured. */
1191
+ export const getUpgradeWindow: API.OperationMethod<
1192
+ GetUpgradeWindowRequest,
1193
+ UpgradeWindow,
1194
+ GetUpgradeWindowError,
1195
+ ClickHouseCloudOpContext
1196
+ > = /*@__PURE__*/ API.make(() => ({
1197
+ input: __S(48, __c6, 0) as any as S.Schema<GetUpgradeWindowRequest>,
1198
+ output: __S(56, __c7, 0) as any as S.Schema<UpgradeWindow>,
1199
+ errors: [],
1200
+ serviceErrors: ClickHouseCloudServiceErrors,
1201
+ protocol: ClickHouseCloudProtocol,
1202
+ retry: Retry.Retry,
1203
+ telemetry: TELEMETRY,
1204
+ span: "GetUpgradeWindow",
1205
+ }));
1206
+
1207
+ export type ListServiceProfilesError = ClickHouseCloudOpError;
1208
+ /** List available service profiles Returns the custom instance profiles the organization can use in a region. Pass byoc_id to list the profiles configured for a BYOC infrastructure; the region is then taken from the infrastructure and region_id may be omitted. v2-default (Gen 2 hardware) is listed for organizations with Gen 2 enabled and included in their plan (SCALE or ENTERPRISE) or settings, in AWS regions where Gen 2 is available, and never for BYOC infrastructure. Some other profiles have their own availability rules; every other profile, v1-default included, is listed only when the organization has custom hardware profiles (through its plan or a per-organization override). */
1209
+ export const listServiceProfiles: API.OperationMethod<
1210
+ ListServiceProfilesRequest,
1211
+ ListServiceProfilesResponse,
1212
+ ListServiceProfilesError,
1213
+ ClickHouseCloudOpContext
1214
+ > = /*@__PURE__*/ API.make(() => ({
1215
+ input: __S(64, __c8, 0) as any as S.Schema<ListServiceProfilesRequest>,
1216
+ output: __S(67, __c8, 3) as any as S.Schema<ListServiceProfilesResponse>,
1217
+ errors: [],
1218
+ serviceErrors: ClickHouseCloudServiceErrors,
1219
+ protocol: ClickHouseCloudProtocol,
1220
+ retry: Retry.Retry,
1221
+ telemetry: TELEMETRY,
1222
+ span: "ListServiceProfiles",
1223
+ }));
1224
+
1225
+ export type ListServicesError = ClickHouseCloudOpError;
1226
+ /** List of organization services Returns a list of all services in the organization. */
1227
+ export const listServices: API.OperationMethod<
1228
+ ListServicesRequest,
1229
+ ListServicesResponse,
1230
+ ListServicesError,
1231
+ ClickHouseCloudOpContext
1232
+ > = /*@__PURE__*/ API.make(() => ({
1233
+ input: __S(72, __c9, 0) as any as S.Schema<ListServicesRequest>,
1234
+ output: __S(74, __c9, 2) as any as S.Schema<ListServicesResponse>,
1235
+ errors: [],
1236
+ serviceErrors: ClickHouseCloudServiceErrors,
1237
+ protocol: ClickHouseCloudProtocol,
1238
+ retry: Retry.Retry,
1239
+ telemetry: TELEMETRY,
1240
+ span: "ListServices",
1241
+ }));
1242
+
1243
+ export type UpdateServiceError = ClickHouseCloudOpError;
1244
+ /** Update service basic details Updates basic service details like service name or IP access list. */
1245
+ export const updateService: API.OperationMethod<
1246
+ UpdateServiceRequest,
1247
+ Service,
1248
+ UpdateServiceError,
1249
+ ClickHouseCloudOpContext
1250
+ > = /*@__PURE__*/ API.make(() => ({
1251
+ input: __S(83, __c10, 3) as any as S.Schema<UpdateServiceRequest>,
1252
+ output: __S(176, __c22, 0) as any as S.Schema<Service>,
1253
+ errors: [],
1254
+ serviceErrors: ClickHouseCloudServiceErrors,
1255
+ protocol: ClickHouseCloudProtocol,
1256
+ retry: Retry.Retry,
1257
+ telemetry: TELEMETRY,
1258
+ span: "UpdateService",
1259
+ }));
1260
+
1261
+ export type UpdateServicePasswordError = ClickHouseCloudOpError;
1262
+ /** Update service password Sets a new password for the service */
1263
+ export const updateServicePassword: API.OperationMethod<
1264
+ UpdateServicePasswordRequest,
1265
+ ServicePasswordPatchResponse,
1266
+ UpdateServicePasswordError,
1267
+ ClickHouseCloudOpContext
1268
+ > = /*@__PURE__*/ API.make(() => ({
1269
+ input: __S(88, __c11, 0) as any as S.Schema<UpdateServicePasswordRequest>,
1270
+ output: __S(89, __c11, 1) as any as S.Schema<ServicePasswordPatchResponse>,
1271
+ errors: [],
1272
+ serviceErrors: ClickHouseCloudServiceErrors,
1273
+ protocol: ClickHouseCloudProtocol,
1274
+ retry: Retry.Retry,
1275
+ telemetry: TELEMETRY,
1276
+ span: "UpdateServicePassword",
1277
+ }));
1278
+
1279
+ export type UpdateServiceReplicaScalingError = ClickHouseCloudOpError;
1280
+ /** Update service auto scaling settings 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. */
1281
+ export const updateServiceReplicaScaling: API.OperationMethod<
1282
+ UpdateServiceReplicaScalingRequest,
1283
+ ServiceScalingPatchResponse,
1284
+ UpdateServiceReplicaScalingError,
1285
+ ClickHouseCloudOpContext
1286
+ > = /*@__PURE__*/ API.make(() => ({
1287
+ input: __S(96, __c12, 0) as any as S.Schema<UpdateServiceReplicaScalingRequest>,
1288
+ output: __S(97, __c12, 1) as any as S.Schema<ServiceScalingPatchResponse>,
1289
+ errors: [],
1290
+ serviceErrors: ClickHouseCloudServiceErrors,
1291
+ protocol: ClickHouseCloudProtocol,
1292
+ retry: Retry.Retry,
1293
+ telemetry: TELEMETRY,
1294
+ span: "UpdateServiceReplicaScaling",
1295
+ }));
1296
+
1297
+ export type UpdateServiceStateError = ServiceNotIdle | ClickHouseCloudOpError;
1298
+ /** Update service state Starts, stops, or wakes a service. The `start` and `stop` commands require the `control-plane:service:manage` permission on the service. The `awake` command requires only `control-plane:service:view` and applies to an idle service; it does not start a stopped service. */
1299
+ export const updateServiceState: API.OperationMethod<
1300
+ UpdateServiceStateRequest,
1301
+ Service,
1302
+ UpdateServiceStateError,
1303
+ ClickHouseCloudOpContext
1304
+ > = /*@__PURE__*/ API.make(() => ({
1305
+ input: __S(104, __c13, 0) as any as S.Schema<UpdateServiceStateRequest>,
1306
+ output: __S(176, __c22, 0) as any as S.Schema<Service>,
1307
+ errors: [ServiceNotIdle],
1308
+ serviceErrors: ClickHouseCloudServiceErrors,
1309
+ protocol: ClickHouseCloudProtocol,
1310
+ retry: Retry.Retry,
1311
+ telemetry: TELEMETRY,
1312
+ span: "UpdateServiceState",
1313
+ }));
1314
+
1315
+ export type UpdateUpgradeWindowError = FeatureUnavailable | ClickHouseCloudOpError;
1316
+ /** Set service upgrade window Creates or fully replaces the upgrade window for a service. The upgrade window currently lasts 6 hours from `startHourUtc`. The upgrade window can only be set on primary services; secondary services inherit the primary service window. Errors: - 400: invalid field values (`weekday` not in 0-6, `startHourUtc` not in {0, 6, 12, 18}), or the service is a secondary service. - 401: missing, invalid, or disabled API key. - 403: caller lacks `control-plane:service:manage` on the service, or the organization does not have the scheduled upgrades feature enabled. - 404: service does not exist or is not visible to the caller. */
1317
+ export const updateUpgradeWindow: API.OperationMethod<
1318
+ UpdateUpgradeWindowRequest,
1319
+ UpgradeWindow,
1320
+ UpdateUpgradeWindowError,
1321
+ ClickHouseCloudOpContext
1322
+ > = /*@__PURE__*/ API.make(() => ({
1323
+ input: __S(112, __c14, 0) as any as S.Schema<UpdateUpgradeWindowRequest>,
1324
+ output: __S(56, __c7, 0) as any as S.Schema<UpgradeWindow>,
1325
+ errors: [FeatureUnavailable],
1326
+ serviceErrors: ClickHouseCloudServiceErrors,
1327
+ protocol: ClickHouseCloudProtocol,
1328
+ retry: Retry.Retry,
1329
+ telemetry: TELEMETRY,
1330
+ span: "UpdateUpgradeWindow",
1331
+ }));
1332
+
1333
+ export type UpsertScalingScheduleError = ClickHouseCloudOpError;
1334
+ /** Create or replace service autoscaling schedule Creates or fully replaces the autoscaling schedule for a service. Pass an empty `entries` array to clear the schedule -- a subsequent GET will return 404, and the response will contain an empty `baseConfig` (all fields absent). The base scaling config (applied when no entry is active) is managed separately via the `replicaScaling` endpoint. Requires the scheduled autoscaling feature to be enabled for the organization. Gen 2 (v2-default) services use a fixed size and cannot idle. An entry may leave out fields it takes from the base config, but each entry combined with those fields must have equal minReplicaMemoryGb and maxReplicaMemoryGb, a fixed replica count (numReplicas, or equal minReplicas and maxReplicas), and idling off; otherwise the request is rejected. */
1335
+ export const upsertScalingSchedule: API.OperationMethod<
1336
+ UpsertScalingScheduleRequest,
1337
+ ScalingSchedule,
1338
+ UpsertScalingScheduleError,
1339
+ ClickHouseCloudOpContext
1340
+ > = /*@__PURE__*/ API.make(() => ({
1341
+ input: __S(122, __c15, 2) as any as S.Schema<UpsertScalingScheduleRequest>,
1342
+ output: __S(156, __c19, 4) as any as S.Schema<ScalingSchedule>,
1343
+ errors: [],
1344
+ serviceErrors: ClickHouseCloudServiceErrors,
1345
+ protocol: ClickHouseCloudProtocol,
1346
+ retry: Retry.Retry,
1347
+ telemetry: TELEMETRY,
1348
+ span: "UpsertScalingSchedule",
1349
+ }));
1350
+
1351
+ export type UpsertServiceQueryEndpointError = ClickHouseCloudOpError;
1352
+ /** Upsert the service query endpoint for a given instance Create the service query endpoint that allows executing queries via API. */
1353
+ export const upsertServiceQueryEndpoint: API.OperationMethod<
1354
+ UpsertServiceQueryEndpointRequest,
1355
+ ServiceQueryAPIEndpoint,
1356
+ UpsertServiceQueryEndpointError,
1357
+ ClickHouseCloudOpContext
1358
+ > = /*@__PURE__*/ API.make(() => ({
1359
+ input: __S(128, __c16, 0) as any as S.Schema<UpsertServiceQueryEndpointRequest>,
1360
+ output: __S(41, __c5, 1) as any as S.Schema<ServiceQueryAPIEndpoint>,
1361
+ errors: [],
1362
+ serviceErrors: ClickHouseCloudServiceErrors,
1363
+ protocol: ClickHouseCloudProtocol,
1364
+ retry: Retry.Retry,
1365
+ telemetry: TELEMETRY,
1366
+ span: "UpsertServiceQueryEndpoint",
1367
+ }));
1368
+
1369
+ // Schema builders: each runs one schema initializer, on that schema's first use.
1370
+ function __c0(j: number): any {
1371
+ switch (j) {
1372
+ case 0:
1373
+ return S.suspend(() =>
1374
+ S.Struct({
1375
+ organizationId: S.String.pipe(T.Label()),
1376
+ serviceId: S.String.pipe(T.Label()),
1377
+ }).pipe(
1378
+ T.Http({
1379
+ method: "DELETE",
1380
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/upgradeWindow",
1381
+ code: 200,
1382
+ }),
1383
+ ),
1384
+ ).annotate({ identifier: "DeleteUpgradeWindowRequest" });
1385
+ }
1386
+ }
1387
+ function __c1(j: number): any {
1388
+ switch (j) {
1389
+ case 0:
1390
+ return S.suspend(() =>
1391
+ S.Struct({
1392
+ organizationId: S.String.pipe(T.Label()),
1393
+ serviceId: S.String.pipe(T.Label()),
1394
+ }).pipe(
1395
+ T.Http({
1396
+ method: "GET",
1397
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule",
1398
+ code: 200,
1399
+ }),
1400
+ ),
1401
+ ).annotate({ identifier: "GetScalingScheduleRequest" });
1402
+ }
1403
+ }
1404
+ function __c2(j: number): any {
1405
+ switch (j) {
1406
+ case 0:
1407
+ return S.suspend(() =>
1408
+ S.Struct({
1409
+ organizationId: S.String.pipe(T.Label()),
1410
+ serviceId: S.String.pipe(T.Label()),
1411
+ }).pipe(
1412
+ T.Http({
1413
+ method: "GET",
1414
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}",
1415
+ code: 200,
1416
+ }),
1417
+ ),
1418
+ ).annotate({ identifier: "GetServiceRequest" });
1419
+ }
1420
+ }
1421
+ function __c3(j: number): any {
1422
+ switch (j) {
1423
+ case 0:
1424
+ return S.suspend(() =>
1425
+ S.Struct({
1426
+ organizationId: S.String.pipe(T.Label()),
1427
+ serviceId: S.String.pipe(T.Label()),
1428
+ }).pipe(
1429
+ T.Http({
1430
+ method: "GET",
1431
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/privateEndpointConfig",
1432
+ code: 200,
1433
+ }),
1434
+ ),
1435
+ ).annotate({ identifier: "GetServicePrivateEndpointConfigRequest" });
1436
+ case 1:
1437
+ return S.suspend(() =>
1438
+ S.Struct({
1439
+ endpointServiceId: S.optional(S.String),
1440
+ privateDnsHostname: S.optional(S.String),
1441
+ }),
1442
+ ).annotate({ identifier: "PrivateEndpointConfig" });
1443
+ }
1444
+ }
1445
+ function __c4(j: number): any {
1446
+ switch (j) {
1447
+ case 0:
1448
+ return S.suspend(() =>
1449
+ S.Struct({
1450
+ organizationId: S.String.pipe(T.Label()),
1451
+ serviceId: S.String.pipe(T.Label()),
1452
+ }).pipe(
1453
+ T.Http({
1454
+ method: "GET",
1455
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint",
1456
+ code: 200,
1457
+ }),
1458
+ ),
1459
+ ).annotate({ identifier: "GetServiceQueryEndpointRequest" });
1460
+ }
1461
+ }
1462
+ function __c5(j: number): any {
1463
+ switch (j) {
1464
+ case 0:
1465
+ return S.Array(S.String);
1466
+ case 1:
1467
+ return S.suspend(() =>
1468
+ S.Struct({
1469
+ id: S.optional(S.String),
1470
+ openApiKeys: S.optional(__S(160, __c20, 0)),
1471
+ roles: S.optional(__S(40, __c5, 0)),
1472
+ allowedOrigins: S.optional(S.String),
1473
+ }),
1474
+ ).annotate({ identifier: "ServiceQueryAPIEndpoint" });
1475
+ }
1476
+ }
1477
+ function __c6(j: number): any {
1478
+ switch (j) {
1479
+ case 0:
1480
+ return S.suspend(() =>
1481
+ S.Struct({
1482
+ organizationId: S.String.pipe(T.Label()),
1483
+ serviceId: S.String.pipe(T.Label()),
1484
+ }).pipe(
1485
+ T.Http({
1486
+ method: "GET",
1487
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/upgradeWindow",
1488
+ code: 200,
1489
+ }),
1490
+ ),
1491
+ ).annotate({ identifier: "GetUpgradeWindowRequest" });
1492
+ }
1493
+ }
1494
+ function __c7(j: number): any {
1495
+ switch (j) {
1496
+ case 0:
1497
+ return S.suspend(() =>
1498
+ S.Struct({
1499
+ weekday: S.Number,
1500
+ startHourUtc: S.Number,
1501
+ duration: S.Number,
1502
+ }),
1503
+ ).annotate({ identifier: "UpgradeWindow" });
1504
+ }
1505
+ }
1506
+ function __c8(j: number): any {
1507
+ switch (j) {
1508
+ case 0:
1509
+ return S.suspend(() =>
1510
+ S.Struct({
1511
+ organizationId: S.String.pipe(T.Label()),
1512
+ region_id: S.optional(S.String.pipe(T.Query())),
1513
+ byoc_id: S.optional(S.String.pipe(T.Query())),
1514
+ }).pipe(
1515
+ T.Http({
1516
+ method: "GET",
1517
+ uri: "/v1/organizations/{organizationId}/serviceProfiles",
1518
+ code: 200,
1519
+ }),
1520
+ ),
1521
+ ).annotate({ identifier: "ListServiceProfilesRequest" });
1522
+ case 1:
1523
+ return S.suspend(() =>
1524
+ S.Struct({
1525
+ profile: S.optional(S.String),
1526
+ cpuCores: S.optional(S.Number),
1527
+ memoryGi: S.optional(S.Number),
1528
+ }),
1529
+ ).annotate({ identifier: "ServiceProfile" });
1530
+ case 2:
1531
+ return S.Array(__S(65, __c8, 1));
1532
+ case 3:
1533
+ return S.suspend(() => __S(66, __c8, 2).pipe(T.RawResponseRoot())).annotate({
1534
+ identifier: "ListServiceProfilesResponse",
1535
+ });
1536
+ }
1537
+ }
1538
+ function __c9(j: number): any {
1539
+ switch (j) {
1540
+ case 0:
1541
+ return S.suspend(() =>
1542
+ S.Struct({
1543
+ organizationId: S.String.pipe(T.Label()),
1544
+ filter: S.optional(__S(160, __c20, 0).pipe(T.Query())),
1545
+ }).pipe(
1546
+ T.Http({ method: "GET", uri: "/v1/organizations/{organizationId}/services", code: 200 }),
1547
+ ),
1548
+ ).annotate({ identifier: "ListServicesRequest" });
1549
+ case 1:
1550
+ return S.Array(__S(176, __c22, 0));
1551
+ case 2:
1552
+ return S.suspend(() => __S(73, __c9, 1).pipe(T.RawResponseRoot())).annotate({
1553
+ identifier: "ListServicesResponse",
1554
+ });
1555
+ }
1556
+ }
1557
+ function __c10(j: number): any {
1558
+ switch (j) {
1559
+ case 0:
1560
+ return S.suspend(() =>
1561
+ S.Struct({
1562
+ add: S.optional(__S(169, __c21, 1)),
1563
+ remove: S.optional(__S(169, __c21, 1)),
1564
+ }),
1565
+ ).annotate({ identifier: "IpAccessListPatch" });
1566
+ case 1:
1567
+ return S.suspend(() =>
1568
+ S.Struct({
1569
+ add: S.optional(__S(160, __c20, 0)),
1570
+ remove: S.optional(__S(160, __c20, 0)),
1571
+ }),
1572
+ ).annotate({ identifier: "InstancePrivateEndpointsPatch" });
1573
+ case 2:
1574
+ return S.suspend(() =>
1575
+ S.Struct({
1576
+ add: S.optional(__S(171, __c21, 3)),
1577
+ remove: S.optional(__S(171, __c21, 3)),
1578
+ }),
1579
+ ).annotate({ identifier: "InstanceTagsPatch" });
1580
+ case 3:
1581
+ return S.suspend(() =>
1582
+ S.Struct({
1583
+ organizationId: S.String.pipe(T.Label()),
1584
+ serviceId: S.String.pipe(T.Label()),
1585
+ name: S.optional(S.String),
1586
+ ipAccessList: S.optional(__S(80, __c10, 0)),
1587
+ privateEndpointIds: S.optional(__S(81, __c10, 1)),
1588
+ releaseChannel: S.optional(S.String),
1589
+ endpoints: S.optional(__S(185, __c23, 1)),
1590
+ transparentDataEncryptionKeyId: S.optional(S.String),
1591
+ tags: S.optional(__S(82, __c10, 2)),
1592
+ enableCoreDumps: S.optional(S.Boolean),
1593
+ deletionProtection: S.optional(S.Boolean),
1594
+ }).pipe(
1595
+ T.Http({
1596
+ method: "PATCH",
1597
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}",
1598
+ code: 200,
1599
+ }),
1600
+ ),
1601
+ ).annotate({ identifier: "UpdateServiceRequest" });
1602
+ }
1603
+ }
1604
+ function __c11(j: number): any {
1605
+ switch (j) {
1606
+ case 0:
1607
+ return S.suspend(() =>
1608
+ S.Struct({
1609
+ organizationId: S.String.pipe(T.Label()),
1610
+ serviceId: S.String.pipe(T.Label()),
1611
+ newPasswordHash: S.optional(S.String.pipe(T.SensitiveValue({}))),
1612
+ newDoubleSha1Hash: S.optional(S.String.pipe(T.SensitiveValue({}))),
1613
+ }).pipe(
1614
+ T.Http({
1615
+ method: "PATCH",
1616
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/password",
1617
+ code: 200,
1618
+ }),
1619
+ ),
1620
+ ).annotate({ identifier: "UpdateServicePasswordRequest" });
1621
+ case 1:
1622
+ return S.suspend(() =>
1623
+ S.Struct({
1624
+ password: S.optional(S.String.pipe(T.SensitiveValue({}))),
1625
+ }),
1626
+ ).annotate({ identifier: "ServicePasswordPatchResponse" });
1627
+ }
1628
+ }
1629
+ function __c12(j: number): any {
1630
+ switch (j) {
1631
+ case 0:
1632
+ return S.suspend(() =>
1633
+ S.Struct({
1634
+ organizationId: S.String.pipe(T.Label()),
1635
+ serviceId: S.String.pipe(T.Label()),
1636
+ minReplicaMemoryGb: S.optional(S.Number),
1637
+ maxReplicaMemoryGb: S.optional(S.Number),
1638
+ autoscalingMode: S.optional(S.String),
1639
+ numReplicas: S.optional(S.Number),
1640
+ minReplicas: S.optional(S.Number),
1641
+ maxReplicas: S.optional(S.Number),
1642
+ idleScaling: S.optional(S.Boolean),
1643
+ idleTimeoutMinutes: S.optional(S.Number),
1644
+ profile: S.optional(S.String),
1645
+ }).pipe(
1646
+ T.Http({
1647
+ method: "PATCH",
1648
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/replicaScaling",
1649
+ code: 200,
1650
+ }),
1651
+ ),
1652
+ ).annotate({ identifier: "UpdateServiceReplicaScalingRequest" });
1653
+ case 1:
1654
+ return S.suspend(() =>
1655
+ S.Struct({
1656
+ id: S.optional(S.String),
1657
+ name: S.optional(S.String),
1658
+ provider: S.optional(S.String),
1659
+ region: S.optional(S.String),
1660
+ state: S.optional(S.String),
1661
+ clickhouseVersion: S.optional(S.String),
1662
+ endpoints: S.optional(__S(173, __c21, 5)),
1663
+ tier: S.optional(S.String),
1664
+ minTotalMemoryGb: S.optional(S.Number),
1665
+ maxTotalMemoryGb: S.optional(S.Number),
1666
+ minReplicaMemoryGb: S.optional(S.Number),
1667
+ maxReplicaMemoryGb: S.optional(S.Number),
1668
+ numReplicas: S.optional(S.Number),
1669
+ minReplicas: S.optional(S.Number),
1670
+ maxReplicas: S.optional(S.Number),
1671
+ autoscalingMode: S.String,
1672
+ replicaMemoryGb: S.optional(S.Number),
1673
+ idleScaling: S.optional(S.Boolean),
1674
+ idleTimeoutMinutes: S.optional(S.Number),
1675
+ ipAccessList: S.optional(__S(169, __c21, 1)),
1676
+ createdAt: S.optional(S.String),
1677
+ encryptionKey: S.optional(S.String.pipe(T.SensitiveValue({}))),
1678
+ encryptionAssumedRoleIdentifier: S.optional(S.String),
1679
+ iamRole: S.optional(S.String),
1680
+ privateEndpointIds: S.optional(__S(160, __c20, 0)),
1681
+ availablePrivateEndpointIds: S.optional(__S(160, __c20, 0)),
1682
+ dataWarehouseId: S.optional(S.String),
1683
+ isPrimary: S.optional(S.Boolean),
1684
+ isReadonly: S.optional(S.Boolean),
1685
+ releaseChannel: S.optional(S.String),
1686
+ byocId: S.optional(S.String),
1687
+ hasTransparentDataEncryption: S.optional(S.Boolean),
1688
+ profile: S.optional(S.String),
1689
+ transparentDataEncryptionKeyId: S.optional(S.String),
1690
+ encryptionRoleId: S.optional(S.String),
1691
+ complianceType: S.optional(S.String),
1692
+ tags: S.optional(__S(171, __c21, 3)),
1693
+ enableCoreDumps: S.optional(S.Boolean),
1694
+ deletionProtection: S.optional(S.Boolean),
1695
+ scalingSchedule: S.optional(__S(156, __c19, 4)),
1696
+ currentScaling: __S(174, __c21, 6),
1697
+ }),
1698
+ ).annotate({ identifier: "ServiceScalingPatchResponse" });
1699
+ }
1700
+ }
1701
+ function __c13(j: number): any {
1702
+ switch (j) {
1703
+ case 0:
1704
+ return S.suspend(() =>
1705
+ S.Struct({
1706
+ organizationId: S.String.pipe(T.Label()),
1707
+ serviceId: S.String.pipe(T.Label()),
1708
+ command: S.String,
1709
+ }).pipe(
1710
+ T.Http({
1711
+ method: "PATCH",
1712
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/state",
1713
+ code: 200,
1714
+ }),
1715
+ ),
1716
+ ).annotate({ identifier: "UpdateServiceStateRequest" });
1717
+ }
1718
+ }
1719
+ function __c14(j: number): any {
1720
+ switch (j) {
1721
+ case 0:
1722
+ return S.suspend(() =>
1723
+ S.Struct({
1724
+ organizationId: S.String.pipe(T.Label()),
1725
+ serviceId: S.String.pipe(T.Label()),
1726
+ weekday: S.Number,
1727
+ startHourUtc: S.Number,
1728
+ }).pipe(
1729
+ T.Http({
1730
+ method: "PUT",
1731
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/upgradeWindow",
1732
+ code: 200,
1733
+ }),
1734
+ ),
1735
+ ).annotate({ identifier: "UpdateUpgradeWindowRequest" });
1736
+ }
1737
+ }
1738
+ function __c15(j: number): any {
1739
+ switch (j) {
1740
+ case 0:
1741
+ return S.suspend(() =>
1742
+ S.Struct({
1743
+ name: S.String,
1744
+ weekdays: __S(152, __c19, 0),
1745
+ startHourUtc: S.Number,
1746
+ endHourUtc: S.Number,
1747
+ autoscalingMode: S.optional(S.String),
1748
+ minReplicaMemoryGb: S.optional(S.Number),
1749
+ maxReplicaMemoryGb: S.optional(S.Number),
1750
+ numReplicas: S.optional(S.Number),
1751
+ minReplicas: S.optional(S.Number),
1752
+ maxReplicas: S.optional(S.Number),
1753
+ idleScaling: S.optional(S.Boolean),
1754
+ idleTimeoutMinutes: S.optional(S.Number),
1755
+ }),
1756
+ ).annotate({ identifier: "ScalingScheduleEntryRequest" });
1757
+ case 1:
1758
+ return S.Array(__S(120, __c15, 0));
1759
+ case 2:
1760
+ return S.suspend(() =>
1761
+ S.Struct({
1762
+ organizationId: S.String.pipe(T.Label()),
1763
+ serviceId: S.String.pipe(T.Label()),
1764
+ entries: __S(121, __c15, 1),
1765
+ }).pipe(
1766
+ T.Http({
1767
+ method: "POST",
1768
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule",
1769
+ code: 200,
1770
+ }),
1771
+ ),
1772
+ ).annotate({ identifier: "UpsertScalingScheduleRequest" });
1773
+ }
1774
+ }
1775
+ function __c16(j: number): any {
1776
+ switch (j) {
1777
+ case 0:
1778
+ return S.suspend(() =>
1779
+ S.Struct({
1780
+ organizationId: S.String.pipe(T.Label()),
1781
+ serviceId: S.String.pipe(T.Label()),
1782
+ roles: __S(40, __c5, 0),
1783
+ openApiKeys: __S(160, __c20, 0),
1784
+ allowedOrigins: S.optional(S.String),
1785
+ }).pipe(
1786
+ T.Http({
1787
+ method: "POST",
1788
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint",
1789
+ code: 200,
1790
+ }),
1791
+ ),
1792
+ ).annotate({ identifier: "UpsertServiceQueryEndpointRequest" });
1793
+ }
1794
+ }
1795
+ function __c17(j: number): any {
1796
+ switch (j) {
1797
+ case 0:
1798
+ return S.suspend(() =>
1799
+ S.Struct({
1800
+ status: S.optional(S.Number),
1801
+ error: S.optional(S.String),
1802
+ requestId: S.optional(S.String),
1803
+ }),
1804
+ ).annotate({ identifier: "Error400Body" });
1805
+ }
1806
+ }
1807
+ function __c18(j: number): any {
1808
+ switch (j) {
1809
+ case 0:
1810
+ return S.Record(S.String, S.Unknown);
1811
+ case 1:
1812
+ return S.suspend(() =>
1813
+ S.Struct({
1814
+ organizationId: S.String.pipe(T.Label()),
1815
+ name: S.String,
1816
+ provider: S.String,
1817
+ region: S.String,
1818
+ tier: S.optional(S.String),
1819
+ ipAccessList: __S(169, __c21, 1),
1820
+ minTotalMemoryGb: S.optional(S.Number),
1821
+ maxTotalMemoryGb: S.optional(S.Number),
1822
+ autoscalingMode: S.optional(S.String),
1823
+ minReplicaMemoryGb: S.optional(S.Number),
1824
+ maxReplicaMemoryGb: S.optional(S.Number),
1825
+ numReplicas: S.optional(S.Number),
1826
+ minReplicas: S.optional(S.Number),
1827
+ maxReplicas: S.optional(S.Number),
1828
+ idleScaling: S.optional(S.Boolean),
1829
+ idleTimeoutMinutes: S.optional(S.Number),
1830
+ isReadonly: S.optional(S.Boolean),
1831
+ dataWarehouseId: S.optional(S.String),
1832
+ backupId: S.optional(S.String),
1833
+ backupEncryptionConfig: S.optional(__S(144, __c18, 0)),
1834
+ privateEndpointIds: S.optional(__S(160, __c20, 0)),
1835
+ privatePreviewTermsChecked: S.optional(S.Boolean),
1836
+ releaseChannel: S.optional(S.String),
1837
+ byocId: S.optional(S.String),
1838
+ hasTransparentDataEncryption: S.optional(S.Boolean),
1839
+ endpoints: S.optional(__S(185, __c23, 1)),
1840
+ profile: S.optional(S.String),
1841
+ complianceType: S.optional(S.String),
1842
+ tags: S.optional(__S(171, __c21, 3)),
1843
+ enableCoreDumps: S.optional(S.Boolean),
1844
+ deletionProtection: S.optional(S.Boolean),
1845
+ }).pipe(
1846
+ T.Http({ method: "POST", uri: "/v1/organizations/{organizationId}/services", code: 200 }),
1847
+ ),
1848
+ ).annotate({ identifier: "CreateServiceRequest" });
1849
+ case 2:
1850
+ return S.suspend(() =>
1851
+ S.Struct({
1852
+ service: __S(176, __c22, 0),
1853
+ password: S.optional(S.String.pipe(T.SensitiveValue({}))),
1854
+ }),
1855
+ ).annotate({ identifier: "ServicePostResponse" });
1856
+ }
1857
+ }
1858
+ function __c19(j: number): any {
1859
+ switch (j) {
1860
+ case 0:
1861
+ return S.Array(S.Number);
1862
+ case 1:
1863
+ return S.suspend(() =>
1864
+ S.Struct({
1865
+ id: S.String,
1866
+ name: S.String,
1867
+ weekdays: __S(152, __c19, 0),
1868
+ startHourUtc: S.Number,
1869
+ endHourUtc: S.Number,
1870
+ autoscalingMode: S.String,
1871
+ minReplicaMemoryGb: S.optional(S.Number),
1872
+ maxReplicaMemoryGb: S.optional(S.Number),
1873
+ minReplicas: S.optional(S.Number),
1874
+ maxReplicas: S.optional(S.Number),
1875
+ idleScaling: S.optional(S.Boolean),
1876
+ idleTimeoutMinutes: S.optional(S.Number),
1877
+ isActiveNow: S.Boolean,
1878
+ }),
1879
+ ).annotate({ identifier: "ScalingScheduleEntry" });
1880
+ case 2:
1881
+ return S.Array(__S(153, __c19, 1));
1882
+ case 3:
1883
+ return S.suspend(() =>
1884
+ S.Struct({
1885
+ autoscalingMode: S.optional(S.String),
1886
+ minReplicaMemoryGb: S.optional(S.Number),
1887
+ maxReplicaMemoryGb: S.optional(S.Number),
1888
+ minReplicas: S.optional(S.Number),
1889
+ maxReplicas: S.optional(S.Number),
1890
+ idleScaling: S.optional(S.Boolean),
1891
+ idleTimeoutMinutes: S.optional(S.Number),
1892
+ }),
1893
+ ).annotate({ identifier: "ScalingScheduleBaseConfig" });
1894
+ case 4:
1895
+ return S.suspend(() =>
1896
+ S.Struct({
1897
+ entries: __S(154, __c19, 2),
1898
+ baseConfig: __S(155, __c19, 3),
1899
+ activeEntryId: S.optional(S.String),
1900
+ }),
1901
+ ).annotate({ identifier: "ScalingSchedule" });
1902
+ }
1903
+ }
1904
+ function __c20(j: number): any {
1905
+ switch (j) {
1906
+ case 0:
1907
+ return S.Array(S.String);
1908
+ }
1909
+ }
1910
+ function __c21(j: number): any {
1911
+ switch (j) {
1912
+ case 0:
1913
+ return S.suspend(() =>
1914
+ S.Struct({
1915
+ source: S.optional(S.String),
1916
+ description: S.optional(S.String),
1917
+ }),
1918
+ ).annotate({ identifier: "IpAccessListEntry" });
1919
+ case 1:
1920
+ return S.Array(__S(168, __c21, 0));
1921
+ case 2:
1922
+ return S.suspend(() =>
1923
+ S.Struct({
1924
+ key: S.String,
1925
+ value: S.optional(S.String),
1926
+ }),
1927
+ ).annotate({ identifier: "ResourceTagsV1" });
1928
+ case 3:
1929
+ return S.Array(__S(170, __c21, 2));
1930
+ case 4:
1931
+ return S.suspend(() =>
1932
+ S.Struct({
1933
+ protocol: S.optional(S.String),
1934
+ host: S.optional(S.String),
1935
+ port: S.optional(S.Number),
1936
+ username: S.optional(S.NullOr(S.String)),
1937
+ }),
1938
+ ).annotate({ identifier: "ServiceEndpoint" });
1939
+ case 5:
1940
+ return S.Array(__S(172, __c21, 4));
1941
+ case 6:
1942
+ return S.suspend(() =>
1943
+ S.Struct({
1944
+ effectiveAutoscalingMode: S.optional(S.String),
1945
+ effectiveMinReplicaMemoryGb: S.optional(S.Number),
1946
+ effectiveMaxReplicaMemoryGb: S.optional(S.Number),
1947
+ effectiveMinReplicas: S.optional(S.Number),
1948
+ effectiveMaxReplicas: S.optional(S.Number),
1949
+ effectiveIdleScaling: S.optional(S.Boolean),
1950
+ effectiveIdleTimeoutMinutes: S.optional(S.Number),
1951
+ activeEntryId: S.optional(S.String),
1952
+ }),
1953
+ ).annotate({ identifier: "CurrentScaling" });
1954
+ }
1955
+ }
1956
+ function __c22(j: number): any {
1957
+ switch (j) {
1958
+ case 0:
1959
+ return S.suspend(() =>
1960
+ S.Struct({
1961
+ id: S.String,
1962
+ name: S.optional(S.String),
1963
+ provider: S.optional(S.String),
1964
+ region: S.optional(S.String),
1965
+ state: S.optional(S.String),
1966
+ clickhouseVersion: S.optional(S.String),
1967
+ endpoints: S.optional(__S(173, __c21, 5)),
1968
+ tier: S.optional(S.String),
1969
+ minTotalMemoryGb: S.optional(S.Number),
1970
+ maxTotalMemoryGb: S.optional(S.Number),
1971
+ minReplicaMemoryGb: S.optional(S.Number),
1972
+ maxReplicaMemoryGb: S.optional(S.Number),
1973
+ numReplicas: S.optional(S.Number),
1974
+ minReplicas: S.optional(S.Number),
1975
+ maxReplicas: S.optional(S.Number),
1976
+ autoscalingMode: S.String,
1977
+ replicaMemoryGb: S.optional(S.Number),
1978
+ idleScaling: S.optional(S.Boolean),
1979
+ idleTimeoutMinutes: S.optional(S.Number),
1980
+ ipAccessList: S.optional(__S(169, __c21, 1)),
1981
+ createdAt: S.optional(S.String),
1982
+ encryptionKey: S.optional(S.String.pipe(T.SensitiveValue({}))),
1983
+ encryptionAssumedRoleIdentifier: S.optional(S.String),
1984
+ iamRole: S.optional(S.String),
1985
+ privateEndpointIds: S.optional(__S(160, __c20, 0)),
1986
+ availablePrivateEndpointIds: S.optional(__S(160, __c20, 0)),
1987
+ dataWarehouseId: S.optional(S.String),
1988
+ isPrimary: S.optional(S.Boolean),
1989
+ isReadonly: S.optional(S.Boolean),
1990
+ releaseChannel: S.optional(S.String),
1991
+ byocId: S.optional(S.String),
1992
+ hasTransparentDataEncryption: S.optional(S.Boolean),
1993
+ profile: S.optional(S.String),
1994
+ transparentDataEncryptionKeyId: S.optional(S.String),
1995
+ encryptionRoleId: S.optional(S.String),
1996
+ complianceType: S.optional(S.String),
1997
+ tags: S.optional(__S(171, __c21, 3)),
1998
+ enableCoreDumps: S.optional(S.Boolean),
1999
+ deletionProtection: S.optional(S.Boolean),
2000
+ scalingSchedule: S.optional(__S(156, __c19, 4)),
2001
+ currentScaling: __S(174, __c21, 6),
2002
+ }),
2003
+ ).annotate({ identifier: "Service" });
2004
+ }
2005
+ }
2006
+ function __c23(j: number): any {
2007
+ switch (j) {
2008
+ case 0:
2009
+ return S.suspend(() =>
2010
+ S.Struct({
2011
+ protocol: S.optional(S.String),
2012
+ enabled: S.optional(S.Boolean),
2013
+ }),
2014
+ ).annotate({ identifier: "ServiceEndpointChange" });
2015
+ case 1:
2016
+ return S.Array(__S(184, __c23, 0));
2017
+ }
2018
+ }
2019
+ function __c24(j: number): any {
2020
+ switch (j) {
2021
+ case 0:
2022
+ return S.suspend(() =>
2023
+ S.Struct({
2024
+ organizationId: S.String.pipe(T.Label()),
2025
+ serviceId: S.String.pipe(T.Label()),
2026
+ id: S.String,
2027
+ description: S.optional(S.String),
2028
+ }).pipe(
2029
+ T.Http({
2030
+ method: "POST",
2031
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/privateEndpoint",
2032
+ code: 200,
2033
+ }),
2034
+ ),
2035
+ ).annotate({ identifier: "CreateServicePrivateEndpointRequest" });
2036
+ case 1:
2037
+ return S.suspend(() =>
2038
+ S.Struct({
2039
+ id: S.optional(S.String),
2040
+ description: S.optional(S.String),
2041
+ cloudProvider: S.optional(S.String),
2042
+ region: S.optional(S.String),
2043
+ }),
2044
+ ).annotate({ identifier: "InstancePrivateEndpoint" });
2045
+ }
2046
+ }
2047
+ function __c25(j: number): any {
2048
+ switch (j) {
2049
+ case 0:
2050
+ return S.suspend(() =>
2051
+ S.Struct({
2052
+ organizationId: S.String.pipe(T.Label()),
2053
+ serviceId: S.String.pipe(T.Label()),
2054
+ }).pipe(
2055
+ T.Http({
2056
+ method: "DELETE",
2057
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule",
2058
+ code: 200,
2059
+ }),
2060
+ ),
2061
+ ).annotate({ identifier: "DeleteScalingScheduleRequest" });
2062
+ }
2063
+ }
2064
+ function __c26(j: number): any {
2065
+ switch (j) {
2066
+ case 0:
2067
+ return S.suspend(() =>
2068
+ S.Struct({
2069
+ status: S.optional(S.Number),
2070
+ requestId: S.optional(S.String),
2071
+ }),
2072
+ ).annotate({ identifier: "DeleteScalingScheduleResponse" });
2073
+ }
2074
+ }
2075
+ function __c27(j: number): any {
2076
+ switch (j) {
2077
+ case 0:
2078
+ return S.suspend(() =>
2079
+ S.Struct({
2080
+ organizationId: S.String.pipe(T.Label()),
2081
+ serviceId: S.String.pipe(T.Label()),
2082
+ }).pipe(
2083
+ T.Http({
2084
+ method: "DELETE",
2085
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}",
2086
+ code: 200,
2087
+ }),
2088
+ ),
2089
+ ).annotate({ identifier: "DeleteServiceRequest" });
2090
+ }
2091
+ }
2092
+ function __c28(j: number): any {
2093
+ switch (j) {
2094
+ case 0:
2095
+ return S.suspend(() =>
2096
+ S.Struct({
2097
+ organizationId: S.String.pipe(T.Label()),
2098
+ serviceId: S.String.pipe(T.Label()),
2099
+ }).pipe(
2100
+ T.Http({
2101
+ method: "DELETE",
2102
+ uri: "/v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint",
2103
+ code: 200,
2104
+ }),
2105
+ ),
2106
+ ).annotate({ identifier: "DeleteServiceQueryEndpointRequest" });
2107
+ }
2108
+ }
2109
+ // Schema table: entry i is schema j of builder f, made on first reach.
2110
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
2111
+ return (__s[i] ??= __L.at(f, j));
2112
+ }