@databricks/sdk-instancepools 0.0.0-dev → 0.1.0-dev.1
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.
- package/LICENSE +203 -0
- package/dist/v2/client.d.ts +22 -0
- package/dist/v2/client.d.ts.map +1 -0
- package/dist/v2/client.js +170 -0
- package/dist/v2/client.js.map +1 -0
- package/dist/v2/index.d.ts +4 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +4 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/model.d.ts +733 -0
- package/dist/v2/model.d.ts.map +1 -0
- package/dist/v2/model.js +554 -0
- package/dist/v2/model.js.map +1 -0
- package/dist/v2/transport.d.ts +5 -0
- package/dist/v2/transport.d.ts.map +1 -0
- package/dist/v2/transport.js +57 -0
- package/dist/v2/transport.js.map +1 -0
- package/dist/v2/utils.d.ts +22 -0
- package/dist/v2/utils.d.ts.map +1 -0
- package/dist/v2/utils.js +113 -0
- package/dist/v2/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v2/client.ts +240 -0
- package/src/v2/index.ts +43 -0
- package/src/v2/model.ts +1258 -0
- package/src/v2/transport.ts +73 -0
- package/src/v2/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
package/src/v2/model.ts
ADDED
|
@@ -0,0 +1,1258 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import {z} from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Availability type used for all subsequent nodes past the `first_on_demand` ones.
|
|
7
|
+
*
|
|
8
|
+
* Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.
|
|
9
|
+
*/
|
|
10
|
+
export enum AwsAvailability {
|
|
11
|
+
/** Use spot instances. */
|
|
12
|
+
SPOT = 'SPOT',
|
|
13
|
+
/** Use on-demand instances. */
|
|
14
|
+
ON_DEMAND = 'ON_DEMAND',
|
|
15
|
+
/**
|
|
16
|
+
* Preferably use spot instances, but fall back to on-demand instances if spot instances cannot
|
|
17
|
+
* be acquired (e.g., if AWS spot prices are too high).
|
|
18
|
+
*/
|
|
19
|
+
SPOT_WITH_FALLBACK = 'SPOT_WITH_FALLBACK',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Availability type used for all subsequent nodes past the `first_on_demand` ones.
|
|
24
|
+
* Note: If `first_on_demand` is zero, this availability type will be used for the entire cluster.
|
|
25
|
+
*/
|
|
26
|
+
export enum AzureAvailability {
|
|
27
|
+
/** Use spot instances. */
|
|
28
|
+
SPOT_AZURE = 'SPOT_AZURE',
|
|
29
|
+
/** Use on-demand instances. */
|
|
30
|
+
ON_DEMAND_AZURE = 'ON_DEMAND_AZURE',
|
|
31
|
+
/**
|
|
32
|
+
* Preferably use spot instances, but fall back to on-demand instances if spot instances cannot
|
|
33
|
+
* be acquired (e.g., if Azure is out of Quota).
|
|
34
|
+
*/
|
|
35
|
+
SPOT_WITH_FALLBACK_AZURE = 'SPOT_WITH_FALLBACK_AZURE',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* All Azure Disk types that <Databricks> supports.
|
|
40
|
+
* See https://docs.microsoft.com/en-us/azure/storage/storage-about-disks-and-vhds-linux#types-of-disks
|
|
41
|
+
*/
|
|
42
|
+
export enum AzureDiskVolumeType {
|
|
43
|
+
/** Premium storage tier, backed by SSDs. */
|
|
44
|
+
PREMIUM_LRS = 'PREMIUM_LRS',
|
|
45
|
+
/** Standard storage tier, backed by HDDs. */
|
|
46
|
+
STANDARD_LRS = 'STANDARD_LRS',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* All EBS volume types that <Databricks> supports.
|
|
51
|
+
* See https://aws.amazon.com/ebs/details/ for details.
|
|
52
|
+
*/
|
|
53
|
+
export enum EbsVolumeType {
|
|
54
|
+
/** Provision extra storage using AWS gp2 EBS volumes. */
|
|
55
|
+
GENERAL_PURPOSE_SSD = 'GENERAL_PURPOSE_SSD',
|
|
56
|
+
/** Provision extra storage using AWS st1 volumes. */
|
|
57
|
+
THROUGHPUT_OPTIMIZED_HDD = 'THROUGHPUT_OPTIMIZED_HDD',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* This field determines whether the instance pool will contain preemptible
|
|
62
|
+
* VMs, on-demand VMs, or preemptible VMs with a fallback to on-demand VMs if the former is unavailable.
|
|
63
|
+
*/
|
|
64
|
+
export enum GcpAvailability {
|
|
65
|
+
PREEMPTIBLE_GCP = 'PREEMPTIBLE_GCP',
|
|
66
|
+
ON_DEMAND_GCP = 'ON_DEMAND_GCP',
|
|
67
|
+
PREEMPTIBLE_WITH_FALLBACK_GCP = 'PREEMPTIBLE_WITH_FALLBACK_GCP',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The state of a Cluster. The current allowable state transitions are as follows:
|
|
72
|
+
*
|
|
73
|
+
* - ``ACTIVE`` -> ``STOPPED``
|
|
74
|
+
* - ``ACTIVE`` -> ``DELETED``
|
|
75
|
+
* - ``STOPPED`` -> ``ACTIVE``
|
|
76
|
+
* - ``STOPPED`` -> ``DELETED``
|
|
77
|
+
*/
|
|
78
|
+
export enum InstancePoolState {
|
|
79
|
+
/** Indicates an instance pool is active for use. */
|
|
80
|
+
ACTIVE = 'ACTIVE',
|
|
81
|
+
/**
|
|
82
|
+
* Indicates an instance pool has been stopped so no more clusters should be able to get instances
|
|
83
|
+
* from the pool.
|
|
84
|
+
*/
|
|
85
|
+
STOPPED = 'STOPPED',
|
|
86
|
+
/** Indicates the instance pool has been deleted and should no longer exist. */
|
|
87
|
+
DELETED = 'DELETED',
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface CreateInstancePoolRequest {
|
|
91
|
+
/**
|
|
92
|
+
* Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100
|
|
93
|
+
* characters.
|
|
94
|
+
*/
|
|
95
|
+
instancePoolName?: string | undefined;
|
|
96
|
+
/** Minimum number of idle instances to keep in the instance pool */
|
|
97
|
+
minIdleInstances?: number | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Maximum number of outstanding instances to keep in the pool, including both instances used by
|
|
100
|
+
* clusters and idle instances. Clusters that require further instance provisioning will fail during
|
|
101
|
+
* upsize requests.
|
|
102
|
+
*/
|
|
103
|
+
maxCapacity?: number | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Attributes related to instance pools running on Amazon Web Services.
|
|
106
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
107
|
+
*/
|
|
108
|
+
awsAttributes?: InstancePoolAwsAttributes | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* This field encodes, through a single value, the resources available to each of
|
|
111
|
+
* the Spark nodes in this cluster. For example, the Spark nodes can be provisioned
|
|
112
|
+
* and optimized for memory or compute intensive workloads. A list of available node
|
|
113
|
+
* types can be retrieved by using the :method:clusters/listNodeTypes API call.
|
|
114
|
+
*/
|
|
115
|
+
nodeTypeId?: string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Additional tags for pool resources. <Databricks> will tag all pool resources (e.g., AWS
|
|
118
|
+
* instances and EBS volumes) with these tags in addition to `default_tags`. Notes:
|
|
119
|
+
*
|
|
120
|
+
* - Currently, <Databricks> allows at most 45 custom tags
|
|
121
|
+
*/
|
|
122
|
+
customTags?: Record<string, string> | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Automatically terminates the extra instances in the pool cache after they are inactive for this
|
|
125
|
+
* time in minutes if min_idle_instances requirement is already met. If not set, the extra pool
|
|
126
|
+
* instances will be automatically terminated after a default timeout. If specified, the
|
|
127
|
+
* threshold must be between 0 and 10000 minutes.
|
|
128
|
+
* Users can also set this value to 0 to instantly remove idle instances from the cache if
|
|
129
|
+
* min cache size could still hold.
|
|
130
|
+
*/
|
|
131
|
+
idleInstanceAutoterminationMinutes?: number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire
|
|
134
|
+
* additional disk space when its Spark workers are running low on disk space. In AWS, this
|
|
135
|
+
* feature requires specific AWS permissions to function correctly - refer to the User Guide for
|
|
136
|
+
* more details.
|
|
137
|
+
*/
|
|
138
|
+
enableElasticDisk?: boolean | undefined;
|
|
139
|
+
/** Defines the specification of the disks that will be attached to all spark containers. */
|
|
140
|
+
diskSpec?: DiskSpec | undefined;
|
|
141
|
+
/** Custom Docker Image BYOC */
|
|
142
|
+
preloadedDockerImages?: DockerImage[] | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started
|
|
145
|
+
* with the preloaded Spark version will start faster. A list of available Spark versions
|
|
146
|
+
* can be retrieved by using the :method:clusters/sparkVersions API call.
|
|
147
|
+
*/
|
|
148
|
+
preloadedSparkVersions?: string[] | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Attributes related to instance pools running on Azure.
|
|
151
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
152
|
+
*/
|
|
153
|
+
azureAttributes?: InstancePoolAzureAttributes | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* Attributes related to instance pools running on Google Cloud Platform.
|
|
156
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
157
|
+
*/
|
|
158
|
+
gcpAttributes?: InstancePoolGcpAttributes | undefined;
|
|
159
|
+
/** Flexible node type configuration for the pool. */
|
|
160
|
+
nodeTypeFlexibility?: NodeTypeFlexibility | undefined;
|
|
161
|
+
/** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
162
|
+
remoteDiskThroughput?: number | undefined;
|
|
163
|
+
/** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
164
|
+
totalInitialRemoteDiskSize?: number | undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
168
|
+
export interface CreateInstancePoolRequest_CustomTagsEntry {
|
|
169
|
+
/**
|
|
170
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
171
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
172
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
173
|
+
*/
|
|
174
|
+
key?: string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
177
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
178
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
179
|
+
*/
|
|
180
|
+
value?: string | undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
184
|
+
export interface CreateInstancePoolRequest_Response {
|
|
185
|
+
/** The ID of the created instance pool. */
|
|
186
|
+
instancePoolId?: string | undefined;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface DeleteInstancePoolRequest {
|
|
190
|
+
/** The instance pool to be terminated. */
|
|
191
|
+
instancePoolId?: string | undefined;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
195
|
+
export interface DeleteInstancePoolRequest_Response {}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Describes the disks that are launched for each instance in the spark cluster.
|
|
199
|
+
* For example, if the cluster has 3 instances, each instance is configured to launch
|
|
200
|
+
* 2 disks, 100 GiB each, then <Databricks> will launch a total of 6 disks,
|
|
201
|
+
* 100 GiB each, for this cluster.
|
|
202
|
+
*/
|
|
203
|
+
export interface DiskSpec {
|
|
204
|
+
/** The type of disks that will be launched with this cluster. */
|
|
205
|
+
diskType?: DiskType | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* The number of disks launched for each instance:
|
|
208
|
+
* - This feature is only enabled for supported node types.
|
|
209
|
+
* - Users can choose up to the limit of the disks supported by the node type.
|
|
210
|
+
* - For node types with no OS disk, at least one disk must be specified;
|
|
211
|
+
* otherwise, cluster creation will fail.
|
|
212
|
+
*
|
|
213
|
+
* If disks are attached, <Databricks> will configure Spark to use only the disks for
|
|
214
|
+
* scratch storage, because heterogenously sized scratch devices can lead to inefficient disk
|
|
215
|
+
* utilization. If no disks are attached, <Databricks> will configure Spark to use
|
|
216
|
+
* instance store disks.
|
|
217
|
+
*
|
|
218
|
+
* Note: If disks are specified, then the Spark configuration
|
|
219
|
+
* `spark.local.dir` will be overridden.
|
|
220
|
+
*
|
|
221
|
+
* Disks will be mounted at:
|
|
222
|
+
* - For AWS: `/ebs0`, `/ebs1`, and etc.
|
|
223
|
+
* - For Azure: `/remote_volume0`, `/remote_volume1`, and etc.
|
|
224
|
+
*/
|
|
225
|
+
diskCount?: number | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* The size of each disk (in GiB) launched for each instance.
|
|
228
|
+
* Values must fall into the supported range for a particular instance type.
|
|
229
|
+
*
|
|
230
|
+
* For AWS:
|
|
231
|
+
* - General Purpose SSD: 100 - 4096 GiB
|
|
232
|
+
* - Throughput Optimized HDD: 500 - 4096 GiB
|
|
233
|
+
*
|
|
234
|
+
* For Azure:
|
|
235
|
+
* - Premium LRS (SSD): 1 - 1023 GiB
|
|
236
|
+
* - Standard LRS (HDD): 1- 1023 GiB
|
|
237
|
+
*/
|
|
238
|
+
diskSize?: number | undefined;
|
|
239
|
+
diskIops?: number | undefined;
|
|
240
|
+
diskThroughput?: number | undefined;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Describes the disk type. */
|
|
244
|
+
export interface DiskType {
|
|
245
|
+
remoteVolumeType?:
|
|
246
|
+
| {$case: 'ebsVolumeType'; ebsVolumeType: EbsVolumeType}
|
|
247
|
+
| {$case: 'azureDiskVolumeType'; azureDiskVolumeType: AzureDiskVolumeType}
|
|
248
|
+
| undefined;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface DockerBasicAuth {
|
|
252
|
+
/** Name of the user */
|
|
253
|
+
username?: string | undefined;
|
|
254
|
+
/** Password of the user */
|
|
255
|
+
password?: string | undefined;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface DockerImage {
|
|
259
|
+
/** URL of the docker image. */
|
|
260
|
+
url?: string | undefined;
|
|
261
|
+
credsOneof?:
|
|
262
|
+
| {
|
|
263
|
+
$case: 'basicAuth';
|
|
264
|
+
/** Basic auth with username and password */
|
|
265
|
+
basicAuth: DockerBasicAuth;
|
|
266
|
+
}
|
|
267
|
+
| undefined;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface EditInstancePoolRequest {
|
|
271
|
+
/** Instance pool ID */
|
|
272
|
+
instancePoolId?: string | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100
|
|
275
|
+
* characters.
|
|
276
|
+
*/
|
|
277
|
+
instancePoolName?: string | undefined;
|
|
278
|
+
/** Minimum number of idle instances to keep in the instance pool */
|
|
279
|
+
minIdleInstances?: number | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* Maximum number of outstanding instances to keep in the pool, including both instances used by
|
|
282
|
+
* clusters and idle instances. Clusters that require further instance provisioning will fail during
|
|
283
|
+
* upsize requests.
|
|
284
|
+
*/
|
|
285
|
+
maxCapacity?: number | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* Attributes related to instance pools running on Amazon Web Services.
|
|
288
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
289
|
+
*/
|
|
290
|
+
awsAttributes?: InstancePoolAwsAttributes | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* This field encodes, through a single value, the resources available to each of
|
|
293
|
+
* the Spark nodes in this cluster. For example, the Spark nodes can be provisioned
|
|
294
|
+
* and optimized for memory or compute intensive workloads. A list of available node
|
|
295
|
+
* types can be retrieved by using the :method:clusters/listNodeTypes API call.
|
|
296
|
+
*/
|
|
297
|
+
nodeTypeId?: string | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* Additional tags for pool resources. <Databricks> will tag all pool resources (e.g., AWS
|
|
300
|
+
* instances and EBS volumes) with these tags in addition to `default_tags`. Notes:
|
|
301
|
+
*
|
|
302
|
+
* - Currently, <Databricks> allows at most 45 custom tags
|
|
303
|
+
*/
|
|
304
|
+
customTags?: Record<string, string> | undefined;
|
|
305
|
+
/**
|
|
306
|
+
* Automatically terminates the extra instances in the pool cache after they are inactive for this
|
|
307
|
+
* time in minutes if min_idle_instances requirement is already met. If not set, the extra pool
|
|
308
|
+
* instances will be automatically terminated after a default timeout. If specified, the
|
|
309
|
+
* threshold must be between 0 and 10000 minutes.
|
|
310
|
+
* Users can also set this value to 0 to instantly remove idle instances from the cache if
|
|
311
|
+
* min cache size could still hold.
|
|
312
|
+
*/
|
|
313
|
+
idleInstanceAutoterminationMinutes?: number | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire
|
|
316
|
+
* additional disk space when its Spark workers are running low on disk space. In AWS, this
|
|
317
|
+
* feature requires specific AWS permissions to function correctly - refer to the User Guide for
|
|
318
|
+
* more details.
|
|
319
|
+
*/
|
|
320
|
+
enableElasticDisk?: boolean | undefined;
|
|
321
|
+
/** Defines the specification of the disks that will be attached to all spark containers. */
|
|
322
|
+
diskSpec?: DiskSpec | undefined;
|
|
323
|
+
/** Custom Docker Image BYOC */
|
|
324
|
+
preloadedDockerImages?: DockerImage[] | undefined;
|
|
325
|
+
/**
|
|
326
|
+
* A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started
|
|
327
|
+
* with the preloaded Spark version will start faster. A list of available Spark versions
|
|
328
|
+
* can be retrieved by using the :method:clusters/sparkVersions API call.
|
|
329
|
+
*/
|
|
330
|
+
preloadedSparkVersions?: string[] | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Attributes related to instance pools running on Azure.
|
|
333
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
334
|
+
*/
|
|
335
|
+
azureAttributes?: InstancePoolAzureAttributes | undefined;
|
|
336
|
+
/**
|
|
337
|
+
* Attributes related to instance pools running on Google Cloud Platform.
|
|
338
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
339
|
+
*/
|
|
340
|
+
gcpAttributes?: InstancePoolGcpAttributes | undefined;
|
|
341
|
+
/** Flexible node type configuration for the pool. */
|
|
342
|
+
nodeTypeFlexibility?: NodeTypeFlexibility | undefined;
|
|
343
|
+
/** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
344
|
+
remoteDiskThroughput?: number | undefined;
|
|
345
|
+
/** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
346
|
+
totalInitialRemoteDiskSize?: number | undefined;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
350
|
+
export interface EditInstancePoolRequest_CustomTagsEntry {
|
|
351
|
+
/**
|
|
352
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
353
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
354
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
355
|
+
*/
|
|
356
|
+
key?: string | undefined;
|
|
357
|
+
/**
|
|
358
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
359
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
360
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
361
|
+
*/
|
|
362
|
+
value?: string | undefined;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
366
|
+
export interface EditInstancePoolRequest_Response {}
|
|
367
|
+
|
|
368
|
+
export interface GetInstancePoolRequest {
|
|
369
|
+
/** The canonical unique identifier for the instance pool. */
|
|
370
|
+
instancePoolId?: string | undefined;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
374
|
+
export interface GetInstancePoolRequest_Response {
|
|
375
|
+
/** Usage statistics about the instance pool. */
|
|
376
|
+
stats?: InstancePoolStats | undefined;
|
|
377
|
+
/** Status of failed pending instances in the pool. */
|
|
378
|
+
status?: InstancePoolStatus | undefined;
|
|
379
|
+
/** Canonical unique identifier for the pool. */
|
|
380
|
+
instancePoolId?: string | undefined;
|
|
381
|
+
/**
|
|
382
|
+
* Tags that are added by <Databricks> regardless of any ``custom_tags``, including:
|
|
383
|
+
*
|
|
384
|
+
* - Vendor: <Databricks>
|
|
385
|
+
*
|
|
386
|
+
* - InstancePoolCreator: <user_id_of_creator>
|
|
387
|
+
*
|
|
388
|
+
* - InstancePoolName: <name_of_pool>
|
|
389
|
+
*
|
|
390
|
+
* - InstancePoolId: <id_of_pool>
|
|
391
|
+
*/
|
|
392
|
+
defaultTags?: Record<string, string> | undefined;
|
|
393
|
+
/** Current state of the instance pool. */
|
|
394
|
+
state?: InstancePoolState | undefined;
|
|
395
|
+
/**
|
|
396
|
+
* Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100
|
|
397
|
+
* characters.
|
|
398
|
+
*/
|
|
399
|
+
instancePoolName?: string | undefined;
|
|
400
|
+
/** Minimum number of idle instances to keep in the instance pool */
|
|
401
|
+
minIdleInstances?: number | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* Maximum number of outstanding instances to keep in the pool, including both instances used by
|
|
404
|
+
* clusters and idle instances. Clusters that require further instance provisioning will fail during
|
|
405
|
+
* upsize requests.
|
|
406
|
+
*/
|
|
407
|
+
maxCapacity?: number | undefined;
|
|
408
|
+
/**
|
|
409
|
+
* Attributes related to instance pools running on Amazon Web Services.
|
|
410
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
411
|
+
*/
|
|
412
|
+
awsAttributes?: InstancePoolAwsAttributes | undefined;
|
|
413
|
+
/**
|
|
414
|
+
* This field encodes, through a single value, the resources available to each of
|
|
415
|
+
* the Spark nodes in this cluster. For example, the Spark nodes can be provisioned
|
|
416
|
+
* and optimized for memory or compute intensive workloads. A list of available node
|
|
417
|
+
* types can be retrieved by using the :method:clusters/listNodeTypes API call.
|
|
418
|
+
*/
|
|
419
|
+
nodeTypeId?: string | undefined;
|
|
420
|
+
/**
|
|
421
|
+
* Additional tags for pool resources. <Databricks> will tag all pool resources (e.g., AWS
|
|
422
|
+
* instances and EBS volumes) with these tags in addition to `default_tags`. Notes:
|
|
423
|
+
*
|
|
424
|
+
* - Currently, <Databricks> allows at most 45 custom tags
|
|
425
|
+
*/
|
|
426
|
+
customTags?: Record<string, string> | undefined;
|
|
427
|
+
/**
|
|
428
|
+
* Automatically terminates the extra instances in the pool cache after they are inactive for this
|
|
429
|
+
* time in minutes if min_idle_instances requirement is already met. If not set, the extra pool
|
|
430
|
+
* instances will be automatically terminated after a default timeout. If specified, the
|
|
431
|
+
* threshold must be between 0 and 10000 minutes.
|
|
432
|
+
* Users can also set this value to 0 to instantly remove idle instances from the cache if
|
|
433
|
+
* min cache size could still hold.
|
|
434
|
+
*/
|
|
435
|
+
idleInstanceAutoterminationMinutes?: number | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire
|
|
438
|
+
* additional disk space when its Spark workers are running low on disk space. In AWS, this
|
|
439
|
+
* feature requires specific AWS permissions to function correctly - refer to the User Guide for
|
|
440
|
+
* more details.
|
|
441
|
+
*/
|
|
442
|
+
enableElasticDisk?: boolean | undefined;
|
|
443
|
+
/** Defines the specification of the disks that will be attached to all spark containers. */
|
|
444
|
+
diskSpec?: DiskSpec | undefined;
|
|
445
|
+
/** Custom Docker Image BYOC */
|
|
446
|
+
preloadedDockerImages?: DockerImage[] | undefined;
|
|
447
|
+
/**
|
|
448
|
+
* A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started
|
|
449
|
+
* with the preloaded Spark version will start faster. A list of available Spark versions
|
|
450
|
+
* can be retrieved by using the :method:clusters/sparkVersions API call.
|
|
451
|
+
*/
|
|
452
|
+
preloadedSparkVersions?: string[] | undefined;
|
|
453
|
+
/**
|
|
454
|
+
* Attributes related to instance pools running on Azure.
|
|
455
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
456
|
+
*/
|
|
457
|
+
azureAttributes?: InstancePoolAzureAttributes | undefined;
|
|
458
|
+
/**
|
|
459
|
+
* Attributes related to instance pools running on Google Cloud Platform.
|
|
460
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
461
|
+
*/
|
|
462
|
+
gcpAttributes?: InstancePoolGcpAttributes | undefined;
|
|
463
|
+
/** Flexible node type configuration for the pool. */
|
|
464
|
+
nodeTypeFlexibility?: NodeTypeFlexibility | undefined;
|
|
465
|
+
/** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
466
|
+
remoteDiskThroughput?: number | undefined;
|
|
467
|
+
/** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
468
|
+
totalInitialRemoteDiskSize?: number | undefined;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
472
|
+
export interface GetInstancePoolRequest_Response_CustomTagsEntry {
|
|
473
|
+
/**
|
|
474
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
475
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
476
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
477
|
+
*/
|
|
478
|
+
key?: string | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
481
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
482
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
483
|
+
*/
|
|
484
|
+
value?: string | undefined;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
488
|
+
export interface GetInstancePoolRequest_Response_DefaultTagsEntry {
|
|
489
|
+
/**
|
|
490
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
491
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
492
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
493
|
+
*/
|
|
494
|
+
key?: string | undefined;
|
|
495
|
+
/**
|
|
496
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
497
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
498
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
499
|
+
*/
|
|
500
|
+
value?: string | undefined;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export interface InstancePoolAndStats {
|
|
504
|
+
/** Usage statistics about the instance pool. */
|
|
505
|
+
stats?: InstancePoolStats | undefined;
|
|
506
|
+
/** Status of failed pending instances in the pool. */
|
|
507
|
+
status?: InstancePoolStatus | undefined;
|
|
508
|
+
/** Canonical unique identifier for the pool. */
|
|
509
|
+
instancePoolId?: string | undefined;
|
|
510
|
+
/**
|
|
511
|
+
* Tags that are added by <Databricks> regardless of any ``custom_tags``, including:
|
|
512
|
+
*
|
|
513
|
+
* - Vendor: <Databricks>
|
|
514
|
+
*
|
|
515
|
+
* - InstancePoolCreator: <user_id_of_creator>
|
|
516
|
+
*
|
|
517
|
+
* - InstancePoolName: <name_of_pool>
|
|
518
|
+
*
|
|
519
|
+
* - InstancePoolId: <id_of_pool>
|
|
520
|
+
*/
|
|
521
|
+
defaultTags?: Record<string, string> | undefined;
|
|
522
|
+
/** Current state of the instance pool. */
|
|
523
|
+
state?: InstancePoolState | undefined;
|
|
524
|
+
/**
|
|
525
|
+
* Pool name requested by the user. Pool name must be unique. Length must be between 1 and 100
|
|
526
|
+
* characters.
|
|
527
|
+
*/
|
|
528
|
+
instancePoolName?: string | undefined;
|
|
529
|
+
/** Minimum number of idle instances to keep in the instance pool */
|
|
530
|
+
minIdleInstances?: number | undefined;
|
|
531
|
+
/**
|
|
532
|
+
* Maximum number of outstanding instances to keep in the pool, including both instances used by
|
|
533
|
+
* clusters and idle instances. Clusters that require further instance provisioning will fail during
|
|
534
|
+
* upsize requests.
|
|
535
|
+
*/
|
|
536
|
+
maxCapacity?: number | undefined;
|
|
537
|
+
/**
|
|
538
|
+
* Attributes related to instance pools running on Amazon Web Services.
|
|
539
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
540
|
+
*/
|
|
541
|
+
awsAttributes?: InstancePoolAwsAttributes | undefined;
|
|
542
|
+
/**
|
|
543
|
+
* This field encodes, through a single value, the resources available to each of
|
|
544
|
+
* the Spark nodes in this cluster. For example, the Spark nodes can be provisioned
|
|
545
|
+
* and optimized for memory or compute intensive workloads. A list of available node
|
|
546
|
+
* types can be retrieved by using the :method:clusters/listNodeTypes API call.
|
|
547
|
+
*/
|
|
548
|
+
nodeTypeId?: string | undefined;
|
|
549
|
+
/**
|
|
550
|
+
* Additional tags for pool resources. <Databricks> will tag all pool resources (e.g., AWS
|
|
551
|
+
* instances and EBS volumes) with these tags in addition to `default_tags`. Notes:
|
|
552
|
+
*
|
|
553
|
+
* - Currently, <Databricks> allows at most 45 custom tags
|
|
554
|
+
*/
|
|
555
|
+
customTags?: Record<string, string> | undefined;
|
|
556
|
+
/**
|
|
557
|
+
* Automatically terminates the extra instances in the pool cache after they are inactive for this
|
|
558
|
+
* time in minutes if min_idle_instances requirement is already met. If not set, the extra pool
|
|
559
|
+
* instances will be automatically terminated after a default timeout. If specified, the
|
|
560
|
+
* threshold must be between 0 and 10000 minutes.
|
|
561
|
+
* Users can also set this value to 0 to instantly remove idle instances from the cache if
|
|
562
|
+
* min cache size could still hold.
|
|
563
|
+
*/
|
|
564
|
+
idleInstanceAutoterminationMinutes?: number | undefined;
|
|
565
|
+
/**
|
|
566
|
+
* Autoscaling Local Storage: when enabled, this instances in this pool will dynamically acquire
|
|
567
|
+
* additional disk space when its Spark workers are running low on disk space. In AWS, this
|
|
568
|
+
* feature requires specific AWS permissions to function correctly - refer to the User Guide for
|
|
569
|
+
* more details.
|
|
570
|
+
*/
|
|
571
|
+
enableElasticDisk?: boolean | undefined;
|
|
572
|
+
/** Defines the specification of the disks that will be attached to all spark containers. */
|
|
573
|
+
diskSpec?: DiskSpec | undefined;
|
|
574
|
+
/** Custom Docker Image BYOC */
|
|
575
|
+
preloadedDockerImages?: DockerImage[] | undefined;
|
|
576
|
+
/**
|
|
577
|
+
* A list containing at most one preloaded Spark image version for the pool. Pool-backed clusters started
|
|
578
|
+
* with the preloaded Spark version will start faster. A list of available Spark versions
|
|
579
|
+
* can be retrieved by using the :method:clusters/sparkVersions API call.
|
|
580
|
+
*/
|
|
581
|
+
preloadedSparkVersions?: string[] | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* Attributes related to instance pools running on Azure.
|
|
584
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
585
|
+
*/
|
|
586
|
+
azureAttributes?: InstancePoolAzureAttributes | undefined;
|
|
587
|
+
/**
|
|
588
|
+
* Attributes related to instance pools running on Google Cloud Platform.
|
|
589
|
+
* If not specified at pool creation, a set of default values will be used.
|
|
590
|
+
*/
|
|
591
|
+
gcpAttributes?: InstancePoolGcpAttributes | undefined;
|
|
592
|
+
/** Flexible node type configuration for the pool. */
|
|
593
|
+
nodeTypeFlexibility?: NodeTypeFlexibility | undefined;
|
|
594
|
+
/** If set, what the configurable throughput (in Mb/s) for the remote disk is. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
595
|
+
remoteDiskThroughput?: number | undefined;
|
|
596
|
+
/** If set, what the total initial volume size (in GB) of the remote disks should be. Currently only supported for GCP HYPERDISK_BALANCED types. */
|
|
597
|
+
totalInitialRemoteDiskSize?: number | undefined;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
601
|
+
export interface InstancePoolAndStats_CustomTagsEntry {
|
|
602
|
+
/**
|
|
603
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
604
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
605
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
606
|
+
*/
|
|
607
|
+
key?: string | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
610
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
611
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
612
|
+
*/
|
|
613
|
+
value?: string | undefined;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
617
|
+
export interface InstancePoolAndStats_DefaultTagsEntry {
|
|
618
|
+
/**
|
|
619
|
+
* The key of the tag. The key length must be between 1 and 127 UTF-8 characters, inclusive.
|
|
620
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
621
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
622
|
+
*/
|
|
623
|
+
key?: string | undefined;
|
|
624
|
+
/**
|
|
625
|
+
* The value of the tag. The value length must be less than or equal to 255 UTF-8 characters.
|
|
626
|
+
* For a list of all restrictions, see the AWS docs here:
|
|
627
|
+
* http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
|
|
628
|
+
*/
|
|
629
|
+
value?: string | undefined;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/** Attributes set during instance pool creation which are related to Amazon Web Services. */
|
|
633
|
+
export interface InstancePoolAwsAttributes {
|
|
634
|
+
/** Availability type used for the spot nodes. */
|
|
635
|
+
availability?: AwsAvailability | undefined;
|
|
636
|
+
/**
|
|
637
|
+
* Identifier for the availability zone/datacenter in which the cluster resides.
|
|
638
|
+
* This string will be of a form like "us-west-2a". The provided availability
|
|
639
|
+
* zone must be in the same region as the <Databricks> deployment. For example, "us-west-2a"
|
|
640
|
+
* is not a valid zone id if the <Databricks> deployment resides in the "us-east-1" region.
|
|
641
|
+
* This is an optional field at cluster creation, and if not specified, a default zone will be used.
|
|
642
|
+
* The list of available zones as well as the default value can be found by using the
|
|
643
|
+
* `List Zones` method.
|
|
644
|
+
*/
|
|
645
|
+
zoneId?: string | undefined;
|
|
646
|
+
/**
|
|
647
|
+
* Calculates the bid price for AWS spot instances, as a percentage of the corresponding instance type's
|
|
648
|
+
* on-demand price.
|
|
649
|
+
* For example, if this field is set to 50, and the cluster needs a new `r3.xlarge` spot
|
|
650
|
+
* instance, then the bid price is half of the price of
|
|
651
|
+
* on-demand `r3.xlarge` instances. Similarly, if this field is set to 200, the bid price is twice
|
|
652
|
+
* the price of on-demand `r3.xlarge` instances. If not specified, the default value is 100.
|
|
653
|
+
* When spot instances are requested for this cluster, only spot instances whose bid price
|
|
654
|
+
* percentage matches this field will be considered.
|
|
655
|
+
* Note that, for safety, we enforce this field to be no more than 10000.
|
|
656
|
+
*/
|
|
657
|
+
spotBidPricePercent?: number | undefined;
|
|
658
|
+
/**
|
|
659
|
+
* All AWS instances belonging to the instance pool will have this instance profile. If omitted, instances
|
|
660
|
+
* will initially be launched with the workspace's default instance profile. If defined, clusters that use the
|
|
661
|
+
* pool will inherit the instance profile, and must not specify their own instance profile on cluster creation or
|
|
662
|
+
* update. If the pool does not specify an instance profile, clusters using the pool may specify any instance profile.
|
|
663
|
+
* The instance profile must have previously been added to the <Databricks> environment by an account administrator.
|
|
664
|
+
*
|
|
665
|
+
* This feature may only be available to certain customer plans.
|
|
666
|
+
*/
|
|
667
|
+
instanceProfileArn?: string | undefined;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/** Attributes set during instance pool creation which are related to Azure. */
|
|
671
|
+
export interface InstancePoolAzureAttributes {
|
|
672
|
+
/** Availability type used for the spot nodes. */
|
|
673
|
+
availability?: AzureAvailability | undefined;
|
|
674
|
+
/**
|
|
675
|
+
* With variable pricing, you have option to set a max price, in US dollars (USD)
|
|
676
|
+
* For example, the value 2 would be a max price of $2.00 USD per hour.
|
|
677
|
+
* If you set the max price to be -1, the VM won't be evicted based on price.
|
|
678
|
+
* The price for the VM will be the current price for spot or the price for a standard VM,
|
|
679
|
+
* which ever is less, as long as there is capacity and quota available.
|
|
680
|
+
*/
|
|
681
|
+
spotBidMaxPrice?: number | undefined;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/** Attributes set during instance pool creation which are related to GCP. */
|
|
685
|
+
export interface InstancePoolGcpAttributes {
|
|
686
|
+
gcpAvailability?: GcpAvailability | undefined;
|
|
687
|
+
/**
|
|
688
|
+
* If provided, each node in the instance pool will have this number of local SSDs attached.
|
|
689
|
+
* Each local SSD is 375GB in size. Refer to [GCP documentation](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds)
|
|
690
|
+
* for the supported number of local SSDs for each instance type.
|
|
691
|
+
*/
|
|
692
|
+
localSsdCount?: number | undefined;
|
|
693
|
+
/**
|
|
694
|
+
* Identifier for the availability zone/datacenter in which the cluster resides.
|
|
695
|
+
* This string will be of a form like "us-west1-a". The provided availability
|
|
696
|
+
* zone must be in the same region as the <Databricks> workspace. For example, "us-west1-a"
|
|
697
|
+
* is not a valid zone id if the <Databricks> workspace resides in the "us-east1" region.
|
|
698
|
+
* This is an optional field at instance pool creation, and if not specified, a default zone will be used.
|
|
699
|
+
*
|
|
700
|
+
* This field can be one of the following:
|
|
701
|
+
* - "HA" => High availability, spread nodes across availability zones for a <Databricks> deployment region
|
|
702
|
+
* - A GCP availability zone => Pick One of the available zones for (machine type + region) from https://cloud.google.com/compute/docs/regions-zones (e.g. "us-west1-a").
|
|
703
|
+
*
|
|
704
|
+
* If empty, <Databricks> picks an availability zone to schedule the cluster on.
|
|
705
|
+
*/
|
|
706
|
+
zoneId?: string | undefined;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface InstancePoolStats {
|
|
710
|
+
/** Number of active instances in the pool that are part of a cluster. */
|
|
711
|
+
usedCount?: number | undefined;
|
|
712
|
+
/** Number of active instances in the pool that are NOT part of a cluster. */
|
|
713
|
+
idleCount?: number | undefined;
|
|
714
|
+
/** Number of pending instances in the pool that are part of a cluster. */
|
|
715
|
+
pendingUsedCount?: number | undefined;
|
|
716
|
+
/** Number of pending instances in the pool that are NOT part of a cluster. */
|
|
717
|
+
pendingIdleCount?: number | undefined;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export interface InstancePoolStatus {
|
|
721
|
+
/**
|
|
722
|
+
* List of error messages for the failed pending instances.
|
|
723
|
+
* The pending_instance_errors follows FIFO with maximum length of the min_idle of the pool.
|
|
724
|
+
* The pending_instance_errors is emptied once the number of exiting available instances reaches
|
|
725
|
+
* the min_idle of the pool.
|
|
726
|
+
*/
|
|
727
|
+
pendingInstanceErrors?: PendingInstanceError[] | undefined;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
731
|
+
export interface ListInstancePoolsRequest {}
|
|
732
|
+
|
|
733
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
734
|
+
export interface ListInstancePoolsRequest_Response {
|
|
735
|
+
instancePools?: InstancePoolAndStats[] | undefined;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/** Configuration for flexible node types, allowing fallback to alternate node types during cluster launch and upscale. */
|
|
739
|
+
export interface NodeTypeFlexibility {
|
|
740
|
+
/** A list of node type IDs to use as fallbacks when the primary node type is unavailable. */
|
|
741
|
+
alternateNodeTypeIds?: string[] | undefined;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/** Error message of a failed pending instances */
|
|
745
|
+
export interface PendingInstanceError {
|
|
746
|
+
instanceId?: string | undefined;
|
|
747
|
+
message?: string | undefined;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
751
|
+
export const unmarshalCreateInstancePoolRequest_ResponseSchema: z.ZodType<CreateInstancePoolRequest_Response> =
|
|
752
|
+
z
|
|
753
|
+
.object({
|
|
754
|
+
instance_pool_id: z.string().optional(),
|
|
755
|
+
})
|
|
756
|
+
.transform(d => ({
|
|
757
|
+
instancePoolId: d.instance_pool_id,
|
|
758
|
+
}));
|
|
759
|
+
|
|
760
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
761
|
+
export const unmarshalDeleteInstancePoolRequest_ResponseSchema: z.ZodType<DeleteInstancePoolRequest_Response> =
|
|
762
|
+
z.object({});
|
|
763
|
+
|
|
764
|
+
export const unmarshalDiskSpecSchema: z.ZodType<DiskSpec> = z
|
|
765
|
+
.object({
|
|
766
|
+
disk_type: z.lazy(() => unmarshalDiskTypeSchema).optional(),
|
|
767
|
+
disk_count: z.number().optional(),
|
|
768
|
+
disk_size: z.number().optional(),
|
|
769
|
+
disk_iops: z.number().optional(),
|
|
770
|
+
disk_throughput: z.number().optional(),
|
|
771
|
+
})
|
|
772
|
+
.transform(d => ({
|
|
773
|
+
diskType: d.disk_type,
|
|
774
|
+
diskCount: d.disk_count,
|
|
775
|
+
diskSize: d.disk_size,
|
|
776
|
+
diskIops: d.disk_iops,
|
|
777
|
+
diskThroughput: d.disk_throughput,
|
|
778
|
+
}));
|
|
779
|
+
|
|
780
|
+
export const unmarshalDiskTypeSchema: z.ZodType<DiskType> = z
|
|
781
|
+
.object({
|
|
782
|
+
ebs_volume_type: z.enum(EbsVolumeType).optional(),
|
|
783
|
+
azure_disk_volume_type: z.enum(AzureDiskVolumeType).optional(),
|
|
784
|
+
})
|
|
785
|
+
.transform(d => ({
|
|
786
|
+
remoteVolumeType:
|
|
787
|
+
d.ebs_volume_type !== undefined
|
|
788
|
+
? {$case: 'ebsVolumeType' as const, ebsVolumeType: d.ebs_volume_type}
|
|
789
|
+
: d.azure_disk_volume_type !== undefined
|
|
790
|
+
? {
|
|
791
|
+
$case: 'azureDiskVolumeType' as const,
|
|
792
|
+
azureDiskVolumeType: d.azure_disk_volume_type,
|
|
793
|
+
}
|
|
794
|
+
: undefined,
|
|
795
|
+
}));
|
|
796
|
+
|
|
797
|
+
export const unmarshalDockerBasicAuthSchema: z.ZodType<DockerBasicAuth> = z
|
|
798
|
+
.object({
|
|
799
|
+
username: z.string().optional(),
|
|
800
|
+
password: z.string().optional(),
|
|
801
|
+
})
|
|
802
|
+
.transform(d => ({
|
|
803
|
+
username: d.username,
|
|
804
|
+
password: d.password,
|
|
805
|
+
}));
|
|
806
|
+
|
|
807
|
+
export const unmarshalDockerImageSchema: z.ZodType<DockerImage> = z
|
|
808
|
+
.object({
|
|
809
|
+
url: z.string().optional(),
|
|
810
|
+
basic_auth: z.lazy(() => unmarshalDockerBasicAuthSchema).optional(),
|
|
811
|
+
})
|
|
812
|
+
.transform(d => ({
|
|
813
|
+
url: d.url,
|
|
814
|
+
credsOneof:
|
|
815
|
+
d.basic_auth !== undefined
|
|
816
|
+
? {$case: 'basicAuth' as const, basicAuth: d.basic_auth}
|
|
817
|
+
: undefined,
|
|
818
|
+
}));
|
|
819
|
+
|
|
820
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
821
|
+
export const unmarshalEditInstancePoolRequest_ResponseSchema: z.ZodType<EditInstancePoolRequest_Response> =
|
|
822
|
+
z.object({});
|
|
823
|
+
|
|
824
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
825
|
+
export const unmarshalGetInstancePoolRequest_ResponseSchema: z.ZodType<GetInstancePoolRequest_Response> =
|
|
826
|
+
z
|
|
827
|
+
.object({
|
|
828
|
+
stats: z.lazy(() => unmarshalInstancePoolStatsSchema).optional(),
|
|
829
|
+
status: z.lazy(() => unmarshalInstancePoolStatusSchema).optional(),
|
|
830
|
+
instance_pool_id: z.string().optional(),
|
|
831
|
+
default_tags: z.record(z.string(), z.string()).optional(),
|
|
832
|
+
state: z.enum(InstancePoolState).optional(),
|
|
833
|
+
instance_pool_name: z.string().optional(),
|
|
834
|
+
min_idle_instances: z.number().optional(),
|
|
835
|
+
max_capacity: z.number().optional(),
|
|
836
|
+
aws_attributes: z
|
|
837
|
+
.lazy(() => unmarshalInstancePoolAwsAttributesSchema)
|
|
838
|
+
.optional(),
|
|
839
|
+
node_type_id: z.string().optional(),
|
|
840
|
+
custom_tags: z.record(z.string(), z.string()).optional(),
|
|
841
|
+
idle_instance_autotermination_minutes: z.number().optional(),
|
|
842
|
+
enable_elastic_disk: z.boolean().optional(),
|
|
843
|
+
disk_spec: z.lazy(() => unmarshalDiskSpecSchema).optional(),
|
|
844
|
+
preloaded_docker_images: z
|
|
845
|
+
.array(z.lazy(() => unmarshalDockerImageSchema))
|
|
846
|
+
.optional(),
|
|
847
|
+
preloaded_spark_versions: z.array(z.string()).optional(),
|
|
848
|
+
azure_attributes: z
|
|
849
|
+
.lazy(() => unmarshalInstancePoolAzureAttributesSchema)
|
|
850
|
+
.optional(),
|
|
851
|
+
gcp_attributes: z
|
|
852
|
+
.lazy(() => unmarshalInstancePoolGcpAttributesSchema)
|
|
853
|
+
.optional(),
|
|
854
|
+
node_type_flexibility: z
|
|
855
|
+
.lazy(() => unmarshalNodeTypeFlexibilitySchema)
|
|
856
|
+
.optional(),
|
|
857
|
+
remote_disk_throughput: z.number().optional(),
|
|
858
|
+
total_initial_remote_disk_size: z.number().optional(),
|
|
859
|
+
})
|
|
860
|
+
.transform(d => ({
|
|
861
|
+
stats: d.stats,
|
|
862
|
+
status: d.status,
|
|
863
|
+
instancePoolId: d.instance_pool_id,
|
|
864
|
+
defaultTags: d.default_tags,
|
|
865
|
+
state: d.state,
|
|
866
|
+
instancePoolName: d.instance_pool_name,
|
|
867
|
+
minIdleInstances: d.min_idle_instances,
|
|
868
|
+
maxCapacity: d.max_capacity,
|
|
869
|
+
awsAttributes: d.aws_attributes,
|
|
870
|
+
nodeTypeId: d.node_type_id,
|
|
871
|
+
customTags: d.custom_tags,
|
|
872
|
+
idleInstanceAutoterminationMinutes:
|
|
873
|
+
d.idle_instance_autotermination_minutes,
|
|
874
|
+
enableElasticDisk: d.enable_elastic_disk,
|
|
875
|
+
diskSpec: d.disk_spec,
|
|
876
|
+
preloadedDockerImages: d.preloaded_docker_images,
|
|
877
|
+
preloadedSparkVersions: d.preloaded_spark_versions,
|
|
878
|
+
azureAttributes: d.azure_attributes,
|
|
879
|
+
gcpAttributes: d.gcp_attributes,
|
|
880
|
+
nodeTypeFlexibility: d.node_type_flexibility,
|
|
881
|
+
remoteDiskThroughput: d.remote_disk_throughput,
|
|
882
|
+
totalInitialRemoteDiskSize: d.total_initial_remote_disk_size,
|
|
883
|
+
}));
|
|
884
|
+
|
|
885
|
+
export const unmarshalInstancePoolAndStatsSchema: z.ZodType<InstancePoolAndStats> =
|
|
886
|
+
z
|
|
887
|
+
.object({
|
|
888
|
+
stats: z.lazy(() => unmarshalInstancePoolStatsSchema).optional(),
|
|
889
|
+
status: z.lazy(() => unmarshalInstancePoolStatusSchema).optional(),
|
|
890
|
+
instance_pool_id: z.string().optional(),
|
|
891
|
+
default_tags: z.record(z.string(), z.string()).optional(),
|
|
892
|
+
state: z.enum(InstancePoolState).optional(),
|
|
893
|
+
instance_pool_name: z.string().optional(),
|
|
894
|
+
min_idle_instances: z.number().optional(),
|
|
895
|
+
max_capacity: z.number().optional(),
|
|
896
|
+
aws_attributes: z
|
|
897
|
+
.lazy(() => unmarshalInstancePoolAwsAttributesSchema)
|
|
898
|
+
.optional(),
|
|
899
|
+
node_type_id: z.string().optional(),
|
|
900
|
+
custom_tags: z.record(z.string(), z.string()).optional(),
|
|
901
|
+
idle_instance_autotermination_minutes: z.number().optional(),
|
|
902
|
+
enable_elastic_disk: z.boolean().optional(),
|
|
903
|
+
disk_spec: z.lazy(() => unmarshalDiskSpecSchema).optional(),
|
|
904
|
+
preloaded_docker_images: z
|
|
905
|
+
.array(z.lazy(() => unmarshalDockerImageSchema))
|
|
906
|
+
.optional(),
|
|
907
|
+
preloaded_spark_versions: z.array(z.string()).optional(),
|
|
908
|
+
azure_attributes: z
|
|
909
|
+
.lazy(() => unmarshalInstancePoolAzureAttributesSchema)
|
|
910
|
+
.optional(),
|
|
911
|
+
gcp_attributes: z
|
|
912
|
+
.lazy(() => unmarshalInstancePoolGcpAttributesSchema)
|
|
913
|
+
.optional(),
|
|
914
|
+
node_type_flexibility: z
|
|
915
|
+
.lazy(() => unmarshalNodeTypeFlexibilitySchema)
|
|
916
|
+
.optional(),
|
|
917
|
+
remote_disk_throughput: z.number().optional(),
|
|
918
|
+
total_initial_remote_disk_size: z.number().optional(),
|
|
919
|
+
})
|
|
920
|
+
.transform(d => ({
|
|
921
|
+
stats: d.stats,
|
|
922
|
+
status: d.status,
|
|
923
|
+
instancePoolId: d.instance_pool_id,
|
|
924
|
+
defaultTags: d.default_tags,
|
|
925
|
+
state: d.state,
|
|
926
|
+
instancePoolName: d.instance_pool_name,
|
|
927
|
+
minIdleInstances: d.min_idle_instances,
|
|
928
|
+
maxCapacity: d.max_capacity,
|
|
929
|
+
awsAttributes: d.aws_attributes,
|
|
930
|
+
nodeTypeId: d.node_type_id,
|
|
931
|
+
customTags: d.custom_tags,
|
|
932
|
+
idleInstanceAutoterminationMinutes:
|
|
933
|
+
d.idle_instance_autotermination_minutes,
|
|
934
|
+
enableElasticDisk: d.enable_elastic_disk,
|
|
935
|
+
diskSpec: d.disk_spec,
|
|
936
|
+
preloadedDockerImages: d.preloaded_docker_images,
|
|
937
|
+
preloadedSparkVersions: d.preloaded_spark_versions,
|
|
938
|
+
azureAttributes: d.azure_attributes,
|
|
939
|
+
gcpAttributes: d.gcp_attributes,
|
|
940
|
+
nodeTypeFlexibility: d.node_type_flexibility,
|
|
941
|
+
remoteDiskThroughput: d.remote_disk_throughput,
|
|
942
|
+
totalInitialRemoteDiskSize: d.total_initial_remote_disk_size,
|
|
943
|
+
}));
|
|
944
|
+
|
|
945
|
+
export const unmarshalInstancePoolAwsAttributesSchema: z.ZodType<InstancePoolAwsAttributes> =
|
|
946
|
+
z
|
|
947
|
+
.object({
|
|
948
|
+
availability: z.enum(AwsAvailability).optional(),
|
|
949
|
+
zone_id: z.string().optional(),
|
|
950
|
+
spot_bid_price_percent: z.number().optional(),
|
|
951
|
+
instance_profile_arn: z.string().optional(),
|
|
952
|
+
})
|
|
953
|
+
.transform(d => ({
|
|
954
|
+
availability: d.availability,
|
|
955
|
+
zoneId: d.zone_id,
|
|
956
|
+
spotBidPricePercent: d.spot_bid_price_percent,
|
|
957
|
+
instanceProfileArn: d.instance_profile_arn,
|
|
958
|
+
}));
|
|
959
|
+
|
|
960
|
+
export const unmarshalInstancePoolAzureAttributesSchema: z.ZodType<InstancePoolAzureAttributes> =
|
|
961
|
+
z
|
|
962
|
+
.object({
|
|
963
|
+
availability: z.enum(AzureAvailability).optional(),
|
|
964
|
+
spot_bid_max_price: z.number().optional(),
|
|
965
|
+
})
|
|
966
|
+
.transform(d => ({
|
|
967
|
+
availability: d.availability,
|
|
968
|
+
spotBidMaxPrice: d.spot_bid_max_price,
|
|
969
|
+
}));
|
|
970
|
+
|
|
971
|
+
export const unmarshalInstancePoolGcpAttributesSchema: z.ZodType<InstancePoolGcpAttributes> =
|
|
972
|
+
z
|
|
973
|
+
.object({
|
|
974
|
+
gcp_availability: z.enum(GcpAvailability).optional(),
|
|
975
|
+
local_ssd_count: z.number().optional(),
|
|
976
|
+
zone_id: z.string().optional(),
|
|
977
|
+
})
|
|
978
|
+
.transform(d => ({
|
|
979
|
+
gcpAvailability: d.gcp_availability,
|
|
980
|
+
localSsdCount: d.local_ssd_count,
|
|
981
|
+
zoneId: d.zone_id,
|
|
982
|
+
}));
|
|
983
|
+
|
|
984
|
+
export const unmarshalInstancePoolStatsSchema: z.ZodType<InstancePoolStats> = z
|
|
985
|
+
.object({
|
|
986
|
+
used_count: z.number().optional(),
|
|
987
|
+
idle_count: z.number().optional(),
|
|
988
|
+
pending_used_count: z.number().optional(),
|
|
989
|
+
pending_idle_count: z.number().optional(),
|
|
990
|
+
})
|
|
991
|
+
.transform(d => ({
|
|
992
|
+
usedCount: d.used_count,
|
|
993
|
+
idleCount: d.idle_count,
|
|
994
|
+
pendingUsedCount: d.pending_used_count,
|
|
995
|
+
pendingIdleCount: d.pending_idle_count,
|
|
996
|
+
}));
|
|
997
|
+
|
|
998
|
+
export const unmarshalInstancePoolStatusSchema: z.ZodType<InstancePoolStatus> =
|
|
999
|
+
z
|
|
1000
|
+
.object({
|
|
1001
|
+
pending_instance_errors: z
|
|
1002
|
+
.array(z.lazy(() => unmarshalPendingInstanceErrorSchema))
|
|
1003
|
+
.optional(),
|
|
1004
|
+
})
|
|
1005
|
+
.transform(d => ({
|
|
1006
|
+
pendingInstanceErrors: d.pending_instance_errors,
|
|
1007
|
+
}));
|
|
1008
|
+
|
|
1009
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
1010
|
+
export const unmarshalListInstancePoolsRequest_ResponseSchema: z.ZodType<ListInstancePoolsRequest_Response> =
|
|
1011
|
+
z
|
|
1012
|
+
.object({
|
|
1013
|
+
instance_pools: z
|
|
1014
|
+
.array(z.lazy(() => unmarshalInstancePoolAndStatsSchema))
|
|
1015
|
+
.optional(),
|
|
1016
|
+
})
|
|
1017
|
+
.transform(d => ({
|
|
1018
|
+
instancePools: d.instance_pools,
|
|
1019
|
+
}));
|
|
1020
|
+
|
|
1021
|
+
export const unmarshalNodeTypeFlexibilitySchema: z.ZodType<NodeTypeFlexibility> =
|
|
1022
|
+
z
|
|
1023
|
+
.object({
|
|
1024
|
+
alternate_node_type_ids: z.array(z.string()).optional(),
|
|
1025
|
+
})
|
|
1026
|
+
.transform(d => ({
|
|
1027
|
+
alternateNodeTypeIds: d.alternate_node_type_ids,
|
|
1028
|
+
}));
|
|
1029
|
+
|
|
1030
|
+
export const unmarshalPendingInstanceErrorSchema: z.ZodType<PendingInstanceError> =
|
|
1031
|
+
z
|
|
1032
|
+
.object({
|
|
1033
|
+
instance_id: z.string().optional(),
|
|
1034
|
+
message: z.string().optional(),
|
|
1035
|
+
})
|
|
1036
|
+
.transform(d => ({
|
|
1037
|
+
instanceId: d.instance_id,
|
|
1038
|
+
message: d.message,
|
|
1039
|
+
}));
|
|
1040
|
+
|
|
1041
|
+
export const marshalCreateInstancePoolRequestSchema: z.ZodType = z
|
|
1042
|
+
.object({
|
|
1043
|
+
instancePoolName: z.string().optional(),
|
|
1044
|
+
minIdleInstances: z.number().optional(),
|
|
1045
|
+
maxCapacity: z.number().optional(),
|
|
1046
|
+
awsAttributes: z
|
|
1047
|
+
.lazy(() => marshalInstancePoolAwsAttributesSchema)
|
|
1048
|
+
.optional(),
|
|
1049
|
+
nodeTypeId: z.string().optional(),
|
|
1050
|
+
customTags: z.record(z.string(), z.string()).optional(),
|
|
1051
|
+
idleInstanceAutoterminationMinutes: z.number().optional(),
|
|
1052
|
+
enableElasticDisk: z.boolean().optional(),
|
|
1053
|
+
diskSpec: z.lazy(() => marshalDiskSpecSchema).optional(),
|
|
1054
|
+
preloadedDockerImages: z
|
|
1055
|
+
.array(z.lazy(() => marshalDockerImageSchema))
|
|
1056
|
+
.optional(),
|
|
1057
|
+
preloadedSparkVersions: z.array(z.string()).optional(),
|
|
1058
|
+
azureAttributes: z
|
|
1059
|
+
.lazy(() => marshalInstancePoolAzureAttributesSchema)
|
|
1060
|
+
.optional(),
|
|
1061
|
+
gcpAttributes: z
|
|
1062
|
+
.lazy(() => marshalInstancePoolGcpAttributesSchema)
|
|
1063
|
+
.optional(),
|
|
1064
|
+
nodeTypeFlexibility: z
|
|
1065
|
+
.lazy(() => marshalNodeTypeFlexibilitySchema)
|
|
1066
|
+
.optional(),
|
|
1067
|
+
remoteDiskThroughput: z.number().optional(),
|
|
1068
|
+
totalInitialRemoteDiskSize: z.number().optional(),
|
|
1069
|
+
})
|
|
1070
|
+
.transform(d => ({
|
|
1071
|
+
instance_pool_name: d.instancePoolName,
|
|
1072
|
+
min_idle_instances: d.minIdleInstances,
|
|
1073
|
+
max_capacity: d.maxCapacity,
|
|
1074
|
+
aws_attributes: d.awsAttributes,
|
|
1075
|
+
node_type_id: d.nodeTypeId,
|
|
1076
|
+
custom_tags: d.customTags,
|
|
1077
|
+
idle_instance_autotermination_minutes: d.idleInstanceAutoterminationMinutes,
|
|
1078
|
+
enable_elastic_disk: d.enableElasticDisk,
|
|
1079
|
+
disk_spec: d.diskSpec,
|
|
1080
|
+
preloaded_docker_images: d.preloadedDockerImages,
|
|
1081
|
+
preloaded_spark_versions: d.preloadedSparkVersions,
|
|
1082
|
+
azure_attributes: d.azureAttributes,
|
|
1083
|
+
gcp_attributes: d.gcpAttributes,
|
|
1084
|
+
node_type_flexibility: d.nodeTypeFlexibility,
|
|
1085
|
+
remote_disk_throughput: d.remoteDiskThroughput,
|
|
1086
|
+
total_initial_remote_disk_size: d.totalInitialRemoteDiskSize,
|
|
1087
|
+
}));
|
|
1088
|
+
|
|
1089
|
+
export const marshalDeleteInstancePoolRequestSchema: z.ZodType = z
|
|
1090
|
+
.object({
|
|
1091
|
+
instancePoolId: z.string().optional(),
|
|
1092
|
+
})
|
|
1093
|
+
.transform(d => ({
|
|
1094
|
+
instance_pool_id: d.instancePoolId,
|
|
1095
|
+
}));
|
|
1096
|
+
|
|
1097
|
+
export const marshalDiskSpecSchema: z.ZodType = z
|
|
1098
|
+
.object({
|
|
1099
|
+
diskType: z.lazy(() => marshalDiskTypeSchema).optional(),
|
|
1100
|
+
diskCount: z.number().optional(),
|
|
1101
|
+
diskSize: z.number().optional(),
|
|
1102
|
+
diskIops: z.number().optional(),
|
|
1103
|
+
diskThroughput: z.number().optional(),
|
|
1104
|
+
})
|
|
1105
|
+
.transform(d => ({
|
|
1106
|
+
disk_type: d.diskType,
|
|
1107
|
+
disk_count: d.diskCount,
|
|
1108
|
+
disk_size: d.diskSize,
|
|
1109
|
+
disk_iops: d.diskIops,
|
|
1110
|
+
disk_throughput: d.diskThroughput,
|
|
1111
|
+
}));
|
|
1112
|
+
|
|
1113
|
+
export const marshalDiskTypeSchema: z.ZodType = z
|
|
1114
|
+
.object({
|
|
1115
|
+
remoteVolumeType: z
|
|
1116
|
+
.discriminatedUnion('$case', [
|
|
1117
|
+
z.object({
|
|
1118
|
+
$case: z.literal('ebsVolumeType'),
|
|
1119
|
+
ebsVolumeType: z.enum(EbsVolumeType),
|
|
1120
|
+
}),
|
|
1121
|
+
z.object({
|
|
1122
|
+
$case: z.literal('azureDiskVolumeType'),
|
|
1123
|
+
azureDiskVolumeType: z.enum(AzureDiskVolumeType),
|
|
1124
|
+
}),
|
|
1125
|
+
])
|
|
1126
|
+
.optional(),
|
|
1127
|
+
})
|
|
1128
|
+
.transform(d => ({
|
|
1129
|
+
...(d.remoteVolumeType?.$case === 'ebsVolumeType' && {
|
|
1130
|
+
ebs_volume_type: d.remoteVolumeType.ebsVolumeType,
|
|
1131
|
+
}),
|
|
1132
|
+
...(d.remoteVolumeType?.$case === 'azureDiskVolumeType' && {
|
|
1133
|
+
azure_disk_volume_type: d.remoteVolumeType.azureDiskVolumeType,
|
|
1134
|
+
}),
|
|
1135
|
+
}));
|
|
1136
|
+
|
|
1137
|
+
export const marshalDockerBasicAuthSchema: z.ZodType = z
|
|
1138
|
+
.object({
|
|
1139
|
+
username: z.string().optional(),
|
|
1140
|
+
password: z.string().optional(),
|
|
1141
|
+
})
|
|
1142
|
+
.transform(d => ({
|
|
1143
|
+
username: d.username,
|
|
1144
|
+
password: d.password,
|
|
1145
|
+
}));
|
|
1146
|
+
|
|
1147
|
+
export const marshalDockerImageSchema: z.ZodType = z
|
|
1148
|
+
.object({
|
|
1149
|
+
url: z.string().optional(),
|
|
1150
|
+
credsOneof: z
|
|
1151
|
+
.discriminatedUnion('$case', [
|
|
1152
|
+
z.object({
|
|
1153
|
+
$case: z.literal('basicAuth'),
|
|
1154
|
+
basicAuth: z.lazy(() => marshalDockerBasicAuthSchema),
|
|
1155
|
+
}),
|
|
1156
|
+
])
|
|
1157
|
+
.optional(),
|
|
1158
|
+
})
|
|
1159
|
+
.transform(d => ({
|
|
1160
|
+
url: d.url,
|
|
1161
|
+
...(d.credsOneof?.$case === 'basicAuth' && {
|
|
1162
|
+
basic_auth: d.credsOneof.basicAuth,
|
|
1163
|
+
}),
|
|
1164
|
+
}));
|
|
1165
|
+
|
|
1166
|
+
export const marshalEditInstancePoolRequestSchema: z.ZodType = z
|
|
1167
|
+
.object({
|
|
1168
|
+
instancePoolId: z.string().optional(),
|
|
1169
|
+
instancePoolName: z.string().optional(),
|
|
1170
|
+
minIdleInstances: z.number().optional(),
|
|
1171
|
+
maxCapacity: z.number().optional(),
|
|
1172
|
+
awsAttributes: z
|
|
1173
|
+
.lazy(() => marshalInstancePoolAwsAttributesSchema)
|
|
1174
|
+
.optional(),
|
|
1175
|
+
nodeTypeId: z.string().optional(),
|
|
1176
|
+
customTags: z.record(z.string(), z.string()).optional(),
|
|
1177
|
+
idleInstanceAutoterminationMinutes: z.number().optional(),
|
|
1178
|
+
enableElasticDisk: z.boolean().optional(),
|
|
1179
|
+
diskSpec: z.lazy(() => marshalDiskSpecSchema).optional(),
|
|
1180
|
+
preloadedDockerImages: z
|
|
1181
|
+
.array(z.lazy(() => marshalDockerImageSchema))
|
|
1182
|
+
.optional(),
|
|
1183
|
+
preloadedSparkVersions: z.array(z.string()).optional(),
|
|
1184
|
+
azureAttributes: z
|
|
1185
|
+
.lazy(() => marshalInstancePoolAzureAttributesSchema)
|
|
1186
|
+
.optional(),
|
|
1187
|
+
gcpAttributes: z
|
|
1188
|
+
.lazy(() => marshalInstancePoolGcpAttributesSchema)
|
|
1189
|
+
.optional(),
|
|
1190
|
+
nodeTypeFlexibility: z
|
|
1191
|
+
.lazy(() => marshalNodeTypeFlexibilitySchema)
|
|
1192
|
+
.optional(),
|
|
1193
|
+
remoteDiskThroughput: z.number().optional(),
|
|
1194
|
+
totalInitialRemoteDiskSize: z.number().optional(),
|
|
1195
|
+
})
|
|
1196
|
+
.transform(d => ({
|
|
1197
|
+
instance_pool_id: d.instancePoolId,
|
|
1198
|
+
instance_pool_name: d.instancePoolName,
|
|
1199
|
+
min_idle_instances: d.minIdleInstances,
|
|
1200
|
+
max_capacity: d.maxCapacity,
|
|
1201
|
+
aws_attributes: d.awsAttributes,
|
|
1202
|
+
node_type_id: d.nodeTypeId,
|
|
1203
|
+
custom_tags: d.customTags,
|
|
1204
|
+
idle_instance_autotermination_minutes: d.idleInstanceAutoterminationMinutes,
|
|
1205
|
+
enable_elastic_disk: d.enableElasticDisk,
|
|
1206
|
+
disk_spec: d.diskSpec,
|
|
1207
|
+
preloaded_docker_images: d.preloadedDockerImages,
|
|
1208
|
+
preloaded_spark_versions: d.preloadedSparkVersions,
|
|
1209
|
+
azure_attributes: d.azureAttributes,
|
|
1210
|
+
gcp_attributes: d.gcpAttributes,
|
|
1211
|
+
node_type_flexibility: d.nodeTypeFlexibility,
|
|
1212
|
+
remote_disk_throughput: d.remoteDiskThroughput,
|
|
1213
|
+
total_initial_remote_disk_size: d.totalInitialRemoteDiskSize,
|
|
1214
|
+
}));
|
|
1215
|
+
|
|
1216
|
+
export const marshalInstancePoolAwsAttributesSchema: z.ZodType = z
|
|
1217
|
+
.object({
|
|
1218
|
+
availability: z.enum(AwsAvailability).optional(),
|
|
1219
|
+
zoneId: z.string().optional(),
|
|
1220
|
+
spotBidPricePercent: z.number().optional(),
|
|
1221
|
+
instanceProfileArn: z.string().optional(),
|
|
1222
|
+
})
|
|
1223
|
+
.transform(d => ({
|
|
1224
|
+
availability: d.availability,
|
|
1225
|
+
zone_id: d.zoneId,
|
|
1226
|
+
spot_bid_price_percent: d.spotBidPricePercent,
|
|
1227
|
+
instance_profile_arn: d.instanceProfileArn,
|
|
1228
|
+
}));
|
|
1229
|
+
|
|
1230
|
+
export const marshalInstancePoolAzureAttributesSchema: z.ZodType = z
|
|
1231
|
+
.object({
|
|
1232
|
+
availability: z.enum(AzureAvailability).optional(),
|
|
1233
|
+
spotBidMaxPrice: z.number().optional(),
|
|
1234
|
+
})
|
|
1235
|
+
.transform(d => ({
|
|
1236
|
+
availability: d.availability,
|
|
1237
|
+
spot_bid_max_price: d.spotBidMaxPrice,
|
|
1238
|
+
}));
|
|
1239
|
+
|
|
1240
|
+
export const marshalInstancePoolGcpAttributesSchema: z.ZodType = z
|
|
1241
|
+
.object({
|
|
1242
|
+
gcpAvailability: z.enum(GcpAvailability).optional(),
|
|
1243
|
+
localSsdCount: z.number().optional(),
|
|
1244
|
+
zoneId: z.string().optional(),
|
|
1245
|
+
})
|
|
1246
|
+
.transform(d => ({
|
|
1247
|
+
gcp_availability: d.gcpAvailability,
|
|
1248
|
+
local_ssd_count: d.localSsdCount,
|
|
1249
|
+
zone_id: d.zoneId,
|
|
1250
|
+
}));
|
|
1251
|
+
|
|
1252
|
+
export const marshalNodeTypeFlexibilitySchema: z.ZodType = z
|
|
1253
|
+
.object({
|
|
1254
|
+
alternateNodeTypeIds: z.array(z.string()).optional(),
|
|
1255
|
+
})
|
|
1256
|
+
.transform(d => ({
|
|
1257
|
+
alternate_node_type_ids: d.alternateNodeTypeIds,
|
|
1258
|
+
}));
|