@databricks/sdk-instancepools 0.1.0-dev.3 → 0.1.0-dev.4

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