@cloudflare/containers-shared 0.16.0

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.
@@ -0,0 +1,3843 @@
1
+ import { ComplianceConfig, Logger, FetchResultFetcher, FetchPagedListResultFetcher, Config, ContainerApp } from '@cloudflare/workers-utils';
2
+ import { ComplianceConfig as ComplianceConfig$1 } from '@cloudflare/workers-utils/compliance';
3
+ import { StdioOptions } from 'node:child_process';
4
+
5
+ type ApiRequestOptions = {
6
+ readonly method: "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH";
7
+ readonly url: string;
8
+ readonly path?: Record<string, any>;
9
+ readonly cookies?: Record<string, any>;
10
+ readonly headers?: Record<string, any>;
11
+ readonly query?: Record<string, any>;
12
+ readonly formData?: Record<string, any>;
13
+ readonly body?: any;
14
+ readonly mediaType?: string;
15
+ readonly responseHeader?: string;
16
+ readonly errors?: Record<number, string>;
17
+ };
18
+
19
+ type ApiResult = {
20
+ readonly url: string;
21
+ readonly ok: boolean;
22
+ readonly status: number;
23
+ readonly statusText: string;
24
+ readonly body: any;
25
+ };
26
+
27
+ declare class ApiError extends Error {
28
+ readonly url: string;
29
+ readonly status: number;
30
+ readonly statusText: string;
31
+ readonly body: any;
32
+ readonly request: ApiRequestOptions;
33
+ constructor(request: ApiRequestOptions, response: ApiResult, message: string);
34
+ }
35
+
36
+ declare class CancelError extends Error {
37
+ constructor(message: string);
38
+ get isCancelled(): boolean;
39
+ }
40
+ interface OnCancel {
41
+ readonly isResolved: boolean;
42
+ readonly isRejected: boolean;
43
+ readonly isCancelled: boolean;
44
+ (cancelHandler: () => void): void;
45
+ }
46
+ declare class CancelablePromise<T> implements Promise<T> {
47
+ #private;
48
+ constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
49
+ get [Symbol.toStringTag](): string;
50
+ then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
51
+ catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
52
+ finally(onFinally?: (() => void) | null): Promise<T>;
53
+ cancel(): void;
54
+ get isCancelled(): boolean;
55
+ }
56
+
57
+ /**
58
+ * To the extend possible, prefer nodes with specified characteristics when placing application instances.
59
+ *
60
+ */
61
+ declare enum ApplicationAffinityHardwareGeneration {
62
+ HIGHEST_OVERALL_PERFORMANCE = "highest-overall-performance"
63
+ }
64
+
65
+ interface WranglerLogger {
66
+ debug: (...args: unknown[]) => void;
67
+ debugWithSanitization: (label: string, ...args: unknown[]) => void;
68
+ log: (...args: unknown[]) => void;
69
+ info: (...args: unknown[]) => void;
70
+ warn: (...args: unknown[]) => void;
71
+ error: (...args: unknown[]) => void;
72
+ }
73
+ interface ViteLogger {
74
+ info: (msg: string) => void;
75
+ warn: (msg: string) => void;
76
+ error: (msg: string) => void;
77
+ }
78
+ type BuildArgs = {
79
+ /** image tag in the format `name:tag`, where tag is optional */
80
+ tag: string;
81
+ pathToDockerfile: string;
82
+ /** image_build_context or args.PATH. if not provided, defaults to the dockerfile directory */
83
+ buildContext: string;
84
+ /** any env vars that should be passed in at build time */
85
+ args?: Record<string, string>;
86
+ /** platform to build for. defaults to linux/amd64 */
87
+ platform?: string;
88
+ };
89
+ type ContainerNormalizedConfig = SharedContainerConfig & (ImageURIConfig | DockerfileConfig);
90
+ type DockerfileConfig = {
91
+ /** absolute path, resolved relative to the wrangler config file */
92
+ dockerfile: string;
93
+ /** absolute path, resolved relative to the wrangler config file. defaults to the directory of the dockerfile */
94
+ image_build_context: string;
95
+ image_vars?: Record<string, string>;
96
+ };
97
+ type ImageURIConfig = {
98
+ image_uri: string;
99
+ };
100
+ type InstanceTypeOrLimits = {
101
+ /** if undefined in config, defaults to instance_type */
102
+ /** disk size is defined in config in mb but normalized here to bytes */
103
+ disk_bytes: number;
104
+ vcpu: number;
105
+ memory_mib: number;
106
+ } | {
107
+ /** if undefined in config, defaults to "dev" */
108
+ instance_type: InstanceType;
109
+ };
110
+ /**
111
+ * Shared container config that is used regardless of whether the image is from a dockerfile or a registry link.
112
+ */
113
+ type SharedContainerConfig = {
114
+ /** if undefined in config, defaults to worker_name[-envName]-class_name. */
115
+ name: string;
116
+ /** container's DO class name */
117
+ class_name: string;
118
+ /** if undefined in config, defaults to 0 */
119
+ max_instances: number;
120
+ /** if undefined in config, defaults to "default" */
121
+ scheduling_policy: SchedulingPolicy;
122
+ /** if undefined in config, defaults to [90, 10] */
123
+ rollout_step_percentage: number | number[];
124
+ /** if undefined in config, defaults to "full_auto" */
125
+ rollout_kind: "full_auto" | "full_manual" | "none";
126
+ rollout_active_grace_period: number;
127
+ wrangler_ssh?: WranglerSSHConfig;
128
+ authorized_keys?: Array<UserSSHPublicKey>;
129
+ trusted_user_ca_keys?: Array<UserSSHPublicKey>;
130
+ constraints: {
131
+ regions?: string[];
132
+ jurisdiction?: string;
133
+ cities?: string[];
134
+ tiers?: number[];
135
+ };
136
+ affinities?: {
137
+ colocation?: ApplicationAffinityColocation;
138
+ hardware_generation?: ApplicationAffinityHardwareGeneration;
139
+ };
140
+ observability: {
141
+ logs_enabled: boolean;
142
+ target_instance_percentage?: number;
143
+ target_instance_count?: number;
144
+ };
145
+ } & InstanceTypeOrLimits;
146
+ /** build/pull agnostic container options */
147
+ type ContainerDevOptions = {
148
+ /** formatted as cloudflare-dev/workername-DOclassname:build-id */
149
+ image_tag: string;
150
+ /** container's DO class name */
151
+ class_name: string;
152
+ } & (DockerfileConfig | ImageURIConfig);
153
+
154
+ type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
155
+ type Headers = Record<string, string>;
156
+ type OpenAPIConfig = {
157
+ BASE: string;
158
+ VERSION: string;
159
+ WITH_CREDENTIALS: boolean;
160
+ CREDENTIALS: "include" | "omit" | "same-origin";
161
+ TOKEN?: string | Resolver<string>;
162
+ USERNAME?: string | Resolver<string>;
163
+ PASSWORD?: string | Resolver<string>;
164
+ HEADERS?: Headers | Resolver<Headers>;
165
+ ENCODE_PATH?: (path: string) => string;
166
+ LOGGER?: WranglerLogger | undefined;
167
+ };
168
+ declare const OpenAPI: OpenAPIConfig;
169
+
170
+ type ResultInfo = {
171
+ page_token?: string;
172
+ per_page?: number;
173
+ next_page_token?: string;
174
+ };
175
+ type PaginatedResult<T> = {
176
+ data: T;
177
+ resultInfo?: ResultInfo;
178
+ };
179
+
180
+ /**
181
+ * Request method
182
+ * @param config The OpenAPI configuration object
183
+ * @param options The request options from the service
184
+ * @returns CancelablePromise<T>
185
+ * @throws ApiError
186
+ */
187
+ declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
188
+ /**
189
+ * Request method that preserves pagination info from V4 responses
190
+ * @param config The OpenAPI configuration object
191
+ * @param options The request options from the service
192
+ * @returns CancelablePromise<PaginatedResult<T>>
193
+ * @throws ApiError
194
+ */
195
+ declare const requestPaginated: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<PaginatedResult<T>>;
196
+
197
+ /**
198
+ * A memory size that specifies its unit at the end.
199
+ */
200
+ type MemorySizeWithUnit = string;
201
+
202
+ /**
203
+ * Represents the default configuration for an account
204
+ */
205
+ type AccountDefaults = {
206
+ vcpus: number;
207
+ memory_mib: number;
208
+ /**
209
+ * Default disk size in MB
210
+ */
211
+ disk_mb?: number;
212
+ /**
213
+ * Deprecated in favor of memory_mib
214
+ * @deprecated
215
+ */
216
+ memory?: MemorySizeWithUnit;
217
+ };
218
+
219
+ /**
220
+ * A unique identifier for the account
221
+ */
222
+ type AccountID = string;
223
+
224
+ /**
225
+ * A disk size that specifies its unit at the end.
226
+ */
227
+ type DiskSizeWithUnit = string;
228
+
229
+ /**
230
+ * Defines the network mode that the VM can include
231
+ */
232
+ declare enum NetworkMode {
233
+ USO = "uso",
234
+ VHOST = "vhost",
235
+ XDP = "xdp"
236
+ }
237
+
238
+ /**
239
+ * The node type that a deployment can be deployed to. 'metal' defines normal Cloudflare metals, 'cloudchamber' is Cloudchamber nodes. For new accounts it should always be 'metal'.
240
+ */
241
+ declare enum NodeGroup {
242
+ METAL = "metal",
243
+ CLOUDCHAMBER = "cloudchamber"
244
+ }
245
+
246
+ /**
247
+ * Represents a Cloudchamber account limit
248
+ */
249
+ type AccountLimit = {
250
+ account_id: AccountID;
251
+ vcpu_per_deployment: number;
252
+ /**
253
+ * Deprecated in favor of memory_mib_per_deployment
254
+ * @deprecated
255
+ */
256
+ memory_per_deployment: MemorySizeWithUnit;
257
+ memory_mib_per_deployment: number;
258
+ /**
259
+ * Deprecated in favor of disk_mb_per_deployment
260
+ * @deprecated
261
+ */
262
+ disk_per_deployment: DiskSizeWithUnit;
263
+ disk_mb_per_deployment: number;
264
+ total_vcpu: number;
265
+ /**
266
+ * Deprecated in favor of total_memory_mib
267
+ * @deprecated
268
+ */
269
+ total_memory: MemorySizeWithUnit;
270
+ total_memory_mib: number;
271
+ /**
272
+ * Total amount of disk usage allowed for the account
273
+ */
274
+ total_disk_mb: number;
275
+ node_group: NodeGroup;
276
+ /**
277
+ * Network modes that will be included in this customer's vm
278
+ */
279
+ network_modes: Array<NetworkMode>;
280
+ /**
281
+ * Number of ipv4s available to the account
282
+ */
283
+ ipv4s: number;
284
+ };
285
+
286
+ /**
287
+ * Unique location code used to identify locations on a logical level
288
+ */
289
+ type LocationID = string;
290
+
291
+ /**
292
+ * Represents a location where an account can create/modify deployments.
293
+ */
294
+ type AccountLocation = {
295
+ location: LocationID;
296
+ };
297
+
298
+ /**
299
+ * Represents the limits related to a location
300
+ */
301
+ type AccountLocationLimits = {
302
+ vcpu_per_deployment: number;
303
+ /**
304
+ * Deprecated in favor of memory_mib_per_deployment
305
+ * @deprecated
306
+ */
307
+ memory_per_deployment: MemorySizeWithUnit;
308
+ memory_mib_per_deployment?: number;
309
+ total_vcpu: number;
310
+ /**
311
+ * Deprecated in favor of total_memory_mib
312
+ * @deprecated
313
+ */
314
+ total_memory: MemorySizeWithUnit;
315
+ total_memory_mib?: number;
316
+ };
317
+
318
+ /**
319
+ * Represents an account location limits property
320
+ */
321
+ type AccountLocationLimitsAsProperty = {
322
+ limits: AccountLocationLimits;
323
+ };
324
+
325
+ /**
326
+ * An account registry token object that can be used to push and pull images to the registry's current account namespace
327
+ */
328
+ type AccountRegistryToken = {
329
+ account_id: AccountID;
330
+ registry_host: string;
331
+ username: string;
332
+ /**
333
+ * If password is unset, this registry is a public one that doesn't need credentials
334
+ */
335
+ password?: string;
336
+ };
337
+
338
+ /**
339
+ * A deployment ID represents an identifier of a deployment configuration that maintains a healthy placement
340
+ */
341
+ type DeploymentID = string;
342
+
343
+ /**
344
+ * Placement ID
345
+ */
346
+ type PlacementID = string;
347
+
348
+ /**
349
+ * UTC Unix EPOCH in seconds
350
+ */
351
+ type UnixTimestamp = number;
352
+
353
+ /**
354
+ * The allocation that exists when an IP or a port range has been assigned to a metal
355
+ */
356
+ type AddressAssignment = {
357
+ placementID?: PlacementID;
358
+ expiration?: UnixTimestamp;
359
+ deploymentID?: DeploymentID;
360
+ };
361
+
362
+ /**
363
+ * Colocation affinity is designed so schedulers try to place application instances all in the same way. Colocation is best-effort depending on available resources. If there is some leftover set of instances
364
+ * that can't be placed together, the scheduler will try to place them somewhere else.
365
+ *
366
+ */
367
+ declare enum ApplicationAffinityColocation {
368
+ DATACENTER = "datacenter"
369
+ }
370
+
371
+ /**
372
+ * Defines affinity in application scheduling. (This still an experimental feature, some schedulers might not work with these affinities).
373
+ *
374
+ */
375
+ type ApplicationAffinities = {
376
+ colocation?: ApplicationAffinityColocation;
377
+ hardware_generation?: ApplicationAffinityHardwareGeneration;
378
+ };
379
+
380
+ /**
381
+ * The name of a pop to be specified in an application pop. Requires specific entitlements to use this.
382
+ */
383
+ type ApplicationConstraintPop = string;
384
+
385
+ /**
386
+ * A city is represented as an airport code like MAD or SFO.
387
+ */
388
+ type City = string;
389
+
390
+ /**
391
+ * Represents a group of datacenters. You can choose between:
392
+ * "AFR", "APAC", "EEUR", "ENAM", "WNAM", "ME", "OC", "SAM", "WEUR".
393
+ *
394
+ */
395
+ type Region = string;
396
+
397
+ type ApplicationConstraints = {
398
+ region?: Region;
399
+ tier?: number;
400
+ tiers?: Array<number>;
401
+ regions?: Array<Region>;
402
+ cities?: Array<City>;
403
+ pops?: Array<ApplicationConstraintPop>;
404
+ };
405
+
406
+ type ApplicationHealthInstances = {
407
+ /**
408
+ * Number of active containers in this application.
409
+ *
410
+ */
411
+ active: number;
412
+ /**
413
+ * Number of healthy instances. If the application is attached to a DO namespace,
414
+ * this represents the number of prepared container instances.
415
+ *
416
+ */
417
+ healthy: number;
418
+ /**
419
+ * Number of failing container instances.
420
+ *
421
+ */
422
+ failed: number;
423
+ /**
424
+ * Number of container instances that are being prepared.
425
+ *
426
+ */
427
+ starting: number;
428
+ /**
429
+ * Number of container instances pending to be scheduled.
430
+ *
431
+ */
432
+ scheduling: number;
433
+ };
434
+
435
+ type ApplicationHealth = {
436
+ instances: ApplicationHealthInstances;
437
+ };
438
+
439
+ /**
440
+ * An Application ID represents an identifier of an application
441
+ */
442
+ type ApplicationID = string;
443
+
444
+ /**
445
+ * Application config denoting deployments with Jobs type
446
+ */
447
+ type ApplicationJobsConfig = boolean;
448
+
449
+ /**
450
+ * The application name
451
+ */
452
+ type ApplicationName = string;
453
+
454
+ /**
455
+ * Observability logging settings.
456
+ */
457
+ type ObservabilityLogs = {
458
+ enabled?: boolean;
459
+ };
460
+
461
+ /**
462
+ * Application-level observability settings.
463
+ */
464
+ type ApplicationObservability = {
465
+ logs?: ObservabilityLogs;
466
+ target_instance_percentage?: number;
467
+ target_instance_count?: number;
468
+ };
469
+
470
+ /**
471
+ * Application instance priority.
472
+ */
473
+ type ApplicationPriority = number;
474
+
475
+ /**
476
+ * Defines priorities of application instances that are taken into account in scheduling decisions
477
+ * and used to determine what instances should be evicted in the face of resource scarcity.
478
+ * The feature is experimental and only supported with the "gpu" scheduling policy.
479
+ *
480
+ */
481
+ type ApplicationPriorities = {
482
+ default: ApplicationPriority;
483
+ };
484
+
485
+ /**
486
+ * Grace period for active instances to stay alive before becoming elibile for shutdown signal due to a rollout, in seconds.
487
+ * Defaults to 0.
488
+ *
489
+ */
490
+ type ApplicationRolloutActiveGracePeriod = number;
491
+
492
+ type ExecFormParam = string;
493
+
494
+ /**
495
+ * The command to be executed when the container starts, passed to the entrypoint.
496
+ * This can be overridden at run-time. If only the command is overridden at run-time,
497
+ * it gets passed to the default entrypoint specified in the image.
498
+ *
499
+ */
500
+ type Command = Array<ExecFormParam>;
501
+
502
+ /**
503
+ * Available HTTP methods for health and readiness checks.
504
+ */
505
+ declare enum HTTPMethod {
506
+ GET = "GET",
507
+ POST = "POST",
508
+ PATCH = "PATCH",
509
+ PUT = "PUT",
510
+ OPTIONS = "OPTIONS",
511
+ DELETE = "DELETE",
512
+ HEAD = "HEAD"
513
+ }
514
+
515
+ /**
516
+ * Configuration for HTTP checks.
517
+ */
518
+ type DeploymentCheckHTTPRequestBody = {
519
+ method?: HTTPMethod;
520
+ /**
521
+ * If the method is one of POST, PATCH or PUT, this is required. It's the body that will be passed to the HTTP healthcheck request.
522
+ */
523
+ body?: string;
524
+ /**
525
+ * Path that will be used to perform the healthcheck.
526
+ */
527
+ path?: string;
528
+ /**
529
+ * HTTP headers to include in the request.
530
+ */
531
+ headers?: Record<string, any>;
532
+ };
533
+
534
+ declare enum DeploymentCheckKind {
535
+ HEALTH = "health",
536
+ READY = "ready"
537
+ }
538
+
539
+ declare enum DeploymentCheckType {
540
+ HTTP = "http",
541
+ TCP = "tcp"
542
+ }
543
+
544
+ /**
545
+ * Duration string. From Go documentation:
546
+ * A string representing the duration in the form "3d1h3m". Leading zero units are omitted.
547
+ * As a special case, durations less than one second format use a smaller unit (milli-, micro-, or nanoseconds)
548
+ * to ensure that the leading digit is non-zero.
549
+ *
550
+ */
551
+ type Duration = string;
552
+
553
+ /**
554
+ * Health and readiness checks for a deployment
555
+ */
556
+ type DeploymentCheckRequestBody = {
557
+ /**
558
+ * Optional name for the check. If omitted, a name will be generated automatically.
559
+ */
560
+ name?: string;
561
+ /**
562
+ * The type of check to perform. A TCP check succeeds if it can connect to the provided port. An HTTP check succeeds if it receives a successful HTTP response (2XX)
563
+ */
564
+ type: DeploymentCheckType;
565
+ /**
566
+ * Connect to the port using TLS
567
+ */
568
+ tls?: boolean;
569
+ /**
570
+ * The name of the port defined in the "ports" property of the deployment
571
+ */
572
+ port: string;
573
+ /**
574
+ * Configuration for HTTP checks. Only valid when "type" is "http"
575
+ */
576
+ http?: DeploymentCheckHTTPRequestBody;
577
+ /**
578
+ * How often the check should be performed
579
+ */
580
+ interval: Duration;
581
+ /**
582
+ * The amount of time to wait for the check to complete before considering the check to have failed
583
+ */
584
+ timeout: Duration;
585
+ /**
586
+ * Number of times to attempt the check before considering it to have failed
587
+ */
588
+ attempts_before_failure?: number;
589
+ /**
590
+ * The kind of check. A failed "healthy" check affects a deployment's "healthy" status, while a failed "ready" check affects a deployment's "ready" status
591
+ */
592
+ kind: DeploymentCheckKind;
593
+ /**
594
+ * Initial time period after container start during which failed checks will be ignored
595
+ */
596
+ grace_period?: Duration;
597
+ };
598
+
599
+ /**
600
+ * The secret access type denotes how a secret is made available within a container. Available Options are "env".
601
+ */
602
+ declare enum SecretAccessType {
603
+ ENV = "env"
604
+ }
605
+
606
+ /**
607
+ * Specifies how secrets are accessed in containers, defining the name of the secret within the container and the corresponding account secret name.
608
+ */
609
+ type DeploymentSecretMap = {
610
+ /**
611
+ * The name of the secret within the container
612
+ */
613
+ name: string;
614
+ type: SecretAccessType;
615
+ /**
616
+ * Corresponding secret name from the account
617
+ */
618
+ secret: string;
619
+ };
620
+
621
+ /**
622
+ * The disk configuration for this deployment. By default, all containers have a disk size of 2GB.
623
+ */
624
+ type Disk = {
625
+ /**
626
+ * Deprecated in favor of size_mb.
627
+ * @deprecated
628
+ */
629
+ size?: DiskSizeWithUnit;
630
+ /**
631
+ * Size of the disk, in MB.
632
+ */
633
+ size_mb?: number;
634
+ };
635
+
636
+ /**
637
+ * A string representation of a domain name. See RFC-1034 (https://www.ietf.org/rfc/rfc1034.txt). Consider that the limit of a domain name is min 3 and max 253 ASCII characters.
638
+ */
639
+ type Domain = string;
640
+
641
+ /**
642
+ * A string representation of an IP, can be both v6 and v4.
643
+ */
644
+ type IP = string;
645
+
646
+ /**
647
+ * Represents the /etc/resolv.conf that will appear in the deployment.
648
+ * If the 'dns' property is specified, even if empty object, will override the default resolv.conf of the container.
649
+ * The default resolv.conf of a container is 'servers = ["1.1.1.1", "9.9.9.9", "2606:4700:4700::1111"]', only if an IPv4 is assigned.
650
+ * The default for a non IPv4 deployment is 'servers = ["2606:4700:4700::1111", "2620:fe::fe"]'.
651
+ *
652
+ */
653
+ type DNSConfiguration = {
654
+ /**
655
+ * List of DNS servers that the deployment will use to resolve domain names. You can only specify a maximum of 3.
656
+ */
657
+ servers?: Array<IP>;
658
+ /**
659
+ * The container resolver will append these domains to every resolve query. For example, if you have 'google.com',
660
+ * and your deployment queries 'web', it will append 'google.com' to 'web' in the search query before trying 'web'.
661
+ * Limited to 6 domains.
662
+ *
663
+ */
664
+ searches?: Array<Domain>;
665
+ };
666
+
667
+ /**
668
+ * The entry point for the container, specifying the executable to run when the container starts.
669
+ * This can be overridden at run-time. If overridden, the default command from the image is ignored.
670
+ * Both entrypoint and command can be specified at run-time to completely replace the image defaults.
671
+ *
672
+ */
673
+ type Entrypoint = Array<ExecFormParam>;
674
+
675
+ /**
676
+ * An environment variable name
677
+ */
678
+ type EnvironmentVariableName = string;
679
+
680
+ /**
681
+ * An environment variable value
682
+ */
683
+ type EnvironmentVariableValue = string;
684
+
685
+ /**
686
+ * An environment variable with a value set
687
+ */
688
+ type EnvironmentVariable = {
689
+ name: EnvironmentVariableName;
690
+ value: EnvironmentVariableValue;
691
+ };
692
+
693
+ /**
694
+ * Image url
695
+ */
696
+ type Image = string;
697
+
698
+ /**
699
+ * The instance type will be used to configure vcpu, memory, and disk.
700
+ *
701
+ * - "lite": This will use a configuration of 1/16 vCPU, 256 MiB memory, and 2 GB disk
702
+ * - "basic": This will use a configuration of 1/4 vCPU, 1 GiB memory, and 4 GB disk
703
+ * - "standard-1": This will use a configuration of 1/2 vCPU, 4 GiB memory, and 8 GB disk
704
+ * - "standard-2": This will use a configuration of 1 vCPU, 6 GiB memory, and 12 GB disk
705
+ * - "standard-3": This will use a configuration of 2 vCPU, 8 GiB memory, and 16 GB disk
706
+ * - "standard-4": This will use a configuration of 4 vCPU, 12 GiB memory, and 20 GB disk
707
+ * - "standard": This will use a configuration of 1/2 vCPU, 4 GiB memory, and 4 GB disk. Now deprecated.
708
+ * - "dev": Is an alias for "lite". Now deprecated.
709
+ *
710
+ * The default is "lite".
711
+ *
712
+ */
713
+ declare enum InstanceType {
714
+ LITE = "lite",
715
+ DEV = "dev",
716
+ BASIC = "basic",
717
+ STANDARD = "standard",
718
+ STANDARD_1 = "standard-1",
719
+ STANDARD_2 = "standard-2",
720
+ STANDARD_3 = "standard-3",
721
+ STANDARD_4 = "standard-4"
722
+ }
723
+
724
+ /**
725
+ * A label name
726
+ */
727
+ type LabelName = string;
728
+
729
+ /**
730
+ * A label value
731
+ */
732
+ type LabelValue = string;
733
+
734
+ /**
735
+ * A label
736
+ */
737
+ type Label = {
738
+ name: LabelName;
739
+ value: LabelValue;
740
+ };
741
+
742
+ declare enum AssignIPv4 {
743
+ NONE = "none",
744
+ PREDEFINED = "predefined",
745
+ ACCOUNT = "account"
746
+ }
747
+
748
+ declare enum AssignIPv6 {
749
+ NONE = "none",
750
+ PREDEFINED = "predefined",
751
+ ACCOUNT = "account"
752
+ }
753
+
754
+ /**
755
+ * Defines the kind of networking the container will have. If "public", the container will be assigned at least an IPv6, and an IPv4 if "assign_ipv4": true. If "public-by-port" is specified, the IP address assignment logic is the same as with "public". However, at least one port must be specified. Only packets sent to specified ports will be routed to the container. If "private", the container won't have any accessible public IPs, however it will be able to access the internet.
756
+ *
757
+ */
758
+ declare enum ContainerNetworkMode {
759
+ PUBLIC = "public",
760
+ PUBLIC_BY_PORT = "public-by-port",
761
+ PRIVATE = "private"
762
+ }
763
+
764
+ type NetworkParameters = {
765
+ /**
766
+ * Assign an IPv4 address to the deployment. One of 'none' (default), 'predefined' (allocate one from a set of IPv4 addresses in the global pool), 'account' (allocate one from a set of IPv4 addresses preassigned in the account pool). Only applicable to "public" mode.
767
+ *
768
+ */
769
+ assign_ipv4?: AssignIPv4;
770
+ /**
771
+ * Assign an IPv6 address to the deployment. One of 'predefined' (allocate one from a set of IPv6 addresses in the global pool), 'account' (allocate one from a set of IPv6 addresses preassigned in the account pool). The container will always be assigned to an IPv6 if the networking mode is "public".
772
+ *
773
+ */
774
+ assign_ipv6?: AssignIPv6;
775
+ mode?: ContainerNetworkMode;
776
+ };
777
+
778
+ /**
779
+ * Settings for observability such as logging.
780
+ */
781
+ type Observability = {
782
+ logs?: ObservabilityLogs;
783
+ };
784
+
785
+ type PortRange = {
786
+ /**
787
+ * First port number. Inclusive.
788
+ */
789
+ start: number;
790
+ /**
791
+ * Last port number. Inclusive. It may be equal to the start one.
792
+ */
793
+ end: number;
794
+ };
795
+
796
+ /**
797
+ * Represents a port assignment for a deployment
798
+ */
799
+ type Port = {
800
+ /**
801
+ * A port name. The port array should not have duplicate names. The port name should be between 1 and 15 characters long. Only alphanumeric characters, dashes (-), and underscores (_) are allowed. No consecutive dashes. The value of the port is exposed to the user's application with a set of environment variables, where `<name>` below is the name of the port with dashes converted to underscores (example: "web-ui" becomes "web_ui"):
802
+ * - `CLOUDFLARE_PORT_<name>`: Port inside the container
803
+ * - `CLOUDFLARE_HOST_PORT_<name>`: Port outside the container
804
+ * - `CLOUDFLARE_HOST_IP_<name>`: Address of the external network interface the port is allocated on
805
+ * - `CLOUDFLARE_HOST_ADDR_<name>`: `CLOUDFLARE_HOST_IP_<name>:CLOUDFLARE_HOST_PORT_<name>`
806
+ *
807
+ */
808
+ name: string;
809
+ /**
810
+ * Optional port number, it's assigned only if the user specified it.
811
+ * If it's not specified, the datacenter scheduler will decide it.
812
+ *
813
+ */
814
+ port?: number;
815
+ /**
816
+ * Choose a port number from a given set of port ranges and use it. It is an optional field.
817
+ * If it is set, "port" must not be provided. The same port ranges may be used with multiple ports
818
+ * as long as the port ranges are identical for each port. Otherwise no two port ranges must intersect
819
+ * and no fixed port must belong to any port range. The total port count for all port ranges should
820
+ * be sufficiently large for assigning the requested number of ports.
821
+ *
822
+ */
823
+ assign_port?: Array<PortRange>;
824
+ };
825
+
826
+ /**
827
+ * Configuration for a VM provisioner.
828
+ */
829
+ type ProvisionerConfiguration = {
830
+ /**
831
+ * The provisioner to use.
832
+ */
833
+ type: ProvisionerConfiguration.type;
834
+ };
835
+ declare namespace ProvisionerConfiguration {
836
+ /**
837
+ * The provisioner to use.
838
+ */
839
+ enum type {
840
+ NONE = "none",
841
+ CLOUDINIT = "cloudinit"
842
+ }
843
+ }
844
+
845
+ /**
846
+ * An SSH public key ID. One can map an ssh public key to a deployment using this ID.
847
+ */
848
+ type SSHPublicKeyID = string;
849
+
850
+ /**
851
+ * An SSH public key
852
+ */
853
+ type SSHPublicKey = string;
854
+
855
+ /**
856
+ * SSH public key provided by the user
857
+ */
858
+ type UserSSHPublicKey = {
859
+ name?: string;
860
+ public_key: SSHPublicKey;
861
+ };
862
+
863
+ /**
864
+ * Configuration properties for SSH'ing into a container with Wrangler
865
+ */
866
+ type WranglerSSHConfig = {
867
+ enabled: boolean;
868
+ port?: number;
869
+ };
870
+
871
+ /**
872
+ * Properties required to modify a cloudchamber deployment specified by the user.
873
+ */
874
+ type ModifyUserDeploymentConfiguration = {
875
+ image?: Image;
876
+ wrangler_ssh?: WranglerSSHConfig;
877
+ authorized_keys?: Array<UserSSHPublicKey>;
878
+ trusted_user_ca_keys?: Array<UserSSHPublicKey>;
879
+ /**
880
+ * A list of SSH public key IDs from the account
881
+ */
882
+ ssh_public_key_ids?: Array<SSHPublicKeyID>;
883
+ /**
884
+ * A list of objects with secret names and the their access types from the account
885
+ */
886
+ secrets?: Array<DeploymentSecretMap>;
887
+ instance_type?: InstanceType;
888
+ /**
889
+ * Specify the vcpu to be used for the deployment. Vcpu must be at least 0.0625. The input value will be rounded to
890
+ * the nearest 0.0001. The default will be the one configured for the account.
891
+ *
892
+ */
893
+ vcpu?: number;
894
+ /**
895
+ * Deprecated in favor of memory_mib
896
+ * @deprecated
897
+ */
898
+ memory?: MemorySizeWithUnit;
899
+ /**
900
+ * Specify the memory to be used for the deployment, in MiB. The default will be the one configured for the account.
901
+ */
902
+ memory_mib?: number;
903
+ /**
904
+ * The disk configuration for this deployment
905
+ */
906
+ disk?: Disk;
907
+ /**
908
+ * Container environment variables
909
+ */
910
+ environment_variables?: Array<EnvironmentVariable>;
911
+ /**
912
+ * Deployment labels
913
+ */
914
+ labels?: Array<Label>;
915
+ network?: NetworkParameters;
916
+ command?: Command;
917
+ entrypoint?: Entrypoint;
918
+ dns?: DNSConfiguration;
919
+ ports?: Array<Port>;
920
+ /**
921
+ * Health and readiness checks for this deployment.
922
+ */
923
+ checks?: Array<DeploymentCheckRequestBody>;
924
+ provisioner?: ProvisionerConfiguration;
925
+ observability?: Observability;
926
+ experimental_flags?: Array<string>;
927
+ };
928
+
929
+ type ApplicationSchedulingHint = {
930
+ current: {
931
+ instances: number;
932
+ configuration: ModifyUserDeploymentConfiguration;
933
+ version: number;
934
+ };
935
+ target: {
936
+ instances: number;
937
+ configuration: ModifyUserDeploymentConfiguration;
938
+ version: number;
939
+ };
940
+ };
941
+
942
+ /**
943
+ * Set of properties to configure a durable object application in Cloudchamber
944
+ */
945
+ type DurableObjectsConfiguration = {
946
+ /**
947
+ * The namespace ID of a durable object namespace. It's assigned when the user deploys for the first time
948
+ * a durable object namespace.
949
+ *
950
+ */
951
+ namespace_id: string;
952
+ };
953
+
954
+ /**
955
+ * UTC timestamp string in ISO 8601 format
956
+ */
957
+ type ISO8601Timestamp = string;
958
+
959
+ /**
960
+ * An identifier for a specific rollout within an application.
961
+ */
962
+ type RolloutID = string;
963
+
964
+ /**
965
+ * The scheduling policy to use for an application
966
+ */
967
+ declare enum SchedulingPolicy {
968
+ DURABLE_OBJECT = "durable_object",
969
+ MOON = "moon",
970
+ GPU = "gpu",
971
+ REGIONAL = "regional",
972
+ FILL_METALS = "fill_metals",
973
+ DEFAULT = "default"
974
+ }
975
+
976
+ /**
977
+ * Properties required to create a cloudchamber deployment specified by the user
978
+ */
979
+ type UserDeploymentConfiguration = {
980
+ image: Image;
981
+ wrangler_ssh?: WranglerSSHConfig;
982
+ authorized_keys?: Array<UserSSHPublicKey>;
983
+ trusted_user_ca_keys?: Array<UserSSHPublicKey>;
984
+ /**
985
+ * A list of SSH public key IDs from the account
986
+ */
987
+ ssh_public_key_ids?: Array<SSHPublicKeyID>;
988
+ /**
989
+ * A list of objects with secret names and the their access types from the account
990
+ */
991
+ secrets?: Array<DeploymentSecretMap>;
992
+ instance_type?: InstanceType;
993
+ /**
994
+ * Specify the vcpu to be used for the deployment. Vcpu must be at least 0.0625. The input value will be rounded to
995
+ * the nearest 0.0001. The default will be the one configured for the account.
996
+ *
997
+ */
998
+ vcpu?: number;
999
+ /**
1000
+ * Deprecated in favor of memory_mib
1001
+ * @deprecated
1002
+ */
1003
+ memory?: MemorySizeWithUnit;
1004
+ /**
1005
+ * Specify the memory to be used for the deployment, in MiB. The default will be the one configured for the account.
1006
+ */
1007
+ memory_mib?: number;
1008
+ /**
1009
+ * The disk configuration for this deployment
1010
+ */
1011
+ disk?: Disk;
1012
+ /**
1013
+ * Container environment variables
1014
+ */
1015
+ environment_variables?: Array<EnvironmentVariable>;
1016
+ /**
1017
+ * Deployment labels
1018
+ */
1019
+ labels?: Array<Label>;
1020
+ network?: NetworkParameters;
1021
+ command?: Command;
1022
+ entrypoint?: Entrypoint;
1023
+ dns?: DNSConfiguration;
1024
+ ports?: Array<Port>;
1025
+ /**
1026
+ * Health and readiness checks for this deployment.
1027
+ */
1028
+ checks?: Array<DeploymentCheckRequestBody>;
1029
+ provisioner?: ProvisionerConfiguration;
1030
+ observability?: Observability;
1031
+ experimental_flags?: Array<string>;
1032
+ };
1033
+
1034
+ /**
1035
+ * Describes multiple deployments with parameters that describe how they should be placed
1036
+ */
1037
+ type Application = {
1038
+ id: ApplicationID;
1039
+ created_at: ISO8601Timestamp;
1040
+ account_id: AccountID;
1041
+ name: ApplicationName;
1042
+ version: number;
1043
+ scheduling_policy: SchedulingPolicy;
1044
+ /**
1045
+ * Number of deployments to create
1046
+ */
1047
+ instances: number;
1048
+ /**
1049
+ * Maximum number of instances that the application will allow. This is relevant for applications that auto-scale.
1050
+ */
1051
+ max_instances?: number;
1052
+ configuration: UserDeploymentConfiguration;
1053
+ observability?: ApplicationObservability;
1054
+ constraints?: ApplicationConstraints;
1055
+ jobs?: ApplicationJobsConfig;
1056
+ affinities?: ApplicationAffinities;
1057
+ priorities?: ApplicationPriorities;
1058
+ durable_objects?: DurableObjectsConfiguration;
1059
+ scheduling_hint?: ApplicationSchedulingHint;
1060
+ active_rollout_id?: RolloutID;
1061
+ rollout_active_grace_period?: ApplicationRolloutActiveGracePeriod;
1062
+ health?: ApplicationHealth;
1063
+ };
1064
+
1065
+ /**
1066
+ * The disk configuration for this deployment (in MB).
1067
+ */
1068
+ type DiskMB = {
1069
+ size_mb: number;
1070
+ };
1071
+
1072
+ /**
1073
+ * Name of the event that describes the kind event that happened.
1074
+ * - SchedulerPlaced: It's the first event that creates a Cloudchamber placement. It happens when the runtime was able to retrieve deployment resources and start verify everything is correct.
1075
+ * - NetworkingIPAssigned: It's sent when the Cloudchamber runtime has mapped the IP to the container.
1076
+ * - VMStarted: It's sent when the Cloudchamber runtime has started the VM. However, it does not mean that the container is healthy.
1077
+ * - ImagePulled: It's sent when the Cloudchamber runtime has pulled the image successfully.
1078
+ * - ImagePullError: It's sent when the Cloudchamber runtime is having issues pulling image. The message and details have more information on what happened for debugging.
1079
+ * - VMFailedToStart: It's sent when the Cloudchamber runtime was unable to boot the VM.
1080
+ * - VMStopping: It's sent when the scheduler is stopping the VM.
1081
+ * - VMStopped: It's sent when the VM has finally exited.
1082
+ * - VMFailed: It's sent when the scheduling of the VM failed in the current location.
1083
+ * - RuntimeStartFailed: It's sent when the runtime had an internal error.
1084
+ * - SSHStarted: It's sent when the container has gained network connectivity and has opened the SSH port. This event is only sent when SSH keys are configured.
1085
+ * - CheckUpdate: Sent when the status of a health or readiness check changes. This may also affect the health status of the placement.
1086
+ * - DurableObjectConnected: Sent when a durable object instance connects and gains control of the deployment.
1087
+ * This event is only sent for durable object deployments. It is sent after VMStarted.
1088
+ * - ContainerStarted: It's sent when the container has started running.
1089
+ *
1090
+ */
1091
+ declare enum EventName {
1092
+ SCHEDULER_PLACED = "SchedulerPlaced",
1093
+ NETWORKING_IPASSIGNED = "NetworkingIPAssigned",
1094
+ VMSTARTED = "VMStarted",
1095
+ IMAGE_PULLED = "ImagePulled",
1096
+ IMAGE_PULL_ERROR = "ImagePullError",
1097
+ VMFAILED_TO_START = "VMFailedToStart",
1098
+ NETWORKING_IPASSIGNMENT_FAILED = "NetworkingIPAssignmentFailed",
1099
+ VMRUNNING = "VMRunning",
1100
+ VMSTOPPING = "VMStopping",
1101
+ VMSTOPPED = "VMStopped",
1102
+ VMFAILED = "VMFailed",
1103
+ RUNTIME_START_FAILED = "RuntimeStartFailed",
1104
+ SSHSTARTED = "SSHStarted",
1105
+ SERVICE_HEALTH_UPDATES = "ServiceHealthUpdates",
1106
+ CHECK_UPDATE = "CheckUpdate",
1107
+ DURABLE_OBJECT_CONNECTED = "DurableObjectConnected",
1108
+ CONTAINER_STARTED = "ContainerStarted"
1109
+ }
1110
+
1111
+ declare enum EventType {
1112
+ INFO = "Info",
1113
+ ERROR = "Error",
1114
+ WARN = "Warn",
1115
+ USER_ERROR = "UserError",
1116
+ SYSTEM_ERROR = "SystemError"
1117
+ }
1118
+
1119
+ /**
1120
+ * An event within a Placement or a Job
1121
+ */
1122
+ type PlacementEvent = {
1123
+ id: string;
1124
+ time: ISO8601Timestamp;
1125
+ type: EventType;
1126
+ name: EventName;
1127
+ message: string;
1128
+ details: Record<string, any>;
1129
+ statusChange: Record<string, any>;
1130
+ };
1131
+
1132
+ /**
1133
+ * All events within a Job
1134
+ */
1135
+ type JobEvents = Array<PlacementEvent>;
1136
+
1137
+ /**
1138
+ * A Job ID represents an identifier of a specific job
1139
+ */
1140
+ type JobID = string;
1141
+
1142
+ /**
1143
+ * Job status health represents the job's health. It can be in one of the following states
1144
+ * Queued - The job has been created and is waiting to be scheduled.
1145
+ * Scheduled - The job has been scheduled on a designated compute instance.
1146
+ * Placed - The job has been placed on a compute node and its relevant resources like images, networking and bind mounts are being prepared.
1147
+ * Running - The job has started running the container with the given job configuration.
1148
+ * Stopped - The job has stopped running
1149
+ *
1150
+ */
1151
+ declare enum JobStatusHealth {
1152
+ QUEUED = "Queued",
1153
+ SCHEDULED = "Scheduled",
1154
+ PLACED = "Placed",
1155
+ RUNNING = "Running",
1156
+ STOPPED = "Stopped"
1157
+ }
1158
+
1159
+ type JobStatus = {
1160
+ health: JobStatusHealth;
1161
+ } & Record<string, any>;
1162
+
1163
+ /**
1164
+ * The Job timeout in seconds
1165
+ */
1166
+ type JobTimeoutSeconds = number;
1167
+
1168
+ /**
1169
+ * A secret name
1170
+ */
1171
+ type SecretName = string;
1172
+
1173
+ /**
1174
+ * A secret map contains a secret name and the type which denotes how it is made available within a jobs container
1175
+ */
1176
+ type SecretMap = {
1177
+ name: SecretName;
1178
+ type: SecretAccessType;
1179
+ };
1180
+
1181
+ /**
1182
+ * An application job is a short-lived instance of an application
1183
+ */
1184
+ type ApplicationJob = {
1185
+ id: JobID;
1186
+ app_id: ApplicationID;
1187
+ created_at: ISO8601Timestamp;
1188
+ entrypoint: Entrypoint;
1189
+ command: Command;
1190
+ status: JobStatus;
1191
+ events: JobEvents;
1192
+ image: Image;
1193
+ instance_type?: InstanceType;
1194
+ /**
1195
+ * Allocated vCPUs for this job
1196
+ */
1197
+ vcpu: number;
1198
+ /**
1199
+ * Allocated vCPUs for this job
1200
+ */
1201
+ vcpus: number;
1202
+ /**
1203
+ * Allocated memory for this job
1204
+ */
1205
+ memory_mb: number;
1206
+ /**
1207
+ * Deprecated in favor of memory_mib
1208
+ * @deprecated
1209
+ */
1210
+ memory: MemorySizeWithUnit;
1211
+ /**
1212
+ * Specify the memory to be used for the deployment, in MiB. The default will be the one configured for the account.
1213
+ */
1214
+ memory_mib?: number;
1215
+ /**
1216
+ * The disk configuration for this job expressed in string
1217
+ */
1218
+ disk?: Disk;
1219
+ /**
1220
+ * The disk configuration for this job, expressed as a number (in MB)
1221
+ */
1222
+ disk_mb?: DiskMB;
1223
+ /**
1224
+ * Job specific environment variables
1225
+ */
1226
+ environment_variables: Array<EnvironmentVariable>;
1227
+ /**
1228
+ * Job specific secrets mapping
1229
+ */
1230
+ secrets: Array<SecretMap>;
1231
+ timeout: JobTimeoutSeconds;
1232
+ /**
1233
+ * The job's termination request status. This will be "false" by default. If the user requests a job termination, this will be set to true.
1234
+ */
1235
+ terminate: boolean;
1236
+ };
1237
+
1238
+ /**
1239
+ * Error enums that can be returned when there has been an error with mutating the applications resource
1240
+ */
1241
+ declare enum ApplicationMutationError {
1242
+ IMAGE_REGISTRY_RETURNED_ERROR = "IMAGE_REGISTRY_RETURNED_ERROR",
1243
+ IMAGE_REGISTRY_DOESNT_CONTAIN_IMAGE = "IMAGE_REGISTRY_DOESNT_CONTAIN_IMAGE",
1244
+ VALIDATE_INPUT = "VALIDATE_INPUT",
1245
+ SURPASSED_BASE_LIMITS = "SURPASSED_BASE_LIMITS",
1246
+ SURPASSED_TOTAL_LIMITS = "SURPASSED_TOTAL_LIMITS",
1247
+ LOCATION_NOT_ALLOWED = "LOCATION_NOT_ALLOWED",
1248
+ LOCATION_SURPASSED_BASE_LIMITS = "LOCATION_SURPASSED_BASE_LIMITS",
1249
+ IMAGE_REGISTRY_NOT_CONFIGURED = "IMAGE_REGISTRY_NOT_CONFIGURED",
1250
+ JOB_CREATE_NOT_ALLOWED = "JOB_CREATE_NOT_ALLOWED",
1251
+ DURABLE_OBJECT_NOT_FOUND = "DURABLE_OBJECT_NOT_FOUND",
1252
+ DURABLE_OBJECT_NOT_CONTAINER_ENABLED = "DURABLE_OBJECT_NOT_CONTAINER_ENABLED",
1253
+ DURABLE_OBJECT_ALREADY_HAS_APPLICATION = "DURABLE_OBJECT_ALREADY_HAS_APPLICATION"
1254
+ }
1255
+
1256
+ type ApplicationNotFoundError = {
1257
+ error: string;
1258
+ };
1259
+
1260
+ /**
1261
+ * Progress details of an application rollout.
1262
+ */
1263
+ type ApplicationRolloutProgress = {
1264
+ /**
1265
+ * Total number of steps in the rollout.
1266
+ */
1267
+ total_steps: number;
1268
+ /**
1269
+ * Current step being executed in the rollout process. Initialized to 0.
1270
+ */
1271
+ current_step: number;
1272
+ /**
1273
+ * Number of instances updated in the rollout process.
1274
+ */
1275
+ updated_instances: number;
1276
+ /**
1277
+ * Total number of instances affected by the rollout.
1278
+ */
1279
+ total_instances: number;
1280
+ };
1281
+
1282
+ /**
1283
+ * Steps within the rollout process.
1284
+ */
1285
+ type RolloutStep = {
1286
+ /**
1287
+ * The sequential order of the rollout step, automatically assigned starting from 1, based on the total number of steps in the rollout process.
1288
+ */
1289
+ id: number;
1290
+ step_size: {
1291
+ /**
1292
+ * Percentage of instances affected in this step. Min 10% and Max 100%.
1293
+ */
1294
+ percentage: number;
1295
+ };
1296
+ /**
1297
+ * Description of the rollout step.
1298
+ */
1299
+ description: string;
1300
+ /**
1301
+ * Status of the rollout step.
1302
+ */
1303
+ status: RolloutStep.status;
1304
+ /**
1305
+ * Reason why the step has the current status
1306
+ */
1307
+ reason?: string;
1308
+ started_at?: ISO8601Timestamp;
1309
+ completed_at?: ISO8601Timestamp;
1310
+ };
1311
+ declare namespace RolloutStep {
1312
+ /**
1313
+ * Status of the rollout step.
1314
+ */
1315
+ enum status {
1316
+ PENDING = "pending",
1317
+ PROGRESSING = "progressing",
1318
+ REVERTING = "reverting",
1319
+ COMPLETED = "completed",
1320
+ REVERTED = "reverted"
1321
+ }
1322
+ }
1323
+
1324
+ /**
1325
+ * Represents the status and metadata of a rollout process for an application.
1326
+ */
1327
+ type ApplicationRollout = {
1328
+ description: string;
1329
+ id: RolloutID;
1330
+ created_at: ISO8601Timestamp;
1331
+ /**
1332
+ * Timestamp of the most recent update to status, health, or progress
1333
+ */
1334
+ last_updated_at: ISO8601Timestamp;
1335
+ /**
1336
+ * Kind of the rollout process.
1337
+ * - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
1338
+ * - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
1339
+ * - "durable_objects_auto": Default when the application is a DO application.
1340
+ *
1341
+ */
1342
+ kind: ApplicationRollout.kind;
1343
+ /**
1344
+ * The rollout strategy
1345
+ */
1346
+ strategy: ApplicationRollout.strategy;
1347
+ /**
1348
+ * Current application version before the rollout.
1349
+ */
1350
+ current_version: number;
1351
+ /**
1352
+ * Target application version after the rollout is complete and applied to all current instances.
1353
+ */
1354
+ target_version: number;
1355
+ current_configuration: ModifyUserDeploymentConfiguration;
1356
+ target_configuration: ModifyUserDeploymentConfiguration;
1357
+ /**
1358
+ * Current status of the rollout.
1359
+ */
1360
+ status: ApplicationRollout.status;
1361
+ health: ApplicationHealth;
1362
+ steps: Array<RolloutStep>;
1363
+ progress: ApplicationRolloutProgress;
1364
+ /**
1365
+ * Timestamp when the rollout started.
1366
+ */
1367
+ started_at?: string;
1368
+ };
1369
+ declare namespace ApplicationRollout {
1370
+ /**
1371
+ * Kind of the rollout process.
1372
+ * - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
1373
+ * - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
1374
+ * - "durable_objects_auto": Default when the application is a DO application.
1375
+ *
1376
+ */
1377
+ enum kind {
1378
+ FULL_AUTO = "full_auto",
1379
+ FULL_MANUAL = "full_manual",
1380
+ DURABLE_OBJECTS_AUTO = "durable_objects_auto"
1381
+ }
1382
+ /**
1383
+ * The rollout strategy
1384
+ */
1385
+ enum strategy {
1386
+ ROLLING = "rolling"
1387
+ }
1388
+ /**
1389
+ * Current status of the rollout.
1390
+ */
1391
+ enum status {
1392
+ PENDING = "pending",
1393
+ PROGRESSING = "progressing",
1394
+ COMPLETED = "completed",
1395
+ REVERTED = "reverted",
1396
+ REPLACED = "replaced"
1397
+ }
1398
+ }
1399
+
1400
+ /**
1401
+ * An application status shows information about the application's scheduling status, job queue and other metadata.
1402
+ */
1403
+ type ApplicationStatus = {
1404
+ scheduler: Record<string, any>;
1405
+ /**
1406
+ * Job queue status
1407
+ */
1408
+ jobs: Record<string, any>;
1409
+ };
1410
+
1411
+ type BadRequestError = {
1412
+ error: string;
1413
+ };
1414
+
1415
+ type BadRequestWithCodeError = {
1416
+ /**
1417
+ * If VALIDATE_INPUT, you should see the inputs that were wrong in the details object.
1418
+ */
1419
+ error: BadRequestWithCodeError.error;
1420
+ /**
1421
+ * Details that might be filled depending on the error code.
1422
+ */
1423
+ details?: Record<string, any>;
1424
+ };
1425
+ declare namespace BadRequestWithCodeError {
1426
+ /**
1427
+ * If VALIDATE_INPUT, you should see the inputs that were wrong in the details object.
1428
+ */
1429
+ enum error {
1430
+ VALIDATE_INPUT = "VALIDATE_INPUT"
1431
+ }
1432
+ }
1433
+
1434
+ /**
1435
+ * Represents a complete location object used for setting limits to users and seeing the list of available locations in Coordinator
1436
+ */
1437
+ type Location = {
1438
+ /**
1439
+ * Location name that will be showcased to the user when they see which locations can they schedule on
1440
+ */
1441
+ name: string;
1442
+ region: Region;
1443
+ location: LocationID;
1444
+ };
1445
+
1446
+ /**
1447
+ * Represents an account location with a limit property for customers.
1448
+ */
1449
+ type CompleteAccountLocationCustomer = AccountLocationLimitsAsProperty & AccountLocation & Location;
1450
+
1451
+ /**
1452
+ * An identifier for clients that has an associated account in Cloudchamber. This usually represents a customer identity
1453
+ */
1454
+ type Identity = string;
1455
+
1456
+ /**
1457
+ * Represents a Cloudchamber account object with limits, locations and its defaults. It's the view for the customer.
1458
+ */
1459
+ type CompleteAccountCustomer = {
1460
+ external_account_id: AccountID;
1461
+ legacy_identity: Identity;
1462
+ limits: AccountLimit;
1463
+ locations: Array<CompleteAccountLocationCustomer>;
1464
+ defaults: AccountDefaults;
1465
+ };
1466
+
1467
+ declare enum ContainerImagePreparationStatus {
1468
+ PENDING = "pending",
1469
+ READY = "ready",
1470
+ ERROR = "error"
1471
+ }
1472
+
1473
+ type ContainerImagePreparation = {
1474
+ image: string;
1475
+ status: ContainerImagePreparationStatus;
1476
+ artifact_digest?: string;
1477
+ reason?: string;
1478
+ };
1479
+
1480
+ type CreateApplicationBadRequest = {
1481
+ error: ApplicationMutationError;
1482
+ /**
1483
+ * Details that might be filled depending on the error code.
1484
+ */
1485
+ details?: Record<string, any>;
1486
+ };
1487
+
1488
+ type CreateApplicationJobBadRequest = {
1489
+ error: ApplicationMutationError;
1490
+ /**
1491
+ * Details that might be filled depending on the error code.
1492
+ */
1493
+ details?: Record<string, any>;
1494
+ };
1495
+
1496
+ /**
1497
+ * The secret value that is in plain text. Used only when creating a new secret.
1498
+ */
1499
+ type PlainTextSecretValue = string;
1500
+
1501
+ /**
1502
+ * A job secret map contains a secret name, the plain-text secret itself and the type which denotes how it is made available within a container. This is used in an application job when creating jobs. Their lifetime is the same as the job itself, unlike an account level secret.
1503
+ */
1504
+ type JobSecretMap = {
1505
+ name: SecretName;
1506
+ value: PlainTextSecretValue;
1507
+ type: SecretAccessType;
1508
+ };
1509
+
1510
+ /**
1511
+ * Create a new application Job request body
1512
+ */
1513
+ type CreateApplicationJobRequest = {
1514
+ entrypoint: Entrypoint;
1515
+ command: Command;
1516
+ image?: Image;
1517
+ timeout?: JobTimeoutSeconds;
1518
+ instance_type?: InstanceType;
1519
+ /**
1520
+ * Allocate vCPUs for this job. Vcpu must be at least 0.0625. The input value will be rounded to the nearest 0.0001. It
1521
+ * defaults to the application configuration's vCPUs setting, and if that is not specified, it uses the account defaults.
1522
+ *
1523
+ */
1524
+ vcpus?: number;
1525
+ /**
1526
+ * Allocate vCPUs for this job. Vcpu must be at least 0.0625. The input value will be rounded to the nearest 0.0001. It
1527
+ * defaults to the application configuration's "vCPU" setting, and if that is not specified, it uses the account defaults.
1528
+ *
1529
+ */
1530
+ vcpu?: number;
1531
+ /**
1532
+ * Deprecated in favor of memory_mib
1533
+ * @deprecated
1534
+ */
1535
+ memory?: MemorySizeWithUnit;
1536
+ /**
1537
+ * Amount of memory to allocate for this job, in MiB. It defaults to the application configuration's memory setting,
1538
+ * and if that is not specified, it uses the account defaults.
1539
+ *
1540
+ */
1541
+ memory_mib?: number;
1542
+ /**
1543
+ * Set job specific environment vars. If an env var already exists in the application configuration it would be overriden.
1544
+ */
1545
+ environment_variables?: Array<EnvironmentVariable>;
1546
+ /**
1547
+ * Set job specific secrets.
1548
+ */
1549
+ secrets?: Array<JobSecretMap>;
1550
+ };
1551
+
1552
+ /**
1553
+ * Create a new application object for dynamic scheduling
1554
+ */
1555
+ type CreateApplicationRequest = {
1556
+ /**
1557
+ * The name for this application
1558
+ */
1559
+ name: string;
1560
+ scheduling_policy: SchedulingPolicy;
1561
+ /**
1562
+ * Number of deployments to create
1563
+ */
1564
+ instances: number;
1565
+ /**
1566
+ * Maximum number of instances that the application will allow. This is relevant for applications that auto-scale.
1567
+ */
1568
+ max_instances?: number;
1569
+ constraints?: ApplicationConstraints;
1570
+ /**
1571
+ * The deployment configuration of all deployments created by this application.
1572
+ *
1573
+ */
1574
+ configuration: UserDeploymentConfiguration;
1575
+ observability?: ApplicationObservability;
1576
+ jobs?: ApplicationJobsConfig;
1577
+ /**
1578
+ * If set, it will make the container application back a durable object namespace.
1579
+ */
1580
+ durable_objects?: DurableObjectsConfiguration;
1581
+ affinities?: ApplicationAffinities;
1582
+ priorities?: ApplicationPriorities;
1583
+ rollout_active_grace_period?: ApplicationRolloutActiveGracePeriod;
1584
+ };
1585
+
1586
+ /**
1587
+ * Steps defining the rollout process.
1588
+ */
1589
+ type RolloutStepRequest = {
1590
+ step_size: {
1591
+ /**
1592
+ * Percentage of instances affected in this step. Min 10% and Max 100%.
1593
+ */
1594
+ percentage: number;
1595
+ };
1596
+ /**
1597
+ * Description of the rollout step.
1598
+ */
1599
+ description: string;
1600
+ };
1601
+
1602
+ /**
1603
+ * Request body to create a new rollout for an application.
1604
+ */
1605
+ type CreateApplicationRolloutRequest = {
1606
+ target_configuration: ModifyUserDeploymentConfiguration;
1607
+ /**
1608
+ * Strategy used for the rollout. Currently supports only "rolling".
1609
+ */
1610
+ strategy: CreateApplicationRolloutRequest.strategy;
1611
+ /**
1612
+ * Percentage of rollout to increase in each step when "steps" is not specificed. Applicable values are 5, 10, 20, 25, 50, 100.
1613
+ * These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
1614
+ *
1615
+ */
1616
+ step_percentage?: CreateApplicationRolloutRequest.step_percentage;
1617
+ /**
1618
+ * Steps defining the rollout process, when "step_percentage" is not defined.
1619
+ * Only one of "step_percentage" or "steps" can be defined when creating a rollout.
1620
+ * "steps" allow granular control over each step.
1621
+ *
1622
+ */
1623
+ steps?: Array<RolloutStepRequest>;
1624
+ /**
1625
+ * Description of the rollout process.
1626
+ */
1627
+ description: string;
1628
+ /**
1629
+ * Kind of the rollout process.
1630
+ * - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
1631
+ * - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
1632
+ *
1633
+ */
1634
+ kind?: CreateApplicationRolloutRequest.kind;
1635
+ };
1636
+ declare namespace CreateApplicationRolloutRequest {
1637
+ /**
1638
+ * Strategy used for the rollout. Currently supports only "rolling".
1639
+ */
1640
+ enum strategy {
1641
+ ROLLING = "rolling"
1642
+ }
1643
+ /**
1644
+ * Percentage of rollout to increase in each step when "steps" is not specificed. Applicable values are 5, 10, 20, 25, 50, 100.
1645
+ * These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
1646
+ *
1647
+ */
1648
+ enum step_percentage {
1649
+ "_5" = 5,
1650
+ "_10" = 10,
1651
+ "_20" = 20,
1652
+ "_25" = 25,
1653
+ "_50" = 50,
1654
+ "_100" = 100
1655
+ }
1656
+ /**
1657
+ * Kind of the rollout process.
1658
+ * - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
1659
+ * - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
1660
+ *
1661
+ */
1662
+ enum kind {
1663
+ FULL_AUTO = "full_auto",
1664
+ FULL_MANUAL = "full_manual"
1665
+ }
1666
+ }
1667
+
1668
+ /**
1669
+ * Create a namespace-backed application whose instances are owned by Durable Objects.
1670
+ */
1671
+ type CreateDurableObjectApplicationRequest = {
1672
+ /**
1673
+ * The name for this application.
1674
+ */
1675
+ name: string;
1676
+ scheduling_policy: SchedulingPolicy.DURABLE_OBJECT;
1677
+ /**
1678
+ * The customer-owned Durable Object namespace that owns this application and its instances.
1679
+ */
1680
+ durable_objects: DurableObjectsConfiguration;
1681
+ };
1682
+
1683
+ /**
1684
+ * Error enums that can be returned when there has been an error with mutating the deployments resource
1685
+ */
1686
+ declare enum DeploymentMutationError {
1687
+ VALIDATE_INPUT = "VALIDATE_INPUT",
1688
+ SURPASSED_BASE_LIMITS = "SURPASSED_BASE_LIMITS",
1689
+ SURPASSED_TOTAL_LIMITS = "SURPASSED_TOTAL_LIMITS",
1690
+ LOCATION_NOT_ALLOWED = "LOCATION_NOT_ALLOWED",
1691
+ LOCATION_SURPASSED_BASE_LIMITS = "LOCATION_SURPASSED_BASE_LIMITS",
1692
+ IMAGE_REGISTRY_NOT_CONFIGURED = "IMAGE_REGISTRY_NOT_CONFIGURED"
1693
+ }
1694
+
1695
+ type CreateDeploymentBadRequest = {
1696
+ error: DeploymentMutationError;
1697
+ /**
1698
+ * Details that might be filled depending on the error code.
1699
+ */
1700
+ details?: Record<string, any>;
1701
+ };
1702
+
1703
+ /**
1704
+ * Configuration specified by the scheduler or user to create a deployment
1705
+ */
1706
+ type SchedulerDeploymentConfiguration = {
1707
+ location: LocationID;
1708
+ };
1709
+
1710
+ /**
1711
+ * Request body for creating a new deployment
1712
+ */
1713
+ type CreateDeploymentV2RequestBody = UserDeploymentConfiguration & SchedulerDeploymentConfiguration;
1714
+
1715
+ /**
1716
+ * The type of external registry that is being configured.
1717
+ */
1718
+ declare enum ExternalRegistryKind {
1719
+ ECR = "ECR",
1720
+ DOCKER_HUB = "DockerHub",
1721
+ GAR = "GAR"
1722
+ }
1723
+
1724
+ /**
1725
+ * A reference to a secret stored in Secrets Store
1726
+ */
1727
+ type SecretsStoreRef = {
1728
+ /**
1729
+ * Store ID where the secret is stored
1730
+ */
1731
+ store_id: string;
1732
+ /**
1733
+ * Name of the secret being referenced
1734
+ */
1735
+ secret_name: string;
1736
+ };
1737
+
1738
+ /**
1739
+ * Credentials needed to authenticate with an external image registry.
1740
+ */
1741
+ type ImageRegistryAuth = {
1742
+ /**
1743
+ * The format of this value is determined by the registry being configured.
1744
+ */
1745
+ public_credential: string;
1746
+ private_credential: string | SecretsStoreRef;
1747
+ };
1748
+
1749
+ /**
1750
+ * Request body for creating a new image registry configuration
1751
+ */
1752
+ type CreateImageRegistryRequestBody = {
1753
+ domain: Domain;
1754
+ /**
1755
+ * If you own the registry and is private, this should be false or not defined. If it's a public registry like docker.io, you should set this to true
1756
+ */
1757
+ is_public?: boolean;
1758
+ auth?: ImageRegistryAuth;
1759
+ kind?: ExternalRegistryKind;
1760
+ };
1761
+
1762
+ type CreateSSHPublicKeyError = {
1763
+ error: string;
1764
+ request_id: string;
1765
+ };
1766
+
1767
+ /**
1768
+ * Request body for adding a new SSH public key
1769
+ */
1770
+ type CreateSSHPublicKeyRequestBody = {
1771
+ name: string;
1772
+ public_key: SSHPublicKey;
1773
+ };
1774
+
1775
+ declare enum DefaultImageRegistryKind {
1776
+ DEFAULT = "default"
1777
+ }
1778
+
1779
+ /**
1780
+ * An image registry added in a customer account
1781
+ */
1782
+ type CustomerImageRegistry = {
1783
+ /**
1784
+ * A base64 representation of the public key that you can set to configure the registry. If null, the registry is public and doesn't have authentication setup with Cloudchamber
1785
+ */
1786
+ public_key?: string;
1787
+ private_credential?: SecretsStoreRef;
1788
+ domain: Domain;
1789
+ /**
1790
+ * The type of registry that is being configured.
1791
+ */
1792
+ kind?: ExternalRegistryKind | DefaultImageRegistryKind;
1793
+ created_at: ISO8601Timestamp;
1794
+ };
1795
+
1796
+ /**
1797
+ * Summary representation of a container application, returned by the Dash endpoint.
1798
+ * Contains only the fields needed for list display, not the full configuration.
1799
+ */
1800
+ type DashApplication = {
1801
+ id: ApplicationID;
1802
+ created_at: ISO8601Timestamp;
1803
+ updated_at: ISO8601Timestamp;
1804
+ name: ApplicationName;
1805
+ version: number;
1806
+ instances: number;
1807
+ image: Image;
1808
+ health: ApplicationHealth;
1809
+ };
1810
+
1811
+ type DashApplicationDurableObjectInstance = {
1812
+ id: string;
1813
+ deployment_id?: string;
1814
+ placement_id?: string;
1815
+ assigned_at: string;
1816
+ name?: string;
1817
+ };
1818
+
1819
+ /**
1820
+ * The type of deployment that determines how the deployment executes.
1821
+ *
1822
+ * - "default": Means that the deployment is long-running and will always maintain
1823
+ * a single placement (aka container) running at the same time.
1824
+ * It's the classic and default definition of a deployment in Cloudchamber.
1825
+ * - "jobs": Means that the deployment will subscribe itself to a durable object control plane
1826
+ * that receives jobs to run. It will prewarm a deployment in a metal to receive jobs
1827
+ * and run them immediately.
1828
+ * - "durable_object": Means that the deployment will back a single durable object instance.
1829
+ * It's similar to jobs in the sense that the user decides when the container starts and ends.
1830
+ *
1831
+ * The default is long-running deployments with "default".
1832
+ *
1833
+ */
1834
+ declare enum DeploymentType {
1835
+ DEFAULT = "default",
1836
+ JOBS = "jobs",
1837
+ DURABLE_OBJECT = "durable_object"
1838
+ }
1839
+
1840
+ /**
1841
+ * A monotonic version associated with a specific deployment. The version starts at 0 and increase by 1 every time a change is made.
1842
+ */
1843
+ type DeploymentVersion = number;
1844
+
1845
+ /**
1846
+ * Represents the durable object status of a Placement. If empty, should be assumed that it's disconnected.
1847
+ * - connected: The Placement is connected to a durable object.
1848
+ * - disconnected: The Placement got disconnected from a durable object.
1849
+ *
1850
+ */
1851
+ declare enum DurableObjectStatusHealth {
1852
+ CONNECTED = "connected",
1853
+ DISCONNECTED = "disconnected"
1854
+ }
1855
+
1856
+ /**
1857
+ * Represents the 'status' of a Placement.
1858
+ * - placed: The Placement has been created on a node.
1859
+ * - stopping: The Placement is stopping.
1860
+ * - running: The Placement is running.
1861
+ * - failed: The Placement failed to run.
1862
+ * - stopped: The Placement stopped.
1863
+ * - unhealthy: The Placement has a failing healthcheck.
1864
+ *
1865
+ */
1866
+ declare enum PlacementStatusHealth {
1867
+ PLACED = "placed",
1868
+ STOPPING = "stopping",
1869
+ RUNNING = "running",
1870
+ FAILED = "failed",
1871
+ STOPPED = "stopped",
1872
+ UNHEALTHY = "unhealthy"
1873
+ }
1874
+
1875
+ type PlacementStatus = {
1876
+ /**
1877
+ * Whether the deployment is healthy based on the configured health checks. If no health checks are configured for this deployment, this field is omitted from the response.
1878
+ */
1879
+ health: PlacementStatusHealth;
1880
+ /**
1881
+ * Whether the deployment is ready based on the configured readiness checks. If no readiness checks are configured for this deployment, this field has the same value as "healthy".
1882
+ */
1883
+ ready?: boolean;
1884
+ /**
1885
+ * The container runtime status. Preferred over `health` when deriving
1886
+ * the displayed state in the Dash.
1887
+ */
1888
+ container_status?: string;
1889
+ /**
1890
+ * The status of the placement in relationship to a durable object.
1891
+ * This only applies when the backing application is configured
1892
+ * to connect with a durable object namespace.
1893
+ *
1894
+ */
1895
+ durable_object?: DurableObjectStatusHealth;
1896
+ } & Record<string, any>;
1897
+
1898
+ /**
1899
+ * A Placement represents the lifetime of a single instance of a Deployment. Whereas a Deployment represents your intent to run one or many containers, a Placement represents these containers actually running. Every time you create or update a Deployment, a new Placement is created.
1900
+ */
1901
+ type Placement = {
1902
+ id: PlacementID;
1903
+ created_at: ISO8601Timestamp;
1904
+ deployment_id: DeploymentID;
1905
+ deployment_version: DeploymentVersion;
1906
+ terminate: boolean;
1907
+ status: PlacementStatus;
1908
+ last_update?: ISO8601Timestamp;
1909
+ /**
1910
+ * Set if it backed or is currently backing a durable object actor.
1911
+ */
1912
+ durable_object_actor_id?: string;
1913
+ };
1914
+
1915
+ type DashApplicationInstance = {
1916
+ id: string;
1917
+ created_at: string;
1918
+ current_placement?: Placement;
1919
+ type?: DeploymentType;
1920
+ location: string;
1921
+ region?: string;
1922
+ app_version: number;
1923
+ name?: string;
1924
+ image?: string;
1925
+ };
1926
+
1927
+ type DashApplicationInstances = {
1928
+ instances: DashApplicationInstance[];
1929
+ durable_objects?: DashApplicationDurableObjectInstance[];
1930
+ };
1931
+
1932
+ type DeleteDeploymentError = {
1933
+ error: string;
1934
+ request_id: string;
1935
+ };
1936
+
1937
+ /**
1938
+ * Response body after deleting an image registry.
1939
+ */
1940
+ type DeleteImageRegistryResponse = {
1941
+ domain: string;
1942
+ secrets_store_ref?: string;
1943
+ };
1944
+
1945
+ type DeploymentAlreadyExists = {
1946
+ error: string;
1947
+ };
1948
+
1949
+ /**
1950
+ * Options for HTTP checks.
1951
+ */
1952
+ type DeploymentCheckHTTP = {
1953
+ method: HTTPMethod;
1954
+ /**
1955
+ * If the method is one of POST, PATCH or PUT, this is required. It's the body that will be passed to the HTTP healthcheck request.
1956
+ */
1957
+ body: string;
1958
+ /**
1959
+ * Path that will be used to perform the healthcheck.
1960
+ */
1961
+ path: string;
1962
+ /**
1963
+ * HTTP headers to include in the request.
1964
+ */
1965
+ headers: Record<string, any>;
1966
+ };
1967
+
1968
+ type DeploymentCheck = DeploymentCheckRequestBody & {
1969
+ /**
1970
+ * Name of the check
1971
+ */
1972
+ name: string;
1973
+ /**
1974
+ * Options for HTTP checks. Only valid when "type" is "http"
1975
+ */
1976
+ http?: DeploymentCheckHTTP;
1977
+ /**
1978
+ * Connect to the port using TLS
1979
+ */
1980
+ tls: boolean;
1981
+ /**
1982
+ * Number of times to attempt the check before considering it to have failed
1983
+ */
1984
+ attempts_before_failure: number;
1985
+ };
1986
+
1987
+ type DeploymentCreationError = {
1988
+ error: string;
1989
+ request_id: string;
1990
+ };
1991
+
1992
+ type DeploymentListError = {
1993
+ error: string;
1994
+ request_id: string;
1995
+ };
1996
+
1997
+ /**
1998
+ * Represents some rich information about a location including it's enabled status
1999
+ */
2000
+ type DeploymentLocation = {
2001
+ name: LocationID;
2002
+ /**
2003
+ * Shows if the location is enabled to run deployments
2004
+ */
2005
+ enabled: boolean;
2006
+ /**
2007
+ * Shows the region of the location
2008
+ */
2009
+ region?: Region;
2010
+ };
2011
+
2012
+ type DeploymentModificationError = {
2013
+ error: string;
2014
+ request_id: string;
2015
+ };
2016
+
2017
+ /**
2018
+ * Response when the deployment that is backing the resource is not found.
2019
+ *
2020
+ */
2021
+ type DeploymentNotFoundError = {
2022
+ error: DeploymentNotFoundError.error;
2023
+ };
2024
+ declare namespace DeploymentNotFoundError {
2025
+ enum error {
2026
+ DEPLOYMENT_NOT_FOUND = "DEPLOYMENT_NOT_FOUND"
2027
+ }
2028
+ }
2029
+
2030
+ /**
2031
+ * State of the deployment's current placement
2032
+ */
2033
+ declare enum DeploymentPlacementState {
2034
+ RUNNING = "running",
2035
+ STOPPED = "stopped",
2036
+ STARTING = "starting",
2037
+ STOPPING = "stopping"
2038
+ }
2039
+
2040
+ /**
2041
+ * A reason on why the deployment cannot be placed
2042
+ */
2043
+ declare enum DeploymentQueuedReason {
2044
+ UNKNOWN = "unknown",
2045
+ LOCATION_OVERPROVISIONED = "location_overprovisioned"
2046
+ }
2047
+
2048
+ /**
2049
+ * Details on each property that might make the deployment stuck in the queue
2050
+ */
2051
+ type DeploymentQueuedDetails = {
2052
+ gpu?: DeploymentQueuedReason;
2053
+ cpu?: DeploymentQueuedReason;
2054
+ memory?: DeploymentQueuedReason;
2055
+ disk?: DeploymentQueuedReason;
2056
+ unknown?: DeploymentQueuedReason;
2057
+ };
2058
+
2059
+ type DeploymentReplacementError = {
2060
+ error: string;
2061
+ request_id: string;
2062
+ };
2063
+
2064
+ /**
2065
+ * Current scheduling state of the deployment
2066
+ */
2067
+ declare enum DeploymentSchedulingState {
2068
+ SCHEDULED = "scheduled",
2069
+ PLACED = "placed"
2070
+ }
2071
+
2072
+ type DeploymentState = {
2073
+ current: DeploymentSchedulingState;
2074
+ last_updated: ISO8601Timestamp;
2075
+ queued_details?: DeploymentQueuedDetails;
2076
+ };
2077
+
2078
+ /**
2079
+ * IPv4 address assigned to this deployment
2080
+ */
2081
+ type IPV4 = string;
2082
+
2083
+ /**
2084
+ * Network properties
2085
+ */
2086
+ type Network = {
2087
+ mode: ContainerNetworkMode;
2088
+ ipv4?: IPV4;
2089
+ ipv6?: string;
2090
+ };
2091
+
2092
+ /**
2093
+ * A link to the API endpoint providing full details about a specific object
2094
+ */
2095
+ type Ref = string;
2096
+
2097
+ /**
2098
+ * A Deployment represents an intent to run one or many containers, with the same image, in a particular location or region.
2099
+ */
2100
+ type DeploymentV2 = {
2101
+ id: DeploymentID;
2102
+ app_id?: ApplicationID;
2103
+ app_version?: number;
2104
+ created_at: ISO8601Timestamp;
2105
+ account_id: AccountID;
2106
+ version: DeploymentVersion;
2107
+ type: DeploymentType;
2108
+ image: Image;
2109
+ location: DeploymentLocation;
2110
+ wrangler_ssh?: WranglerSSHConfig;
2111
+ authorized_keys?: Array<UserSSHPublicKey>;
2112
+ /**
2113
+ * A list of SSH public key IDs from the account
2114
+ */
2115
+ ssh_public_key_ids?: Array<SSHPublicKeyID>;
2116
+ /**
2117
+ * A list of objects with secret names and the their access types from the account
2118
+ */
2119
+ secrets?: Array<DeploymentSecretMap>;
2120
+ /**
2121
+ * Container environment variables
2122
+ */
2123
+ environment_variables?: Array<EnvironmentVariable>;
2124
+ /**
2125
+ * Deployment labels
2126
+ */
2127
+ labels?: Array<Label>;
2128
+ current_placement?: Placement;
2129
+ placements_ref: Ref;
2130
+ instance_type?: InstanceType;
2131
+ /**
2132
+ * The vcpu of this deployment
2133
+ */
2134
+ vcpu: number;
2135
+ /**
2136
+ * Deprecated in favor of memory_mib
2137
+ * @deprecated
2138
+ */
2139
+ memory: MemorySizeWithUnit;
2140
+ /**
2141
+ * The memory of this deployment, in MiB
2142
+ */
2143
+ memory_mib: number;
2144
+ /**
2145
+ * The node group of this deployment
2146
+ */
2147
+ node_group: NodeGroup;
2148
+ /**
2149
+ * The disk configuration for this deployment
2150
+ */
2151
+ disk?: Disk;
2152
+ network: Network;
2153
+ /**
2154
+ * Deprecated in favor of gpu_memory_mib
2155
+ * @deprecated
2156
+ */
2157
+ gpu_memory?: MemorySizeWithUnit;
2158
+ /**
2159
+ * The GPU memory of this deployment, in MiB. If deployment is not node_group 'gpu', this will be null
2160
+ */
2161
+ gpu_memory_mib?: number;
2162
+ command?: Command;
2163
+ entrypoint?: Entrypoint;
2164
+ dns?: DNSConfiguration;
2165
+ /**
2166
+ * Health and readiness checks for this deployment.
2167
+ */
2168
+ checks?: Array<DeploymentCheck>;
2169
+ state?: DeploymentState;
2170
+ observability?: Observability;
2171
+ };
2172
+
2173
+ /**
2174
+ * An empty response body
2175
+ */
2176
+ type EmptyResponse = Record<string, any>;
2177
+
2178
+ /**
2179
+ * Generic error details that might be filled depending on the error code.
2180
+ */
2181
+ type GenericErrorDetails = Record<string, any>;
2182
+
2183
+ type GenericErrorResponseWithRequestID = {
2184
+ error: string;
2185
+ request_id: string;
2186
+ };
2187
+
2188
+ /**
2189
+ * Generic response with a message field. Can be used to convey the result of an operation like deleting a resource.
2190
+ */
2191
+ type GenericMessageResponse = {
2192
+ message: string;
2193
+ };
2194
+
2195
+ type GetDeploymentError = {
2196
+ error: string;
2197
+ request_id: string;
2198
+ };
2199
+
2200
+ type GetPlacementError = {
2201
+ error: string;
2202
+ request_id: string;
2203
+ };
2204
+
2205
+ /**
2206
+ * The image registry already exists
2207
+ */
2208
+ type ImageRegistryAlreadyExistsError = {
2209
+ /**
2210
+ * The domain of the registry already exists
2211
+ */
2212
+ error: ImageRegistryAlreadyExistsError.error;
2213
+ /**
2214
+ * Details that might be filled depending on the error code.
2215
+ */
2216
+ details?: Record<string, any>;
2217
+ };
2218
+ declare namespace ImageRegistryAlreadyExistsError {
2219
+ /**
2220
+ * The domain of the registry already exists
2221
+ */
2222
+ enum error {
2223
+ IMAGE_REGISTRY_ALREADY_EXISTS = "IMAGE_REGISTRY_ALREADY_EXISTS"
2224
+ }
2225
+ }
2226
+
2227
+ declare enum ImageRegistryPermissions {
2228
+ PULL = "pull",
2229
+ PUSH = "push",
2230
+ LIBRARY_PUSH = "library_push"
2231
+ }
2232
+
2233
+ /**
2234
+ * Configuration to create credentials to access an image registry
2235
+ */
2236
+ type ImageRegistryCredentialsConfiguration = {
2237
+ permissions: Array<ImageRegistryPermissions>;
2238
+ expiration_minutes: number;
2239
+ };
2240
+
2241
+ /**
2242
+ * The image registry is configured to be public, so it does not have a public key
2243
+ */
2244
+ type ImageRegistryIsPublic = {
2245
+ error: ImageRegistryIsPublic.error;
2246
+ };
2247
+ declare namespace ImageRegistryIsPublic {
2248
+ enum error {
2249
+ IMAGE_REGISTRY_IS_PUBLIC = "IMAGE_REGISTRY_IS_PUBLIC"
2250
+ }
2251
+ }
2252
+
2253
+ /**
2254
+ * The registry is not allowed to be modified
2255
+ */
2256
+ type ImageRegistryNotAllowedError = {
2257
+ /**
2258
+ * The domain of the registry is not allowed to be modified
2259
+ */
2260
+ error: ImageRegistryNotAllowedError.error;
2261
+ /**
2262
+ * Details that might be filled depending on the error code.
2263
+ */
2264
+ details?: Record<string, any>;
2265
+ };
2266
+ declare namespace ImageRegistryNotAllowedError {
2267
+ /**
2268
+ * The domain of the registry is not allowed to be modified
2269
+ */
2270
+ enum error {
2271
+ IMAGE_REGISTRY_NOT_ALLOWED = "IMAGE_REGISTRY_NOT_ALLOWED"
2272
+ }
2273
+ }
2274
+
2275
+ /**
2276
+ * The image registry does not exist
2277
+ */
2278
+ type ImageRegistryNotFoundError = {
2279
+ error: ImageRegistryNotFoundError.error;
2280
+ };
2281
+ declare namespace ImageRegistryNotFoundError {
2282
+ enum error {
2283
+ IMAGE_REGISTRY_NOT_FOUND = "IMAGE_REGISTRY_NOT_FOUND"
2284
+ }
2285
+ }
2286
+
2287
+ /**
2288
+ * The domain and path that the proto is going to resolve to when the Cloudchamber runtime tries to pull from it.
2289
+ */
2290
+ type ImageRegistryProtoDomain = {
2291
+ domain: Domain;
2292
+ path: string;
2293
+ };
2294
+
2295
+ /**
2296
+ * An image registry protocol (`<proto>://<uri>`) is a concept useful so you can refer to multiple registries within the same image ref.
2297
+ * In case you have multiple registries that are storing the same image, it will be highly available to Cloudchamber as it has multiple sources to pull from.
2298
+ * For example, you might push your image to a registry in "my-registry.com/images/hello:1.0", and to Cloudchamber's registry
2299
+ * "registry.cloudchamber.cfdata.org/hello:1.0".
2300
+ * You could call this proto "cf", and it would resolve to both my-registry.com/images and registry.cloudchamber.cfdata.org.
2301
+ * When you create a deployment/app with the format "cf://hello:1.0", the runtime will try to pull from "my-registry.com/images/hello:1.0"
2302
+ * or "registry.cloudchamber.cfdata.org/hello:1.0", depending on availability. If one pull fails it will fallback to the next target.
2303
+ * This is also useful to migrate to another registry progressively.
2304
+ *
2305
+ */
2306
+ type ImageRegistryProtocol = {
2307
+ proto: string;
2308
+ domains: Array<ImageRegistryProtoDomain>;
2309
+ };
2310
+
2311
+ type ImageRegistryProtocolAlreadyExists = {
2312
+ error: ImageRegistryProtocolAlreadyExists.error;
2313
+ };
2314
+ declare namespace ImageRegistryProtocolAlreadyExists {
2315
+ enum error {
2316
+ IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS = "IMAGE_REGISTRY_PROTOCOL_ALREADY_EXISTS"
2317
+ }
2318
+ }
2319
+
2320
+ /**
2321
+ * Returned when deleting an image registry protocol and it is referenced by a resource.
2322
+ */
2323
+ type ImageRegistryProtocolIsReferencedError = {
2324
+ error: ImageRegistryProtocolIsReferencedError.error;
2325
+ };
2326
+ declare namespace ImageRegistryProtocolIsReferencedError {
2327
+ enum error {
2328
+ IMAGE_REGISTRY_PROTO_IS_REFERENCED = "IMAGE_REGISTRY_PROTO_IS_REFERENCED"
2329
+ }
2330
+ }
2331
+
2332
+ /**
2333
+ * The image registry protocol does not exist
2334
+ */
2335
+ type ImageRegistryProtocolNotFound = {
2336
+ error: ImageRegistryProtocolNotFound.error;
2337
+ };
2338
+ declare namespace ImageRegistryProtocolNotFound {
2339
+ enum error {
2340
+ IMAGE_REGISTRY_PROTOCOL_NOT_FOUND = "IMAGE_REGISTRY_PROTOCOL_NOT_FOUND"
2341
+ }
2342
+ }
2343
+
2344
+ type ImageRegistryProtocols = Array<ImageRegistryProtocol>;
2345
+
2346
+ /**
2347
+ * An internal error. Usually happens when Coordinator fails to perform some action with the database
2348
+ */
2349
+ type InternalError = {
2350
+ error: string;
2351
+ request_id: string;
2352
+ };
2353
+
2354
+ /**
2355
+ * Configuration of an IP.
2356
+ */
2357
+ type IPAllocationConfiguration = {
2358
+ /**
2359
+ * Will be filled when a created deployment is assigned to this IP.
2360
+ */
2361
+ deploymentId?: DeploymentID;
2362
+ /**
2363
+ * Will be filled when Cloudchamber assigns this IP to a specific account pool.
2364
+ */
2365
+ accountId?: AccountID;
2366
+ };
2367
+
2368
+ /**
2369
+ * An IP type is an enum that can be v4 or v6
2370
+ */
2371
+ declare enum IPType {
2372
+ V4 = "v4",
2373
+ V6 = "v6"
2374
+ }
2375
+
2376
+ /**
2377
+ * Representation of a port range mapping in the Cloudchamber API.
2378
+ * No two port range for the same IP address can overlap.
2379
+ *
2380
+ */
2381
+ type PortRangeAllocation = {
2382
+ /**
2383
+ * Starting port number of the port range. Inclusive
2384
+ */
2385
+ start: number;
2386
+ /**
2387
+ * Ending port number of the port range. Inclusive.
2388
+ */
2389
+ end: number;
2390
+ allocation?: AddressAssignment;
2391
+ };
2392
+
2393
+ /**
2394
+ * Representation of an IP mapping in the Cloudchamber API. Contains all the necessary information to see if this IP belongs to a deployment or account IP pool, and if it's allocated.
2395
+ */
2396
+ type IPAllocation = {
2397
+ /**
2398
+ * If not assigned to a deployment, or not belonging to a pool, will be undefined.
2399
+ */
2400
+ configuration?: IPAllocationConfiguration;
2401
+ /**
2402
+ * If not allocated, this will be undefined.
2403
+ */
2404
+ allocation?: AddressAssignment;
2405
+ /**
2406
+ * the subnet mask that this IP belongs to
2407
+ */
2408
+ subnetMask: number;
2409
+ ip: IP;
2410
+ ipType?: IPType;
2411
+ portRanges?: Array<PortRangeAllocation>;
2412
+ };
2413
+
2414
+ /**
2415
+ * List of IPs with the filters that matched them
2416
+ */
2417
+ type IPAllocationsWithFilter = {
2418
+ ips: Array<IPAllocation>;
2419
+ filters: Record<string, any>;
2420
+ };
2421
+
2422
+ type JobNotFoundError = {
2423
+ error: string;
2424
+ };
2425
+
2426
+ /**
2427
+ * A list of application objects
2428
+ */
2429
+ type ListApplications = Array<Application>;
2430
+
2431
+ /**
2432
+ * List of deployments
2433
+ */
2434
+ type ListDeploymentsV2 = Array<DeploymentV2>;
2435
+
2436
+ /**
2437
+ * Filter out ips that are not allocated
2438
+ */
2439
+ type ListIPsIsAllocated = boolean;
2440
+
2441
+ /**
2442
+ * All events within a Placement
2443
+ */
2444
+ type PlacementEvents = Array<PlacementEvent>;
2445
+
2446
+ /**
2447
+ * A Placement represents the lifetime of a single instance of a Deployment. This represents a specific placement along with its events.
2448
+ */
2449
+ type PlacementWithEvents = {
2450
+ id: PlacementID;
2451
+ created_at: ISO8601Timestamp;
2452
+ deployment_id: DeploymentID;
2453
+ deployment_version: DeploymentVersion;
2454
+ terminate: boolean;
2455
+ status: PlacementStatus;
2456
+ events: PlacementEvents;
2457
+ last_update?: ISO8601Timestamp;
2458
+ /**
2459
+ * Set if it backed or is currently backing a durable object actor.
2460
+ */
2461
+ durable_object_actor_id?: string;
2462
+ };
2463
+
2464
+ /**
2465
+ * A list of placements along with its events under a deployment
2466
+ */
2467
+ type ListPlacements = Array<PlacementWithEvents>;
2468
+
2469
+ type ListPlacementsError = {
2470
+ error: string;
2471
+ request_id: string;
2472
+ };
2473
+
2474
+ /**
2475
+ * A secret item with its name and other metadata.
2476
+ */
2477
+ type SecretMetadata = {
2478
+ name: string;
2479
+ version: number;
2480
+ created_at: ISO8601Timestamp;
2481
+ updated_at: ISO8601Timestamp;
2482
+ };
2483
+
2484
+ /**
2485
+ * A list of secret metdata.
2486
+ */
2487
+ type ListSecretsMetadata = Array<SecretMetadata>;
2488
+
2489
+ /**
2490
+ * An SSH public key ID and the actual key itself. Useful when listing SSH public keys on an account.
2491
+ */
2492
+ type SSHPublicKeyItem = {
2493
+ id: SSHPublicKeyID;
2494
+ name: string;
2495
+ public_key?: SSHPublicKey;
2496
+ };
2497
+
2498
+ /**
2499
+ * List all SSH public keys in the account
2500
+ */
2501
+ type ListSSHPublicKeys = Array<SSHPublicKeyItem>;
2502
+
2503
+ type ListSSHPublicKeysError = {
2504
+ error: string;
2505
+ request_id: string;
2506
+ };
2507
+
2508
+ type ModifyApplicationBadRequest = {
2509
+ error: ApplicationMutationError;
2510
+ /**
2511
+ * Details that might be filled depending on the error code.
2512
+ */
2513
+ details?: Record<string, any>;
2514
+ };
2515
+
2516
+ type ModifyApplicationJobBadRequest = {
2517
+ error: ApplicationMutationError;
2518
+ /**
2519
+ * Details that might be filled depending on the error code.
2520
+ */
2521
+ details?: Record<string, any>;
2522
+ };
2523
+
2524
+ /**
2525
+ * Modify application job request body
2526
+ */
2527
+ type ModifyApplicationJobRequest = {
2528
+ terminate?: boolean;
2529
+ };
2530
+
2531
+ /**
2532
+ * Request body for modifying an application
2533
+ */
2534
+ type ModifyApplicationRequestBody = {
2535
+ /**
2536
+ * The name for this application
2537
+ */
2538
+ name?: string;
2539
+ /**
2540
+ * Number of deployments to maintain within this applicaiton. This can be used to scale the appliation up/down.
2541
+ */
2542
+ instances?: number;
2543
+ /**
2544
+ * Maximum number of instances that the application will allow. This is relevant for applications that auto-scale.
2545
+ * It will reduce the number of running instances if there are more than `max_instances`.
2546
+ *
2547
+ */
2548
+ max_instances?: number;
2549
+ affinities?: ApplicationAffinities;
2550
+ priorities?: ApplicationPriorities;
2551
+ scheduling_policy?: SchedulingPolicy;
2552
+ constraints?: ApplicationConstraints;
2553
+ rollout_active_grace_period?: ApplicationRolloutActiveGracePeriod;
2554
+ observability?: ApplicationObservability;
2555
+ /**
2556
+ * The deployment configuration of all deployments created by this application.
2557
+ * Right now, if you modify the application configuration, only new deployments
2558
+ * created will have the new configuration. You can delete old deployments to
2559
+ * release new instances.
2560
+ *
2561
+ */
2562
+ configuration?: ModifyUserDeploymentConfiguration;
2563
+ };
2564
+
2565
+ type ModifyDeploymentBadRequest = {
2566
+ error: DeploymentMutationError;
2567
+ /**
2568
+ * Details that might be filled depending on the error code.
2569
+ */
2570
+ details?: Record<string, any>;
2571
+ };
2572
+
2573
+ /**
2574
+ * Request body modifying an existing deployment
2575
+ */
2576
+ type ModifyDeploymentV2RequestBody = {
2577
+ /**
2578
+ * The new image that the deployment will have from now on
2579
+ */
2580
+ image?: string;
2581
+ /**
2582
+ * The new location that the deployment will have from now on
2583
+ */
2584
+ location?: string;
2585
+ /**
2586
+ * A list of SSH public key IDs from the account
2587
+ */
2588
+ ssh_public_key_ids?: Array<SSHPublicKeyID>;
2589
+ /**
2590
+ * A list of objects with secret names and the their access types from the account
2591
+ */
2592
+ secrets?: Array<DeploymentSecretMap>;
2593
+ instance_type?: InstanceType;
2594
+ /**
2595
+ * The new vcpu that the deployment will have from now on
2596
+ */
2597
+ vcpu?: number;
2598
+ /**
2599
+ * Deprecated in favor of memory_mib
2600
+ * @deprecated
2601
+ */
2602
+ memory?: MemorySizeWithUnit;
2603
+ /**
2604
+ * The new memory that the deployment will have from now on
2605
+ */
2606
+ memory_mib?: number;
2607
+ /**
2608
+ * The disk configuration for this deployment
2609
+ */
2610
+ disk?: Disk;
2611
+ /**
2612
+ * Container environment variables
2613
+ */
2614
+ environment_variables?: Array<EnvironmentVariable>;
2615
+ /**
2616
+ * Deployment labels
2617
+ */
2618
+ labels?: Array<Label>;
2619
+ command?: Command;
2620
+ entrypoint?: Entrypoint;
2621
+ dns?: DNSConfiguration;
2622
+ /**
2623
+ * Health and readiness checks for this deployment.
2624
+ */
2625
+ checks?: Array<DeploymentCheckRequestBody>;
2626
+ observability?: Observability;
2627
+ };
2628
+
2629
+ /**
2630
+ * Request body for modifying account defaults
2631
+ */
2632
+ type ModifyMeRequestBody = {
2633
+ defaults?: {
2634
+ /**
2635
+ * Deprecated in favor of memory_mib
2636
+ * @deprecated
2637
+ */
2638
+ memory?: MemorySizeWithUnit;
2639
+ memory_mib?: number;
2640
+ vcpus?: number;
2641
+ disk_mb?: number;
2642
+ };
2643
+ };
2644
+
2645
+ /**
2646
+ * Request body for modifying an existing secret
2647
+ */
2648
+ type ModifySecretRequestBody = {
2649
+ value: PlainTextSecretValue;
2650
+ };
2651
+
2652
+ type PlacementNotFoundError = {
2653
+ error: string;
2654
+ };
2655
+
2656
+ type PrepareContainerImageRequestBody = {
2657
+ image: string;
2658
+ };
2659
+
2660
+ /**
2661
+ * Request body replacing an existing deployment
2662
+ */
2663
+ type ReplaceDeploymentRequestBody = {
2664
+ replace: boolean;
2665
+ };
2666
+
2667
+ /**
2668
+ * An object representing a secret with a name and value. Used when a user creates a new secret.
2669
+ */
2670
+ type Secret = {
2671
+ name: string;
2672
+ value: PlainTextSecretValue;
2673
+ };
2674
+
2675
+ /**
2676
+ * The secret name already exists
2677
+ */
2678
+ type SecretNameAlreadyExists = {
2679
+ /**
2680
+ * The secret name already exists in this account
2681
+ */
2682
+ error: SecretNameAlreadyExists.error;
2683
+ details?: GenericErrorDetails;
2684
+ };
2685
+ declare namespace SecretNameAlreadyExists {
2686
+ /**
2687
+ * The secret name already exists in this account
2688
+ */
2689
+ enum error {
2690
+ SECRET_NAME_ALREADY_EXISTS = "SECRET_NAME_ALREADY_EXISTS"
2691
+ }
2692
+ }
2693
+
2694
+ /**
2695
+ * The secret name does not exist
2696
+ */
2697
+ type SecretNotFound = {
2698
+ error: SecretNotFound.error;
2699
+ };
2700
+ declare namespace SecretNotFound {
2701
+ enum error {
2702
+ SECRET_NAME_NOT_FOUND = "SECRET_NAME_NOT_FOUND"
2703
+ }
2704
+ }
2705
+
2706
+ /**
2707
+ * The ssh public key does not exist
2708
+ */
2709
+ type SSHPublicKeyNotFoundError = {
2710
+ error: SSHPublicKeyNotFoundError.error;
2711
+ };
2712
+ declare namespace SSHPublicKeyNotFoundError {
2713
+ enum error {
2714
+ SSH_PUBLIC_KEY_NOT_FOUND = "SSH_PUBLIC_KEY_NOT_FOUND"
2715
+ }
2716
+ }
2717
+
2718
+ type UnAuthorizedError = {
2719
+ error: string;
2720
+ };
2721
+
2722
+ type UnknownAccount = {
2723
+ error: string;
2724
+ };
2725
+
2726
+ /**
2727
+ * Request body to update a rollout within an application.
2728
+ */
2729
+ type UpdateApplicationRolloutRequest = {
2730
+ /**
2731
+ * Action to perform on the rollout.
2732
+ * - next: The rollout will go forward one step. It will succeed if the current step is finished.
2733
+ * - previous: The rollout will go back one step.
2734
+ * - revert: The rollout goes back to the first step in one go.
2735
+ *
2736
+ */
2737
+ action: UpdateApplicationRolloutRequest.action;
2738
+ };
2739
+ declare namespace UpdateApplicationRolloutRequest {
2740
+ /**
2741
+ * Action to perform on the rollout.
2742
+ * - next: The rollout will go forward one step. It will succeed if the current step is finished.
2743
+ * - previous: The rollout will go back one step.
2744
+ * - revert: The rollout goes back to the first step in one go.
2745
+ *
2746
+ */
2747
+ enum action {
2748
+ NEXT = "next",
2749
+ PREVIOUS = "previous",
2750
+ REVERT = "revert"
2751
+ }
2752
+ }
2753
+
2754
+ /**
2755
+ * Response body when updating a rollout with a specific action.
2756
+ */
2757
+ type UpdateRolloutResponse = {
2758
+ /**
2759
+ * Denotes whether the rollout action was successful
2760
+ */
2761
+ success: boolean;
2762
+ /**
2763
+ * Details of the rollout action. Includes the reason if this rollout action is not successful.
2764
+ */
2765
+ message: string;
2766
+ rollout: ApplicationRollout;
2767
+ };
2768
+
2769
+ type WranglerSSHResponse = {
2770
+ url: string;
2771
+ token: string;
2772
+ };
2773
+
2774
+ declare class AccountService {
2775
+ /**
2776
+ * Get complete account details related to Cloudchamber
2777
+ * Get complete account details related to Cloudchamber, like limits and available locations
2778
+ * @returns CompleteAccountCustomer Complete account for the user
2779
+ * @throws ApiError
2780
+ */
2781
+ static getMe(): CancelablePromise<CompleteAccountCustomer>;
2782
+ /**
2783
+ * Modify account details like defaults
2784
+ * Modify account details like defaults
2785
+ * @param requestBody
2786
+ * @returns CompleteAccountCustomer Complete account for the user
2787
+ * @throws ApiError
2788
+ */
2789
+ static modifyMe(requestBody: ModifyMeRequestBody): CancelablePromise<CompleteAccountCustomer>;
2790
+ }
2791
+
2792
+ declare class ApplicationsService {
2793
+ /**
2794
+ * Create a new application
2795
+ * Create a new application. An Application represents an intent to run one or more containers, with the same image, dynamically scheduled based on constraints
2796
+ * @param requestBody
2797
+ * @returns Application A newly created application
2798
+ * @throws ApiError
2799
+ */
2800
+ static createApplication(requestBody: CreateApplicationRequest | CreateDurableObjectApplicationRequest): CancelablePromise<Application>;
2801
+ /**
2802
+ * List Applications associated with your account
2803
+ * Lists all the applications that are associated with your account
2804
+ * @param name Filter applications by name
2805
+ * @param image Filter applications by image
2806
+ * @param label Filter applications by label
2807
+ * @returns ListApplications Get all application associated with your account
2808
+ * @throws ApiError
2809
+ */
2810
+ static listApplications(name?: ApplicationName, image?: Image, label?: Array<string>): CancelablePromise<ListApplications>;
2811
+ /**
2812
+ * Get a single application by id
2813
+ * Returns a single application by id
2814
+ * @param applicationId
2815
+ * @returns Application A single application
2816
+ * @throws ApiError
2817
+ */
2818
+ static getApplication(applicationId: ApplicationID): CancelablePromise<Application>;
2819
+ /**
2820
+ * Modify an application
2821
+ * Modifies a single application by id.
2822
+ * @param applicationId
2823
+ * @param requestBody
2824
+ * @returns Application Modify application response
2825
+ * @throws ApiError
2826
+ */
2827
+ static modifyApplication(applicationId: ApplicationID, requestBody: ModifyApplicationRequestBody): CancelablePromise<Application>;
2828
+ /**
2829
+ * Delete a single application by id
2830
+ * Deletes a single application by id
2831
+ * @param applicationId
2832
+ * @returns EmptyResponse Delete application response
2833
+ * @throws ApiError
2834
+ */
2835
+ static deleteApplication(applicationId: ApplicationID): CancelablePromise<EmptyResponse>;
2836
+ /**
2837
+ * Application queue status
2838
+ * Get an application's queue status. Only works under an application with type jobs.
2839
+ * @param applicationId
2840
+ * @returns ApplicationStatus Application status with details about the job queue, instances and other metadata for introspection.
2841
+ * @throws ApiError
2842
+ */
2843
+ static getApplicationStatus(applicationId: ApplicationID): CancelablePromise<ApplicationStatus>;
2844
+ /**
2845
+ * Create a new job within an application
2846
+ * Returns the created job
2847
+ * @param applicationId
2848
+ * @param requestBody
2849
+ * @returns ApplicationJob A single job within an application
2850
+ * @throws ApiError
2851
+ */
2852
+ static createApplicationJob(applicationId: ApplicationID, requestBody: CreateApplicationJobRequest): CancelablePromise<ApplicationJob>;
2853
+ /**
2854
+ * Get an application job by application and job id
2855
+ * Returns a single application job by id with its current status
2856
+ * @param applicationId
2857
+ * @param jobId
2858
+ * @returns ApplicationJob A single application
2859
+ * @throws ApiError
2860
+ */
2861
+ static getApplicationJob(applicationId: ApplicationID, jobId: JobID): CancelablePromise<ApplicationJob>;
2862
+ /**
2863
+ * Delete an application job by application and job id
2864
+ * Cleans up the specific job from the Application and all its assoicated resources
2865
+ * @param applicationId
2866
+ * @param jobId
2867
+ * @returns GenericMessageResponse Generic OK response
2868
+ * @throws ApiError
2869
+ */
2870
+ static deleteApplicationJob(applicationId: ApplicationID, jobId: JobID): CancelablePromise<GenericMessageResponse>;
2871
+ /**
2872
+ * Modify an existing application job
2873
+ * Modify an application job state
2874
+ * @param applicationId
2875
+ * @param jobId
2876
+ * @param requestBody
2877
+ * @returns ApplicationJob A modified job within an application
2878
+ * @throws ApiError
2879
+ */
2880
+ static modifyApplicationJob(applicationId: ApplicationID, jobId: JobID, requestBody: ModifyApplicationJobRequest): CancelablePromise<ApplicationJob>;
2881
+ /**
2882
+ * Create a new rollout for an application
2883
+ * A rollout can be used to update the application's configuration across instances with minimal downtime.
2884
+ * @param applicationId
2885
+ * @param requestBody
2886
+ * @returns ApplicationRollout
2887
+ * @throws ApiError
2888
+ */
2889
+ static createApplicationRollout(applicationId: ApplicationID, requestBody: CreateApplicationRolloutRequest): CancelablePromise<ApplicationRollout>;
2890
+ /**
2891
+ * List rollouts
2892
+ * List all rollouts within an application
2893
+ * @param applicationId
2894
+ * @param limit The amount of rollouts to return. By default it is all of them.
2895
+ * @param last The last rollout that was used to paginate
2896
+ * @returns ApplicationRollout
2897
+ * @throws ApiError
2898
+ */
2899
+ static listApplicationRollouts(applicationId: ApplicationID, limit?: number, last?: string): CancelablePromise<Array<ApplicationRollout>>;
2900
+ /**
2901
+ * Get a rollout by id within an application
2902
+ * View rollout configurations and state for a specific rollout
2903
+ * @param applicationId
2904
+ * @param rolloutId
2905
+ * @returns ApplicationRollout
2906
+ * @throws ApiError
2907
+ */
2908
+ static getApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID): CancelablePromise<ApplicationRollout>;
2909
+ /**
2910
+ * Update a rollout within an application
2911
+ * A rollout can be updated to modify its current state. Actions include - next, previous, rollback
2912
+ * @param applicationId
2913
+ * @param rolloutId
2914
+ * @param requestBody
2915
+ * @returns UpdateRolloutResponse
2916
+ * @throws ApiError
2917
+ */
2918
+ static updateApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID, requestBody: UpdateApplicationRolloutRequest): CancelablePromise<UpdateRolloutResponse>;
2919
+ /**
2920
+ * Delete a rollout within an application by its rollout id
2921
+ * Cleans up the specific rollout from the Application if it is not in use
2922
+ * @param applicationId
2923
+ * @param rolloutId
2924
+ * @returns EmptyResponse
2925
+ * @throws ApiError
2926
+ */
2927
+ static deleteApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID): CancelablePromise<EmptyResponse>;
2928
+ /**
2929
+ * Get a single applications deployments
2930
+ * Returns a single applications deployments
2931
+ * @param applicationId
2932
+ * @returns ListDeploymentsV2 List of deployments with their corresponding placements
2933
+ * @throws ApiError
2934
+ */
2935
+ static listDeploymentsByApplication(applicationId: ApplicationID): CancelablePromise<ListDeploymentsV2>;
2936
+ /**
2937
+ * Get a specific deployment within an application
2938
+ * Get a deployment by its app and deployment IDs
2939
+ * @param applicationId
2940
+ * @param deploymentId
2941
+ * @returns DeploymentV2 Get a specific deployment along with its respective placements
2942
+ * @throws ApiError
2943
+ */
2944
+ static getApplicationsV3Deployment(applicationId: ApplicationID, deploymentId: DeploymentID): CancelablePromise<DeploymentV2>;
2945
+ /**
2946
+ * Recreate an existing deployment within an application.
2947
+ * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
2948
+ *
2949
+ * @param applicationId
2950
+ * @param deploymentId
2951
+ * @param requestBody
2952
+ * @returns DeploymentV2 Deployment created
2953
+ * @throws ApiError
2954
+ */
2955
+ static recreateDeploymentV3(applicationId: ApplicationID, deploymentId: DeploymentID, requestBody: ModifyUserDeploymentConfiguration): CancelablePromise<DeploymentV2>;
2956
+ /**
2957
+ * List container applications with pagination (Dash endpoint)
2958
+ * Returns summary application data suitable for list display
2959
+ * @param perPage Number of results per page
2960
+ * @param pageToken Token for fetching the next page
2961
+ * @returns PaginatedResult<DashApplication[]> Paginated list of applications
2962
+ * @throws ApiError
2963
+ */
2964
+ static listDashApplications(perPage?: number, pageToken?: string): CancelablePromise<PaginatedResult<DashApplication[]>>;
2965
+ /**
2966
+ * List container instances for a given application
2967
+ * Returns instances and optional durable object instances with pagination support
2968
+ * @param applicationId
2969
+ * @param perPage Number of results per page
2970
+ * @param pageToken Token for fetching the next page
2971
+ * @returns PaginatedResult<DashApplicationInstances> Paginated list of instances
2972
+ * @throws ApiError
2973
+ */
2974
+ static listDashApplicationInstances(applicationId: ApplicationID, perPage?: number, pageToken?: string): CancelablePromise<PaginatedResult<DashApplicationInstances>>;
2975
+ }
2976
+
2977
+ declare class ContainerImagePreparationsService {
2978
+ /**
2979
+ * Prepare a digest-pinned managed image for the Containers runtime.
2980
+ */
2981
+ static prepareContainerImage(requestBody: PrepareContainerImageRequestBody): CancelablePromise<ContainerImagePreparation>;
2982
+ }
2983
+
2984
+ declare class DeploymentsService {
2985
+ /**
2986
+ * Get a specific deployment within an application
2987
+ * Get a deployment by its app and deployment IDs
2988
+ * @param applicationId
2989
+ * @param deploymentId
2990
+ * @returns DeploymentV2 Get a specific deployment along with its respective placements
2991
+ * @throws ApiError
2992
+ */
2993
+ static getApplicationsV3Deployment(applicationId: ApplicationID, deploymentId: DeploymentID): CancelablePromise<DeploymentV2>;
2994
+ /**
2995
+ * Recreate an existing deployment within an application.
2996
+ * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
2997
+ *
2998
+ * @param applicationId
2999
+ * @param deploymentId
3000
+ * @param requestBody
3001
+ * @returns DeploymentV2 Deployment created
3002
+ * @throws ApiError
3003
+ */
3004
+ static recreateDeploymentV3(applicationId: ApplicationID, deploymentId: DeploymentID, requestBody: ModifyUserDeploymentConfiguration): CancelablePromise<DeploymentV2>;
3005
+ /**
3006
+ * Get credentials to SSH into a Container
3007
+ * Get a JWT to hit the SSH port on a given container.
3008
+ * @param instanceId
3009
+ * @returns WranglerSSHResponse Credentials to SSH into a Container
3010
+ * @throws ApiError
3011
+ */
3012
+ static containerWranglerSsh(instanceId: DeploymentID): CancelablePromise<WranglerSSHResponse>;
3013
+ /**
3014
+ * Create a new deployment
3015
+ * Creates a new deployment. A Deployment represents an intent to run one container, with image, in a particular location
3016
+ * @param requestBody
3017
+ * @returns DeploymentV2 Deployment created
3018
+ * @throws ApiError
3019
+ */
3020
+ static createDeploymentV2(requestBody: CreateDeploymentV2RequestBody): CancelablePromise<DeploymentV2>;
3021
+ /**
3022
+ * List deployments
3023
+ * List all deployments in the current account. Optionally filter them
3024
+ * @param appId Filter deployments by application id
3025
+ * @param location Filter deployments by location
3026
+ * @param image Filter deployments by image
3027
+ * @param state Filter deployments by placement state
3028
+ * @param ipv4 Filter deployments by ipv4 address
3029
+ * @param label Filter deployments by label
3030
+ * @returns ListDeploymentsV2 List of deployments with their corresponding placements
3031
+ * @throws ApiError
3032
+ */
3033
+ static listDeploymentsV2(appId?: ApplicationID, location?: LocationID, image?: Image, state?: DeploymentPlacementState, ipv4?: IPV4, label?: Array<string>): CancelablePromise<ListDeploymentsV2>;
3034
+ /**
3035
+ * Get a specific deployment
3036
+ * Get a deployment by its deployment
3037
+ * @param deploymentId
3038
+ * @returns DeploymentV2 Get a specific deployment along with its respective placements
3039
+ * @throws ApiError
3040
+ */
3041
+ static getDeploymentV2(deploymentId: DeploymentID): CancelablePromise<DeploymentV2>;
3042
+ /**
3043
+ * Modify an existing deployment
3044
+ * Change specific properties in an existing deployment
3045
+ * @param deploymentId
3046
+ * @param requestBody
3047
+ * @returns DeploymentV2 Deployment modified
3048
+ * @throws ApiError
3049
+ */
3050
+ static modifyDeploymentV2(deploymentId: DeploymentID, requestBody: ModifyDeploymentV2RequestBody): CancelablePromise<DeploymentV2>;
3051
+ /**
3052
+ * Delete a specific deployment
3053
+ * Delete a deployment by its deployment ID
3054
+ * @param deploymentId
3055
+ * @returns EmptyResponse Delete a specific deployment along with its respective placements
3056
+ * @throws ApiError
3057
+ */
3058
+ static deleteDeploymentV2(deploymentId: DeploymentID): CancelablePromise<EmptyResponse>;
3059
+ /**
3060
+ * Recreate an existing deployment.
3061
+ * The given existing deployment is deleted and a replacement deployment is created. The latter retains some properties of the former that cannot be set by the client.
3062
+ *
3063
+ * @param deploymentId
3064
+ * @param requestBody
3065
+ * @returns DeploymentV2 Deployment created
3066
+ * @throws ApiError
3067
+ */
3068
+ static recreateDeployment(deploymentId: DeploymentID, requestBody: CreateDeploymentV2RequestBody): CancelablePromise<DeploymentV2>;
3069
+ /**
3070
+ * Replace a deployment
3071
+ * You can stop the current placement and create a new one. The new one will have the same durable properties of the deployment, but will otherwise be like new
3072
+ * @param placementId
3073
+ * @param requestBody
3074
+ * @returns DeploymentV2 Deployment replaced
3075
+ * @throws ApiError
3076
+ */
3077
+ static replaceDeployment(placementId: PlacementID, requestBody: ReplaceDeploymentRequestBody): CancelablePromise<DeploymentV2>;
3078
+ }
3079
+
3080
+ declare class ImageRegistriesService {
3081
+ /**
3082
+ * Create an image registry protocol that resolves to multiple domains.
3083
+ * @param requestBody
3084
+ * @returns ImageRegistryProtocol The image registry protocol was created
3085
+ * @throws ApiError
3086
+ */
3087
+ static createImageRegistryProtocol(requestBody: ImageRegistryProtocol): CancelablePromise<ImageRegistryProtocol>;
3088
+ /**
3089
+ * List all image registry protocols.
3090
+ * @returns ImageRegistryProtocols The image registry protocols in the account
3091
+ * @throws ApiError
3092
+ */
3093
+ static listImageRegistryProtocols(): CancelablePromise<ImageRegistryProtocols>;
3094
+ /**
3095
+ * Modify an image registry protocol. The previous list of domains will be replaced by the ones you specify in this endpoint.
3096
+ * @param requestBody
3097
+ * @returns ImageRegistryProtocol The image registry protocol was modified
3098
+ * @throws ApiError
3099
+ */
3100
+ static modifyImageRegistryProtocol(requestBody: ImageRegistryProtocol): CancelablePromise<ImageRegistryProtocol>;
3101
+ /**
3102
+ * Delete an image registry protocol. Be careful, if there is deployments running referencing this protocol they won't be able to pull the image.
3103
+ * @param proto
3104
+ * @returns EmptyResponse Image registry protocol was deleted successfully
3105
+ * @throws ApiError
3106
+ */
3107
+ static deleteImageRegistryProto(proto: string): CancelablePromise<EmptyResponse>;
3108
+ /**
3109
+ * Get a JWT to pull from the image registry
3110
+ * Get a JWT to pull from the image registry specifying its domain
3111
+ * @param domain
3112
+ * @param requestBody
3113
+ * @returns AccountRegistryToken Credentials with 'pull' or 'push' permissions to access the registry
3114
+ * @throws ApiError
3115
+ */
3116
+ static generateImageRegistryCredentials(domain: string, requestBody: ImageRegistryCredentialsConfiguration): CancelablePromise<AccountRegistryToken>;
3117
+ /**
3118
+ * Delete a registry from the account
3119
+ * Delete a registry from the account, this will make Cloudchamber unable to pull images from the registry
3120
+ * @param domain
3121
+ * @returns EmptyResponse The image registry is deleted
3122
+ * @throws ApiError
3123
+ */
3124
+ static deleteImageRegistry(domain: string): CancelablePromise<DeleteImageRegistryResponse>;
3125
+ /**
3126
+ * Get the list of configured registries in the account
3127
+ * Get the list of configured registries in the account
3128
+ * @returns CustomerImageRegistry The list of registries that are added in the account
3129
+ * @throws ApiError
3130
+ */
3131
+ static listImageRegistries(): CancelablePromise<Array<CustomerImageRegistry>>;
3132
+ /**
3133
+ * Add a new image registry configuration
3134
+ * Add a new image registry into your account, so then Cloudflare can pull docker images with public key JWT authentication
3135
+ * @param requestBody
3136
+ * @returns CustomerImageRegistry Created a new image registry in the account
3137
+ * @throws ApiError
3138
+ */
3139
+ static createImageRegistry(requestBody: CreateImageRegistryRequestBody): CancelablePromise<CustomerImageRegistry>;
3140
+ }
3141
+
3142
+ declare class IPsService {
3143
+ /**
3144
+ * List IPs
3145
+ * List IPs
3146
+ * @param placementId Filter out ips that are not assigned to the specified placement, can also be known as 'alloc_id' in Nomad.
3147
+ * @param allocated Filter out ips that are not allocated
3148
+ * @param ipType Filter out ips by type
3149
+ * @param deploymentId Filter out by deployment ID
3150
+ * @returns IPAllocationsWithFilter Result of listing IPs
3151
+ * @throws ApiError
3152
+ */
3153
+ static listIPs(placementId?: PlacementID, allocated?: ListIPsIsAllocated, ipType?: IPType, deploymentId?: DeploymentID): CancelablePromise<IPAllocationsWithFilter>;
3154
+ }
3155
+
3156
+ declare class JobsService {
3157
+ /**
3158
+ * Application queue status
3159
+ * Get an application's queue status. Only works under an application with type jobs.
3160
+ * @param applicationId
3161
+ * @returns ApplicationStatus Application status with details about the job queue, instances and other metadata for introspection.
3162
+ * @throws ApiError
3163
+ */
3164
+ static getApplicationStatus(applicationId: ApplicationID): CancelablePromise<ApplicationStatus>;
3165
+ /**
3166
+ * Create a new job within an application
3167
+ * Returns the created job
3168
+ * @param applicationId
3169
+ * @param requestBody
3170
+ * @returns ApplicationJob A single job within an application
3171
+ * @throws ApiError
3172
+ */
3173
+ static createApplicationJob(applicationId: ApplicationID, requestBody: CreateApplicationJobRequest): CancelablePromise<ApplicationJob>;
3174
+ /**
3175
+ * Get an application job by application and job id
3176
+ * Returns a single application job by id with its current status
3177
+ * @param applicationId
3178
+ * @param jobId
3179
+ * @returns ApplicationJob A single application
3180
+ * @throws ApiError
3181
+ */
3182
+ static getApplicationJob(applicationId: ApplicationID, jobId: JobID): CancelablePromise<ApplicationJob>;
3183
+ /**
3184
+ * Delete an application job by application and job id
3185
+ * Cleans up the specific job from the Application and all its assoicated resources
3186
+ * @param applicationId
3187
+ * @param jobId
3188
+ * @returns GenericMessageResponse Generic OK response
3189
+ * @throws ApiError
3190
+ */
3191
+ static deleteApplicationJob(applicationId: ApplicationID, jobId: JobID): CancelablePromise<GenericMessageResponse>;
3192
+ /**
3193
+ * Modify an existing application job
3194
+ * Modify an application job state
3195
+ * @param applicationId
3196
+ * @param jobId
3197
+ * @param requestBody
3198
+ * @returns ApplicationJob A modified job within an application
3199
+ * @throws ApiError
3200
+ */
3201
+ static modifyApplicationJob(applicationId: ApplicationID, jobId: JobID, requestBody: ModifyApplicationJobRequest): CancelablePromise<ApplicationJob>;
3202
+ }
3203
+
3204
+ declare class PlacementsService {
3205
+ /**
3206
+ * List placements
3207
+ * List all placements under a given deploymentID with all its events
3208
+ * @param deploymentId
3209
+ * @returns ListPlacements A list of placements along with its events under a deployment
3210
+ * @throws ApiError
3211
+ */
3212
+ static listPlacements(deploymentId: DeploymentID): CancelablePromise<ListPlacements>;
3213
+ /**
3214
+ * Get placement
3215
+ * A Placement represents the lifetime of a single instance of a Deployment
3216
+ * @param placementId
3217
+ * @returns PlacementWithEvents A specific placement along with its events
3218
+ * @throws ApiError
3219
+ */
3220
+ static getPlacement(placementId: PlacementID): CancelablePromise<PlacementWithEvents>;
3221
+ /**
3222
+ * Replace a deployment
3223
+ * You can stop the current placement and create a new one. The new one will have the same durable properties of the deployment, but will otherwise be like new
3224
+ * @param placementId
3225
+ * @param requestBody
3226
+ * @returns DeploymentV2 Deployment replaced
3227
+ * @throws ApiError
3228
+ */
3229
+ static replaceDeployment(placementId: PlacementID, requestBody: ReplaceDeploymentRequestBody): CancelablePromise<DeploymentV2>;
3230
+ }
3231
+
3232
+ declare class RolloutsService {
3233
+ /**
3234
+ * Create a new rollout for an application
3235
+ * A rollout can be used to update the application's configuration across instances with minimal downtime.
3236
+ * @param applicationId
3237
+ * @param requestBody
3238
+ * @returns ApplicationRollout
3239
+ * @throws ApiError
3240
+ */
3241
+ static createApplicationRollout(applicationId: ApplicationID, requestBody: CreateApplicationRolloutRequest): CancelablePromise<ApplicationRollout>;
3242
+ /**
3243
+ * List rollouts
3244
+ * List all rollouts within an application
3245
+ * @param applicationId
3246
+ * @param limit The amount of rollouts to return. By default it is all of them.
3247
+ * @param last The last rollout that was used to paginate
3248
+ * @returns ApplicationRollout
3249
+ * @throws ApiError
3250
+ */
3251
+ static listApplicationRollouts(applicationId: ApplicationID, limit?: number, last?: string): CancelablePromise<Array<ApplicationRollout>>;
3252
+ /**
3253
+ * Get a rollout by id within an application
3254
+ * View rollout configurations and state for a specific rollout
3255
+ * @param applicationId
3256
+ * @param rolloutId
3257
+ * @returns ApplicationRollout
3258
+ * @throws ApiError
3259
+ */
3260
+ static getApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID): CancelablePromise<ApplicationRollout>;
3261
+ /**
3262
+ * Update a rollout within an application
3263
+ * A rollout can be updated to modify its current state. Actions include - next, previous, rollback
3264
+ * @param applicationId
3265
+ * @param rolloutId
3266
+ * @param requestBody
3267
+ * @returns UpdateRolloutResponse
3268
+ * @throws ApiError
3269
+ */
3270
+ static updateApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID, requestBody: UpdateApplicationRolloutRequest): CancelablePromise<UpdateRolloutResponse>;
3271
+ /**
3272
+ * Delete a rollout within an application by its rollout id
3273
+ * Cleans up the specific rollout from the Application if it is not in use
3274
+ * @param applicationId
3275
+ * @param rolloutId
3276
+ * @returns EmptyResponse
3277
+ * @throws ApiError
3278
+ */
3279
+ static deleteApplicationRollout(applicationId: ApplicationID, rolloutId: RolloutID): CancelablePromise<EmptyResponse>;
3280
+ }
3281
+
3282
+ declare class SecretsService {
3283
+ /**
3284
+ * Add a new secret to the account
3285
+ * Add a new secret to the account that can be associated with an application/deployment.
3286
+ * @param requestBody
3287
+ * @returns SecretMetadata Secret created successfully
3288
+ * @throws ApiError
3289
+ */
3290
+ static createSecret(requestBody: Secret): CancelablePromise<SecretMetadata>;
3291
+ /**
3292
+ * List Secrets
3293
+ * List all secrets in an account with metadata
3294
+ * @returns ListSecretsMetadata List Secrets response
3295
+ * @throws ApiError
3296
+ */
3297
+ static listSecrets(): CancelablePromise<ListSecretsMetadata>;
3298
+ /**
3299
+ * Get secret metadata
3300
+ * Get secret metadata by name
3301
+ * @param secretName
3302
+ * @returns SecretMetadata Get secret response
3303
+ * @throws ApiError
3304
+ */
3305
+ static getSecret(secretName: string): CancelablePromise<SecretMetadata>;
3306
+ /**
3307
+ * Update an existing secret
3308
+ * Update a secret within an account. This bumps its version field. Corresponding applications/deployments would get the updated secret in its next placement.
3309
+ * @param secretName
3310
+ * @param requestBody
3311
+ * @returns SecretMetadata Modify Secrets response
3312
+ * @throws ApiError
3313
+ */
3314
+ static modifySecret(secretName: string, requestBody: ModifySecretRequestBody): CancelablePromise<SecretMetadata>;
3315
+ /**
3316
+ * Delete an existing secret
3317
+ * Delete a secret within an account.
3318
+ * @param secretName
3319
+ * @returns GenericMessageResponse Generic OK response
3320
+ * @throws ApiError
3321
+ */
3322
+ static deleteSecret(secretName: string): CancelablePromise<GenericMessageResponse>;
3323
+ }
3324
+
3325
+ declare class SshPublicKeysService {
3326
+ /**
3327
+ * Add SSH public key
3328
+ * Adds a new ssh public key to an account. This can then be associated with a specific deployment during its creation or modification.
3329
+ * @param requestBody
3330
+ * @returns SSHPublicKeyItem SSH Public key added successfully
3331
+ * @throws ApiError
3332
+ */
3333
+ static createSshPublicKey(requestBody: CreateSSHPublicKeyRequestBody): CancelablePromise<SSHPublicKeyItem>;
3334
+ /**
3335
+ * List SSH Public keys
3336
+ * List all SSH Public keys in an account
3337
+ * @returns ListSSHPublicKeys List SSH Public keys response
3338
+ * @throws ApiError
3339
+ */
3340
+ static listSshPublicKeys(): CancelablePromise<ListSSHPublicKeys>;
3341
+ /**
3342
+ * Delete SSH public key from the account
3343
+ * Delete an SSH public key from an account.
3344
+ * @param sshPublicKeyName
3345
+ * @returns EmptyResponse SSH Public key was removed successfully
3346
+ * @throws ApiError
3347
+ */
3348
+ static deleteSshPublicKey(sshPublicKeyName: string): CancelablePromise<EmptyResponse>;
3349
+ }
3350
+
3351
+ type DockerfileContainerConfig = Exclude<ContainerNormalizedConfig, ImageURIConfig>;
3352
+ type BuiltImage = {
3353
+ localTag: string;
3354
+ localTagCleaned?: boolean;
3355
+ };
3356
+ type BuiltContainerImage = BuiltImage & {
3357
+ container: DockerfileContainerConfig;
3358
+ };
3359
+ declare function isDockerfileContainerConfig(container: ContainerNormalizedConfig): container is DockerfileContainerConfig;
3360
+ /**
3361
+ * `{ remoteDigest: string }` implies the image was pushed to, or already exists in,
3362
+ * the managed registry. Deployments should use this digest-pinned reference.
3363
+ *
3364
+ * `{ newTag: string }` implies the image was built locally without pushing.
3365
+ */
3366
+ type ImageRef = {
3367
+ remoteDigest: string;
3368
+ } | {
3369
+ newTag: string;
3370
+ };
3371
+ type ContainerBuildCommandArgs = {
3372
+ PATH: string;
3373
+ tag: string;
3374
+ pathToDocker?: string;
3375
+ push: boolean;
3376
+ platform?: string;
3377
+ };
3378
+ type ContainerPushCommandArgs = {
3379
+ TAG: string;
3380
+ pathToDocker?: string;
3381
+ };
3382
+ type StartedContainerBuild = Awaited<ReturnType<typeof dockerBuild>>;
3383
+ /**
3384
+ * Builds a container image from the given container options.
3385
+ *
3386
+ * @param build - Container configuration including the Dockerfile path, build context, and image tag.
3387
+ * @param pathToDocker - Path to the Docker CLI executable.
3388
+ * @param verifyDockerIsRunning - When `true` (the default), verifies Docker is installed
3389
+ * and the daemon is running before building. Set to `false` when the caller has already
3390
+ * performed this check.
3391
+ * @returns An object with an `abort` function and a `ready` promise.
3392
+ */
3393
+ declare function startContainerBuild({ build, pathToDocker, verifyDockerIsRunning, }: {
3394
+ build: BuildArgs;
3395
+ pathToDocker: string;
3396
+ verifyDockerIsRunning?: boolean;
3397
+ }): Promise<StartedContainerBuild>;
3398
+ /**
3399
+ * Checks the remote manifest to see if there are changes, and only push if there are
3400
+ */
3401
+ declare function pushImageIfChanged({ pathToDocker, sourceTag, targetTag, containerConfig, accountId, complianceConfig, cleanupSourceTag, }: {
3402
+ pathToDocker: string;
3403
+ sourceTag: string;
3404
+ targetTag: string;
3405
+ containerConfig?: DockerfileContainerConfig;
3406
+ accountId?: string;
3407
+ complianceConfig?: ComplianceConfig;
3408
+ cleanupSourceTag?: boolean;
3409
+ }): Promise<ImageRef>;
3410
+ /**
3411
+ * Builds an image from the container build command arguments and optionally
3412
+ * pushes it to the Cloudflare managed registry.
3413
+ *
3414
+ * @param args - Parsed container build command arguments.
3415
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3416
+ * @returns A promise that resolves when the build and optional push complete.
3417
+ */
3418
+ declare function buildCommand(args: ContainerBuildCommandArgs, complianceConfig?: ComplianceConfig): Promise<void>;
3419
+ declare function pushCommand(args: ContainerPushCommandArgs, accountId: string, complianceConfig?: ComplianceConfig): Promise<void>;
3420
+ /**
3421
+ * Builds a Docker image and optionally pushes it to the Cloudflare managed
3422
+ * registry.
3423
+ *
3424
+ * @param args - Build arguments including tag, Dockerfile path, build context, and platform.
3425
+ * @param pathToDocker - Path to the Docker CLI executable.
3426
+ * @param push - Whether to push the built image to the remote registry.
3427
+ * @param containerConfig - Optional container configuration for limit validation.
3428
+ * @param verifyDockerIsRunning - Whether to verify Docker before building.
3429
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3430
+ * @returns An {@link ImageRef} describing the built or pushed image.
3431
+ */
3432
+ declare function buildAndMaybePush(args: BuildArgs, pathToDocker: string, push: boolean, containerConfig?: DockerfileContainerConfig, verifyDockerIsRunning?: boolean, complianceConfig?: ComplianceConfig): Promise<ImageRef>;
3433
+ /**
3434
+ * Builds configured Dockerfile-based container images for deployment.
3435
+ *
3436
+ * @param containers - Normalized container configuration.
3437
+ * @param pathToDocker - Path to the Docker CLI executable.
3438
+ * @param verifyDockerIsRunning - Whether to verify Docker before building.
3439
+ * @returns The built image metadata paired with each Dockerfile-based container.
3440
+ */
3441
+ declare function buildContainerImages(containers: ContainerNormalizedConfig[], pathToDocker: string, verifyDockerIsRunning?: boolean): Promise<BuiltContainerImage[]>;
3442
+ /**
3443
+ * Pushes a configured, already-built container image to the managed registry.
3444
+ *
3445
+ * @param builtImage - Built Dockerfile-based container image metadata.
3446
+ * @param versionId - Version ID used to derive the pushed image tag.
3447
+ * @param pathToDocker - Path to the Docker CLI executable.
3448
+ * @param accountId - Account that owns the managed registry.
3449
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3450
+ * @returns An {@link ImageRef} describing the pushed image.
3451
+ */
3452
+ declare function pushBuiltContainerImage(builtImage: BuiltContainerImage, versionId: string, pathToDocker: string, accountId: string, complianceConfig?: ComplianceConfig): Promise<ImageRef>;
3453
+ /**
3454
+ * Removes local Docker image tags created during a build.
3455
+ *
3456
+ * @param builtImages - Built images to clean up.
3457
+ * @param pathToDocker - Path to the Docker CLI executable.
3458
+ */
3459
+ declare function cleanupBuiltImages<T extends BuiltImage>(builtImages: T[], pathToDocker: string): Promise<void>;
3460
+ declare function getContainerImageTag(containerConfig: DockerfileContainerConfig, imageTag: string): string;
3461
+ /**
3462
+ * Spawns a Docker build process and returns a handle to abort or await the build.
3463
+ *
3464
+ * By default this function first verifies that the Docker daemon is reachable.
3465
+ * Callers that have already performed this check (e.g. the dev and deploy flows)
3466
+ * should pass `verifyDockerIsRunning: false` to avoid a redundant check.
3467
+ *
3468
+ * @param dockerPath - Path to the Docker CLI executable.
3469
+ * @param options - Build options including the command arguments and Dockerfile content.
3470
+ * @param options.buildCmd - The Docker build command arguments.
3471
+ * @param options.dockerfile - The Dockerfile content to pipe into stdin.
3472
+ * @param options.verifyDockerIsRunning - When `true` (the default), verifies Docker is installed
3473
+ * and the daemon is running before spawning the build. Set to `false` to skip the check.
3474
+ *
3475
+ * @returns An object with an `abort` function and a `ready` promise.
3476
+ */
3477
+ declare function dockerBuild(dockerPath: string, options: {
3478
+ buildCmd: string[];
3479
+ dockerfile: string;
3480
+ verifyDockerIsRunning?: boolean;
3481
+ }): Promise<{
3482
+ abort: () => void;
3483
+ ready: Promise<void>;
3484
+ }>;
3485
+
3486
+ declare let logger: Logger;
3487
+ declare let fetchResult: FetchResultFetcher;
3488
+ declare let fetchPagedListResult: FetchPagedListResultFetcher;
3489
+ type ContainersSharedContext = {
3490
+ logger: Logger;
3491
+ fetchResult: FetchResultFetcher;
3492
+ fetchPagedListResult?: FetchPagedListResultFetcher;
3493
+ };
3494
+ declare function initContainersSharedContext(ctx: ContainersSharedContext): void;
3495
+
3496
+ type DeployContainersArgs = {
3497
+ dispatchNamespace?: string;
3498
+ versionId: string;
3499
+ accountId: string;
3500
+ scriptName: string;
3501
+ };
3502
+ type ObservabilityWriteTarget = "top-level" | "configuration";
3503
+ type ResolvedContainerDeployment = {
3504
+ container: ContainerNormalizedConfig;
3505
+ imageRef: ImageRef;
3506
+ };
3507
+ type DurableObjectNamespace = {
3508
+ id: string;
3509
+ class: string;
3510
+ name: string;
3511
+ script: string;
3512
+ use_sqlite: boolean;
3513
+ dispatch_namespace?: string;
3514
+ /**
3515
+ * Set when the namespace belongs to a Worker preview. For those, `script` is
3516
+ * the parent Worker's name, so `preview.id` is what distinguishes a
3517
+ * preview's namespace from the parent's and from other previews'.
3518
+ */
3519
+ preview?: {
3520
+ id: string;
3521
+ slug: string;
3522
+ name: string;
3523
+ };
3524
+ };
3525
+ declare function createDurableObjectNamespaceResolver(config: Config, { versionId, accountId, scriptName, dispatchNamespace }: DeployContainersArgs): (className: string) => Promise<string>;
3526
+ declare function deployContainers(config: Config, containerDeployments: ResolvedContainerDeployment[], { versionId, accountId, scriptName, dispatchNamespace }: DeployContainersArgs): Promise<void>;
3527
+ declare function listDurableObjects(complianceConfig: ComplianceConfig, accountId: string): Promise<DurableObjectNamespace[]>;
3528
+ declare function apply(args: {
3529
+ imageRef: ImageRef;
3530
+ durable_object_namespace_id: string;
3531
+ }, containerConfig: ContainerNormalizedConfig, config: Config, accountId: string): Promise<void>;
3532
+ declare function formatError(err: ApiError): string;
3533
+ /**
3534
+ * clean up application object received from API so that we get a nicer diff when comparing it to the current config.
3535
+ *
3536
+ * @param prev - Previously deployed application returned by the API.
3537
+ * @param currentConfig - Current normalized container configuration.
3538
+ * @param accountId - Cloudflare account ID that owns managed-registry images.
3539
+ * @param observabilityWriteTarget - API field used for observability updates.
3540
+ * @param complianceConfig - Compliance configuration used to normalize managed-registry image references.
3541
+ * @returns The cleaned application fields used to generate the deployment diff.
3542
+ */
3543
+ declare function cleanApplicationFromAPI(prev: Application, currentConfig: ContainerNormalizedConfig, accountId: string, observabilityWriteTarget: ObservabilityWriteTarget, complianceConfig?: ComplianceConfig): Partial<ModifyApplicationRequestBody> & Pick<Application, "configuration">;
3544
+ declare const configRolloutStepsToAPI: (rolloutSteps: number | number[]) => {
3545
+ step_percentage: number;
3546
+ steps?: undefined;
3547
+ } | {
3548
+ steps: RolloutStepRequest[];
3549
+ step_percentage?: undefined;
3550
+ };
3551
+
3552
+ /**
3553
+ * @deprecated When trying to compute the difference between two json object use `diffJsonObjects` instead
3554
+ * (as it includes a more polished print representation and it also includes information regarding
3555
+ * the difference between the two objects)
3556
+ * (For diffing other values, such as TOMLs this class should still be used, hopefully we'll be
3557
+ * able to move away from TOML files at some point)
3558
+ */
3559
+ declare class Diff {
3560
+ #private;
3561
+ get changes(): number;
3562
+ constructor(a: string, b: string);
3563
+ toString(options?: {
3564
+ contextLines: number;
3565
+ }): string;
3566
+ print(options?: {
3567
+ contextLines: number;
3568
+ }): void;
3569
+ }
3570
+
3571
+ declare function configureOpenAPIForContainerPull(accountId: string, apiToken: string, apiBase?: string): void;
3572
+ /**
3573
+ * Gets push and pull credentials for a configured image registry
3574
+ * and runs `docker login`, so subsequent image pushes or pulls are
3575
+ * authenticated
3576
+ */
3577
+ declare function dockerLoginImageRegistry(pathToDocker: string, domain: string): Promise<void>;
3578
+
3579
+ declare function getCloudflareContainerRegistry(complianceConfig?: ComplianceConfig$1): string;
3580
+ /** Prefixes with the cloudflare-dev namespace. The name should be the container's DO classname, and the tag a build uuid. */
3581
+ declare const getDevContainerImageName: (name: string, tag: string) => string;
3582
+ /**
3583
+ * Docker's FUSE requirements: expose the device, allow mounts through
3584
+ * `SYS_ADMIN`, and disable the entire default AppArmor profile because it
3585
+ * blocks FUSE mounts.
3586
+ */
3587
+ declare const FUSE_CONTAINER_PRIVILEGES: {
3588
+ capabilities: string[];
3589
+ devices: {
3590
+ pathOnHost: string;
3591
+ pathInContainer: string;
3592
+ cgroupPermissions: string;
3593
+ }[];
3594
+ securityOpt: string[];
3595
+ };
3596
+
3597
+ declare function getInstanceTypeUsage(instanceType: InstanceType): {
3598
+ vcpu: number;
3599
+ memory_mib: number;
3600
+ disk_mb: number;
3601
+ };
3602
+ declare function inferInstanceType(config: UserDeploymentConfiguration): InstanceType | undefined;
3603
+ /**
3604
+ * Removes any disk, memory, or vCPU set in an object's configuration. Used by
3605
+ * Cloudchamber apply to render diffs using the equivalent `instance_type`.
3606
+ */
3607
+ declare function cleanForInstanceType(app: CreateApplicationRequest): ContainerApp;
3608
+ declare function ensureContainerLimits(options: {
3609
+ pathToDocker: string;
3610
+ imageTag: string;
3611
+ account: CompleteAccountCustomer;
3612
+ containerConfig?: ContainerNormalizedConfig;
3613
+ }): Promise<void>;
3614
+ declare function ensureImageFitsLimits(options: {
3615
+ availableSizeInBytes: number;
3616
+ pathToDocker: string;
3617
+ imageTag: string;
3618
+ }): Promise<void>;
3619
+ declare function getContainerAccount(accountId?: string, complianceConfig?: ComplianceConfig): Promise<CompleteAccountCustomer>;
3620
+
3621
+ /**
3622
+ * Removes from the object every undefined property
3623
+ */
3624
+ declare function stripUndefined<T = Record<string, unknown>>(r: T): T;
3625
+ /**
3626
+ * Take an object and sort its keys in alphabetical order recursively.
3627
+ * Useful to normalize objects so they can be compared when rendered.
3628
+ * It will copy the object and not mutate it.
3629
+ */
3630
+ declare function sortObjectRecursive<T = Record<string | number, unknown>>(object: Record<string | number, unknown> | Record<string | number, unknown>[]): T;
3631
+
3632
+ /** helper for simple docker command call that don't require any io handling */
3633
+ declare const runDockerCmd: (dockerPath: string, args: string[], stdio?: StdioOptions) => {
3634
+ abort: () => void;
3635
+ ready: Promise<{
3636
+ aborted: boolean;
3637
+ }>;
3638
+ then: (resolve: () => void, reject: () => void) => void;
3639
+ };
3640
+ declare const runDockerCmdWithOutput: (dockerPath: string, args: string[]) => string;
3641
+ /**
3642
+ * Permit elevated container options only when the selected daemon adds an
3643
+ * isolation boundary. Rootless Docker limits `SYS_ADMIN` to its user
3644
+ * namespace. Local Docker engines on macOS and through WSL run their Linux
3645
+ * daemon in a VM.
3646
+ */
3647
+ declare function containerPrivilegesAllowed(dockerHost: string, dockerPath?: string): Promise<boolean>;
3648
+ /** Checks whether docker is running on the system */
3649
+ declare const isDockerRunning: (dockerPath: string) => Promise<boolean>;
3650
+ /** Options for verifying that Docker is installed and the daemon is running. */
3651
+ type VerifyDockerInstalledOptions = {
3652
+ /** Path to the Docker CLI executable. */
3653
+ dockerPath: string;
3654
+ /**
3655
+ * Human-readable description of the operation that requires Docker,
3656
+ * e.g. `"running dev"`, `"deploying"`.
3657
+ * When provided, the error headline reads "... before ${operation} ...".
3658
+ * When omitted, the "before ..." clause is left out entirely.
3659
+ */
3660
+ operation?: string;
3661
+ /**
3662
+ * Noun describing what needs to be built, used in the error headline.
3663
+ * For example `"the configured image"` or `"the configured images"`.
3664
+ */
3665
+ imageNoun: string;
3666
+ /**
3667
+ * Optional context-specific hint appended at the end of the error message.
3668
+ * When omitted, no hint paragraph is included.
3669
+ */
3670
+ hint?: string;
3671
+ };
3672
+ /**
3673
+ * Verifies that Docker is installed and the daemon is running.
3674
+ *
3675
+ * @throws {UserError} If the Docker CLI cannot be reached.
3676
+ *
3677
+ * @param options - Docker verification options.
3678
+ * @param options.dockerPath - Path to the Docker CLI executable.
3679
+ * @param options.operation - Optional human-readable operation description for the error message
3680
+ * headline. When provided, produces "before ${operation}". When omitted, the clause is skipped.
3681
+ * @param options.imageNoun - Noun describing what needs to be built (e.g. "the configured image").
3682
+ * @param options.hint - Optional context-specific hint appended to the error message.
3683
+ */
3684
+ declare const verifyDockerInstalled: ({ dockerPath, operation, imageNoun, hint, }: VerifyDockerInstalledOptions) => Promise<void>;
3685
+ /**
3686
+ * Kills and removes any containers which come from the given image tag
3687
+ */
3688
+ declare const cleanupContainers: (dockerPath: string, imageTags: Set<string>) => boolean;
3689
+ /**
3690
+ * See https://docs.docker.com/reference/cli/docker/container/ls/#ancestor
3691
+ *
3692
+ * @param dockerPath The path to the Docker executable
3693
+ * @param imageTags A set of ancestor image tags
3694
+ * @returns The ids of all containers that share the given image tags as ancestors.
3695
+ */
3696
+ declare function getContainerIdsByImageTags(dockerPath: string, imageTags: Set<string>): string[];
3697
+ declare const getContainerIdsFromImage: (dockerPath: string, ancestorImage: string) => string[];
3698
+ /**
3699
+ * While all ports are exposed in prod, a limitation of local dev with docker is that
3700
+ * users will have to manually expose ports in their Dockerfile.
3701
+ * We want to fail early and clearly if a user tries to develop with a container
3702
+ * that has no ports exposed and is definitely not accessible.
3703
+ *
3704
+ * (A user could still use `getTCPPort()` on a port that is not exposed, but we leave that error for runtime.)
3705
+ */
3706
+ declare function checkExposedPorts(dockerPath: string, options: ContainerDevOptions): Promise<void>;
3707
+ /**
3708
+ * Generates a random container build id
3709
+ */
3710
+ declare function generateContainerBuildId(): string;
3711
+ /**
3712
+ * Run `docker context ls` to get the socket from the currently active Docker context
3713
+ * @returns The socket path or null if we are not able to determine it
3714
+ */
3715
+ declare function getDockerSocketFromContext(dockerPath: string): string | null;
3716
+ /**
3717
+ * Resolve Docker host as follows:
3718
+ * 1. Check WRANGLER_DOCKER_HOST environment variable
3719
+ * 2. Check DOCKER_HOST environment variable
3720
+ * 3. Try to get socket from active Docker context
3721
+ * 4. Fall back to platform-specific defaults
3722
+ */
3723
+ declare function resolveDockerHost(dockerPath: string): string;
3724
+ /**
3725
+ *
3726
+ * Get docker host from environment variables or platform defaults.
3727
+ * Does not use the docker context ls command, so we
3728
+ */
3729
+ declare const getDockerHostFromEnv: () => string;
3730
+ /**
3731
+ * Get all repository tags for a given image
3732
+ */
3733
+ declare function getImageRepoTags(dockerPath: string, imageTag: string): Promise<string[]>;
3734
+ /**
3735
+ * Checks if the given image has any duplicate tags from previous dev sessions,
3736
+ * and remove them if so.
3737
+ */
3738
+ declare function cleanupDuplicateImageTags(dockerPath: string, imageTag: string): Promise<void>;
3739
+
3740
+ declare function dockerImageInspect(dockerPath: string, options: {
3741
+ imageTag: string;
3742
+ formatString: string;
3743
+ }): Promise<string>;
3744
+
3745
+ /**
3746
+ * Adds the Cloudflare account namespace to an image tag in the managed registry.
3747
+ *
3748
+ * @param accountID - Cloudflare account ID that owns the image.
3749
+ * @param tag - Image name and tag to namespace.
3750
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3751
+ * @returns The fully qualified managed-registry image reference.
3752
+ */
3753
+ declare const getCloudflareRegistryWithAccountNamespace: (accountID: string, tag: string, complianceConfig?: ComplianceConfig$1) => string;
3754
+ declare const MF_DEV_CONTAINER_PREFIX = "cloudflare-dev";
3755
+
3756
+ declare const DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE = "cloudflare/proxy-everything:3cb1195@sha256:0ef6716c52430096900b150d84a3302057d6cd2319dae7987128c85d0733e3c8";
3757
+ declare function getEgressInterceptorPlatform(): string | undefined;
3758
+ declare function getEgressInterceptorImage(): string;
3759
+ declare function pullEgressInterceptorImage(dockerPath: string): Promise<void>;
3760
+ /**
3761
+ * Pulls a prebuilt image for local container development.
3762
+ *
3763
+ * @param dockerPath - Path to the Docker CLI executable.
3764
+ * @param options - Container image and local development tag configuration.
3765
+ * @param logger - Logger used for recoverable registry credential warnings.
3766
+ * @param complianceConfig - Compliance configuration used to identify the managed registry.
3767
+ * @returns An object with an `abort` function and a `ready` promise.
3768
+ */
3769
+ declare function pullImage(dockerPath: string, options: Exclude<ContainerDevOptions, DockerfileConfig>, logger: WranglerLogger | ViteLogger, complianceConfig?: ComplianceConfig$1): Promise<{
3770
+ abort: () => void;
3771
+ ready: Promise<void>;
3772
+ }>;
3773
+ /**
3774
+ *
3775
+ * Builds or pulls the container images for local development. This
3776
+ * will be called before starting the local development server, and by a rebuild
3777
+ * hotkey during development.
3778
+ *
3779
+ * Because this runs when local dev starts, we also do some validation here,
3780
+ * such as checking if the Docker CLI is installed, and if the container images
3781
+ * expose any ports.
3782
+ *
3783
+ * @param args - Image preparation callbacks, Docker settings, and compliance configuration.
3784
+ * @returns A promise that resolves when all configured images are ready.
3785
+ */
3786
+ declare function prepareContainerImagesForDev(args: {
3787
+ dockerPath: string;
3788
+ containerOptions: ContainerDevOptions[];
3789
+ onContainerImagePreparationStart: (args: {
3790
+ containerOptions: ContainerDevOptions;
3791
+ abort: () => void;
3792
+ }) => void;
3793
+ onContainerImagePreparationEnd: (args: {
3794
+ containerOptions: ContainerDevOptions;
3795
+ }) => void;
3796
+ logger: WranglerLogger | ViteLogger;
3797
+ complianceConfig?: ComplianceConfig$1;
3798
+ }): Promise<void>;
3799
+ /**
3800
+ * Resolve an image name to the full unambiguous name.
3801
+ *
3802
+ * image:tag -> prepend registry.cloudflare.com/accountid/
3803
+ * registry.cloudflare.com/image:tag -> registry.cloudflare.com/accountid/image:tag
3804
+ * registry.cloudflare.com/accountid/image:tag -> no change
3805
+ * anyother-registry.com/anything -> no change
3806
+ *
3807
+ * @param accountId - Cloudflare account ID that owns managed-registry images.
3808
+ * @param image - Image reference to normalize.
3809
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3810
+ * @returns The normalized image reference.
3811
+ */
3812
+ declare function resolveImageName(accountId: string, image: string, complianceConfig?: ComplianceConfig$1): string;
3813
+ /**
3814
+ * Get type of container registry, and validate.
3815
+ * We support the configured Cloudflare managed registry plus the external registries listed in
3816
+ * `acceptedRegistries` below (currently AWS ECR, DockerHub, and Google Artifact Registry).
3817
+ *
3818
+ * @param domain - Registry hostname to validate.
3819
+ * @param complianceConfig - Compliance configuration used to select the managed registry.
3820
+ * @returns The matching registry type and credential metadata.
3821
+ */
3822
+ declare const getAndValidateRegistryType: (domain: string, complianceConfig?: ComplianceConfig$1) => RegistryPattern;
3823
+ interface RegistryPattern {
3824
+ type: ExternalRegistryKind | "cloudflare";
3825
+ secretType?: string;
3826
+ pattern: RegExp;
3827
+ name: string;
3828
+ }
3829
+ /**
3830
+ * Validates a Google service account JSON key and returns it base64-encoded for
3831
+ * storage as the private credential.
3832
+ *
3833
+ * Accepts the raw JSON key contents or its base64-encoded form. Throws a
3834
+ * `UserError` if the key is malformed, or if `expectedEmail` (the
3835
+ * `--gar-email` public credential) does not match the `client_email` in the key.
3836
+ */
3837
+ declare function validateAndEncodeGarKey(rawKey: string, expectedEmail: string): string;
3838
+
3839
+ declare function promiseSpinner<T>(promise: Promise<T>, { message, }?: {
3840
+ message: string;
3841
+ }): Promise<T>;
3842
+
3843
+ export { type AccountDefaults, type AccountID, type AccountLimit, type AccountLocation, type AccountLocationLimits, type AccountLocationLimitsAsProperty, type AccountRegistryToken, AccountService, type AddressAssignment, ApiError, type Application, type ApplicationAffinities, ApplicationAffinityColocation, ApplicationAffinityHardwareGeneration, type ApplicationConstraintPop, type ApplicationConstraints, type ApplicationHealth, type ApplicationHealthInstances, type ApplicationID, type ApplicationJob, type ApplicationJobsConfig, ApplicationMutationError, type ApplicationName, type ApplicationNotFoundError, type ApplicationObservability, type ApplicationPriorities, type ApplicationPriority, ApplicationRollout, type ApplicationRolloutActiveGracePeriod, type ApplicationRolloutProgress, type ApplicationSchedulingHint, type ApplicationStatus, ApplicationsService, AssignIPv4, AssignIPv6, type BadRequestError, BadRequestWithCodeError, type BuildArgs, type BuiltContainerImage, type BuiltImage, CancelError, CancelablePromise, type City, type Command, type CompleteAccountCustomer, type CompleteAccountLocationCustomer, type ContainerBuildCommandArgs, type ContainerDevOptions, type ContainerImagePreparation, ContainerImagePreparationStatus, ContainerImagePreparationsService, ContainerNetworkMode, type ContainerNormalizedConfig, type ContainerPushCommandArgs, type ContainersSharedContext, type CreateApplicationBadRequest, type CreateApplicationJobBadRequest, type CreateApplicationJobRequest, type CreateApplicationRequest, CreateApplicationRolloutRequest, type CreateDeploymentBadRequest, type CreateDeploymentV2RequestBody, type CreateDurableObjectApplicationRequest, type CreateImageRegistryRequestBody, type CreateSSHPublicKeyError, type CreateSSHPublicKeyRequestBody, type CustomerImageRegistry, DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE, type DNSConfiguration, type DashApplication, type DashApplicationDurableObjectInstance, type DashApplicationInstance, type DashApplicationInstances, type DeleteDeploymentError, type DeleteImageRegistryResponse, type DeploymentAlreadyExists, type DeploymentCheck, type DeploymentCheckHTTP, type DeploymentCheckHTTPRequestBody, DeploymentCheckKind, type DeploymentCheckRequestBody, DeploymentCheckType, type DeploymentCreationError, type DeploymentID, type DeploymentListError, type DeploymentLocation, type DeploymentModificationError, DeploymentMutationError, DeploymentNotFoundError, DeploymentPlacementState, type DeploymentQueuedDetails, DeploymentQueuedReason, type DeploymentReplacementError, DeploymentSchedulingState, type DeploymentSecretMap, type DeploymentState, DeploymentType, type DeploymentV2, type DeploymentVersion, DeploymentsService, Diff, type Disk, type DiskMB, type DiskSizeWithUnit, type DockerfileConfig, type DockerfileContainerConfig, type Domain, type DurableObjectNamespace, DurableObjectStatusHealth, type DurableObjectsConfiguration, type Duration, type EmptyResponse, type Entrypoint, type EnvironmentVariable, type EnvironmentVariableName, type EnvironmentVariableValue, EventName, EventType, type ExecFormParam, ExternalRegistryKind, FUSE_CONTAINER_PRIVILEGES, type GenericErrorDetails, type GenericErrorResponseWithRequestID, type GenericMessageResponse, type GetDeploymentError, type GetPlacementError, HTTPMethod, type IP, type IPAllocation, type IPAllocationConfiguration, type IPAllocationsWithFilter, IPType, type IPV4, IPsService, type ISO8601Timestamp, type Identity, type Image, type ImageRef, ImageRegistriesService, ImageRegistryAlreadyExistsError, type ImageRegistryAuth, type ImageRegistryCredentialsConfiguration, ImageRegistryIsPublic, ImageRegistryNotAllowedError, ImageRegistryNotFoundError, ImageRegistryPermissions, type ImageRegistryProtoDomain, type ImageRegistryProtocol, ImageRegistryProtocolAlreadyExists, ImageRegistryProtocolIsReferencedError, ImageRegistryProtocolNotFound, type ImageRegistryProtocols, type ImageURIConfig, InstanceType, type InstanceTypeOrLimits, type InternalError, type JobEvents, type JobID, type JobNotFoundError, type JobSecretMap, type JobStatus, JobStatusHealth, type JobTimeoutSeconds, JobsService, type Label, type LabelName, type LabelValue, type ListApplications, type ListDeploymentsV2, type ListIPsIsAllocated, type ListPlacements, type ListPlacementsError, type ListSSHPublicKeys, type ListSSHPublicKeysError, type ListSecretsMetadata, type Location, type LocationID, MF_DEV_CONTAINER_PREFIX, type MemorySizeWithUnit, type ModifyApplicationBadRequest, type ModifyApplicationJobBadRequest, type ModifyApplicationJobRequest, type ModifyApplicationRequestBody, type ModifyDeploymentBadRequest, type ModifyDeploymentV2RequestBody, type ModifyMeRequestBody, type ModifySecretRequestBody, type ModifyUserDeploymentConfiguration, type Network, NetworkMode, type NetworkParameters, NodeGroup, type Observability, type ObservabilityLogs, OpenAPI, type OpenAPIConfig, type PaginatedResult, type Placement, type PlacementEvent, type PlacementEvents, type PlacementID, type PlacementNotFoundError, type PlacementStatus, PlacementStatusHealth, type PlacementWithEvents, PlacementsService, type PlainTextSecretValue, type Port, type PortRange, type PortRangeAllocation, type PrepareContainerImageRequestBody, ProvisionerConfiguration, type Ref, type Region, type ReplaceDeploymentRequestBody, type ResolvedContainerDeployment, type ResultInfo, type RolloutID, RolloutStep, type RolloutStepRequest, RolloutsService, type SSHPublicKey, type SSHPublicKeyID, type SSHPublicKeyItem, SSHPublicKeyNotFoundError, type SchedulerDeploymentConfiguration, SchedulingPolicy, type Secret, SecretAccessType, type SecretMap, type SecretMetadata, type SecretName, SecretNameAlreadyExists, SecretNotFound, SecretsService, type SecretsStoreRef, type SharedContainerConfig, SshPublicKeysService, type UnAuthorizedError, type UnixTimestamp, type UnknownAccount, UpdateApplicationRolloutRequest, type UpdateRolloutResponse, type UserDeploymentConfiguration, type UserSSHPublicKey, type VerifyDockerInstalledOptions, type ViteLogger, type WranglerLogger, type WranglerSSHConfig, type WranglerSSHResponse, apply, buildAndMaybePush, buildCommand, buildContainerImages, checkExposedPorts, cleanApplicationFromAPI, cleanForInstanceType, cleanupBuiltImages, cleanupContainers, cleanupDuplicateImageTags, configRolloutStepsToAPI, configureOpenAPIForContainerPull, containerPrivilegesAllowed, createDurableObjectNamespaceResolver, deployContainers, dockerBuild, dockerImageInspect, dockerLoginImageRegistry, ensureContainerLimits, ensureImageFitsLimits, fetchPagedListResult, fetchResult, formatError, generateContainerBuildId, getAndValidateRegistryType, getCloudflareContainerRegistry, getCloudflareRegistryWithAccountNamespace, getContainerAccount, getContainerIdsByImageTags, getContainerIdsFromImage, getContainerImageTag, getDevContainerImageName, getDockerHostFromEnv, getDockerSocketFromContext, getEgressInterceptorImage, getEgressInterceptorPlatform, getImageRepoTags, getInstanceTypeUsage, inferInstanceType, initContainersSharedContext, isDockerRunning, isDockerfileContainerConfig, listDurableObjects, logger, prepareContainerImagesForDev, promiseSpinner, pullEgressInterceptorImage, pullImage, pushBuiltContainerImage, pushCommand, pushImageIfChanged, request, requestPaginated, resolveDockerHost, resolveImageName, runDockerCmd, runDockerCmdWithOutput, sortObjectRecursive, startContainerBuild, stripUndefined, validateAndEncodeGarKey, verifyDockerInstalled };