-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathgpu-droplets.ts
More file actions
1002 lines (901 loc) · 32.7 KB
/
gpu-droplets.ts
File metadata and controls
1002 lines (901 loc) · 32.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as Shared from '../shared';
import * as ActionsAPI from './actions';
import {
ActionBulkInitiateParams,
ActionBulkInitiateResponse,
ActionInitiateParams,
ActionInitiateResponse,
ActionListParams,
ActionListResponse,
ActionRetrieveParams,
ActionRetrieveResponse,
Actions,
} from './actions';
import * as AutoscaleAPI from './autoscale';
import {
Autoscale,
AutoscaleCreateParams,
AutoscaleCreateResponse,
AutoscaleDeleteDangerousParams,
AutoscaleListHistoryParams,
AutoscaleListHistoryResponse,
AutoscaleListMembersParams,
AutoscaleListMembersResponse,
AutoscaleListParams,
AutoscaleListResponse,
AutoscalePool,
AutoscalePoolDropletTemplate,
AutoscalePoolDynamicConfig,
AutoscalePoolStaticConfig,
AutoscaleRetrieveResponse,
AutoscaleUpdateParams,
AutoscaleUpdateResponse,
CurrentUtilization,
} from './autoscale';
import * as BackupsAPI from './backups';
import {
BackupListParams,
BackupListPoliciesParams,
BackupListPoliciesResponse,
BackupListResponse,
BackupListSupportedPoliciesResponse,
BackupRetrievePolicyResponse,
Backups,
} from './backups';
import * as DestroyWithAssociatedResourcesAPI from './destroy-with-associated-resources';
import {
AssociatedResource,
DestroyWithAssociatedResourceCheckStatusResponse,
DestroyWithAssociatedResourceDeleteDangerousParams,
DestroyWithAssociatedResourceDeleteSelectiveParams,
DestroyWithAssociatedResourceListResponse,
DestroyWithAssociatedResources,
DestroyedAssociatedResource,
} from './destroy-with-associated-resources';
import * as SizesAPI from './sizes';
import { SizeListParams, SizeListResponse, Sizes } from './sizes';
import * as SnapshotsAPI from './snapshots';
import { SnapshotListParams, SnapshotListResponse, SnapshotRetrieveResponse, Snapshots } from './snapshots';
import * as AccountAPI from './account/account';
import { Account } from './account/account';
import * as FirewallsAPI from './firewalls/firewalls';
import {
Firewall,
FirewallCreateParams,
FirewallCreateResponse,
FirewallListParams,
FirewallListResponse,
FirewallRetrieveResponse,
FirewallUpdateParams,
FirewallUpdateResponse,
Firewalls,
} from './firewalls/firewalls';
import * as FloatingIPsAPI from './floating-ips/floating-ips';
import {
FloatingIP,
FloatingIPCreateParams,
FloatingIPCreateResponse,
FloatingIPListParams,
FloatingIPListResponse,
FloatingIPRetrieveResponse,
FloatingIPs,
} from './floating-ips/floating-ips';
import * as ImagesAPI from './images/images';
import {
ImageCreateParams,
ImageCreateResponse,
ImageListParams,
ImageListResponse,
ImageRetrieveResponse,
ImageUpdateParams,
ImageUpdateResponse,
Images,
} from './images/images';
import * as LoadBalancersAPI from './load-balancers/load-balancers';
import {
Domains,
ForwardingRule,
GlbSettings,
HealthCheck,
LbFirewall,
LoadBalancer,
LoadBalancerCreateParams,
LoadBalancerCreateResponse,
LoadBalancerListParams,
LoadBalancerListResponse,
LoadBalancerRetrieveResponse,
LoadBalancerUpdateParams,
LoadBalancerUpdateResponse,
LoadBalancers,
StickySessions,
} from './load-balancers/load-balancers';
import * as VolumesAPI from './volumes/volumes';
import {
VolumeCreateParams,
VolumeCreateResponse,
VolumeDeleteByNameParams,
VolumeListParams,
VolumeListResponse,
VolumeRetrieveResponse,
Volumes,
} from './volumes/volumes';
import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class GPUDroplets extends APIResource {
backups: BackupsAPI.Backups = new BackupsAPI.Backups(this._client);
actions: ActionsAPI.Actions = new ActionsAPI.Actions(this._client);
destroyWithAssociatedResources: DestroyWithAssociatedResourcesAPI.DestroyWithAssociatedResources =
new DestroyWithAssociatedResourcesAPI.DestroyWithAssociatedResources(this._client);
autoscale: AutoscaleAPI.Autoscale = new AutoscaleAPI.Autoscale(this._client);
firewalls: FirewallsAPI.Firewalls = new FirewallsAPI.Firewalls(this._client);
floatingIPs: FloatingIPsAPI.FloatingIPs = new FloatingIPsAPI.FloatingIPs(this._client);
images: ImagesAPI.Images = new ImagesAPI.Images(this._client);
loadBalancers: LoadBalancersAPI.LoadBalancers = new LoadBalancersAPI.LoadBalancers(this._client);
sizes: SizesAPI.Sizes = new SizesAPI.Sizes(this._client);
snapshots: SnapshotsAPI.Snapshots = new SnapshotsAPI.Snapshots(this._client);
volumes: VolumesAPI.Volumes = new VolumesAPI.Volumes(this._client);
account: AccountAPI.Account = new AccountAPI.Account(this._client);
/**
* To create a new Droplet, send a POST request to `/v2/droplets` setting the
* required attributes.
*
* A Droplet will be created using the provided information. The response body will
* contain a JSON object with a key called `droplet`. The value will be an object
* containing the standard attributes for your new Droplet. The response code, 202
* Accepted, does not indicate the success or failure of the operation, just that
* the request has been accepted for processing. The `actions` returned as part of
* the response's `links` object can be used to check the status of the Droplet
* create event.
*
* ### Create Multiple Droplets
*
* Creating multiple Droplets is very similar to creating a single Droplet. Instead
* of sending `name` as a string, send `names` as an array of strings. A Droplet
* will be created for each name you send using the associated information. Up to
* ten Droplets may be created this way at a time.
*
* Rather than returning a single Droplet, the response body will contain a JSON
* array with a key called `droplets`. This will be set to an array of JSON
* objects, each of which will contain the standard Droplet attributes. The
* response code, 202 Accepted, does not indicate the success or failure of any
* operation, just that the request has been accepted for processing. The array of
* `actions` returned as part of the response's `links` object can be used to check
* the status of each individual Droplet create event.
*
* @example
* ```ts
* const gpuDroplet = await client.gpuDroplets.create({
* image: 'ubuntu-20-04-x64',
* name: 'example.com',
* size: 's-1vcpu-1gb',
* backups: true,
* ipv6: true,
* monitoring: true,
* region: 'nyc3',
* ssh_keys: [
* 289794,
* '3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45',
* ],
* tags: ['env:prod', 'web'],
* user_data:
* '#cloud-config\nruncmd:\n - touch /test.txt\n',
* vpc_uuid: '760e09ef-dc84-11e8-981e-3cfdfeaae000',
* });
* ```
*/
create(body: GPUDropletCreateParams, options?: RequestOptions): APIPromise<GPUDropletCreateResponse> {
return this._client.post('/v2/droplets', {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To show information about an individual Droplet, send a GET request to
* `/v2/droplets/$DROPLET_ID`.
*
* @example
* ```ts
* const gpuDroplet = await client.gpuDroplets.retrieve(
* 3164444,
* );
* ```
*/
retrieve(dropletID: number, options?: RequestOptions): APIPromise<GPUDropletRetrieveResponse> {
return this._client.get(path`/v2/droplets/${dropletID}`, {
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To list all Droplets in your account, send a GET request to `/v2/droplets`.
*
* The response body will be a JSON object with a key of `droplets`. This will be
* set to an array containing objects each representing a Droplet. These will
* contain the standard Droplet attributes.
*
* ### Filtering Results by Tag
*
* It's possible to request filtered results by including certain query parameters.
* To only list Droplets assigned to a specific tag, include the `tag_name` query
* parameter set to the name of the tag in your GET request. For example,
* `/v2/droplets?tag_name=$TAG_NAME`.
*
* ### GPU Droplets
*
* By default, only non-GPU Droplets are returned. To list only GPU Droplets, set
* the `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`.
*
* @example
* ```ts
* const gpuDroplets = await client.gpuDroplets.list();
* ```
*/
list(
query: GPUDropletListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<GPUDropletListResponse> {
return this._client.get('/v2/droplets', {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To delete a Droplet, send a DELETE request to `/v2/droplets/$DROPLET_ID`.
*
* A successful request will receive a 204 status code with no body in response.
* This indicates that the request was processed successfully.
*
* @example
* ```ts
* await client.gpuDroplets.delete(3164444);
* ```
*/
delete(dropletID: number, options?: RequestOptions): APIPromise<void> {
return this._client.delete(path`/v2/droplets/${dropletID}`, {
defaultBaseURL: 'https://api.digitalocean.com',
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* To delete **all** Droplets assigned to a specific tag, include the `tag_name`
* query parameter set to the name of the tag in your DELETE request. For example,
* `/v2/droplets?tag_name=$TAG_NAME`.
*
* This endpoint requires `tag:read` scope.
*
* A successful request will receive a 204 status code with no body in response.
* This indicates that the request was processed successfully.
*
* @example
* ```ts
* await client.gpuDroplets.deleteByTag({
* tag_name: 'tag_name',
* });
* ```
*/
deleteByTag(params: GPUDropletDeleteByTagParams, options?: RequestOptions): APIPromise<void> {
const { tag_name } = params;
return this._client.delete('/v2/droplets', {
query: { tag_name },
defaultBaseURL: 'https://api.digitalocean.com',
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* To retrieve a list of all firewalls available to a Droplet, send a GET request
* to `/v2/droplets/$DROPLET_ID/firewalls`
*
* The response will be a JSON object that has a key called `firewalls`. This will
* be set to an array of `firewall` objects, each of which contain the standard
* `firewall` attributes.
*
* @example
* ```ts
* const response = await client.gpuDroplets.listFirewalls(
* 3164444,
* );
* ```
*/
listFirewalls(
dropletID: number,
query: GPUDropletListFirewallsParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<GPUDropletListFirewallsResponse> {
return this._client.get(path`/v2/droplets/${dropletID}/firewalls`, {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To retrieve a list of all kernels available to a Droplet, send a GET request to
* `/v2/droplets/$DROPLET_ID/kernels`
*
* The response will be a JSON object that has a key called `kernels`. This will be
* set to an array of `kernel` objects, each of which contain the standard `kernel`
* attributes.
*
* @example
* ```ts
* const response = await client.gpuDroplets.listKernels(
* 3164444,
* );
* ```
*/
listKernels(
dropletID: number,
query: GPUDropletListKernelsParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<GPUDropletListKernelsResponse> {
return this._client.get(path`/v2/droplets/${dropletID}/kernels`, {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To retrieve a list of any "neighbors" (i.e. Droplets that are co-located on the
* same physical hardware) for a specific Droplet, send a GET request to
* `/v2/droplets/$DROPLET_ID/neighbors`.
*
* The results will be returned as a JSON object with a key of `droplets`. This
* will be set to an array containing objects representing any other Droplets that
* share the same physical hardware. An empty array indicates that the Droplet is
* not co-located any other Droplets associated with your account.
*
* @example
* ```ts
* const response = await client.gpuDroplets.listNeighbors(
* 3164444,
* );
* ```
*/
listNeighbors(dropletID: number, options?: RequestOptions): APIPromise<GPUDropletListNeighborsResponse> {
return this._client.get(path`/v2/droplets/${dropletID}/neighbors`, {
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To retrieve the snapshots that have been created from a Droplet, send a GET
* request to `/v2/droplets/$DROPLET_ID/snapshots`.
*
* You will get back a JSON object that has a `snapshots` key. This will be set to
* an array of snapshot objects, each of which contain the standard Droplet
* snapshot attributes.
*
* @example
* ```ts
* const response = await client.gpuDroplets.listSnapshots(
* 3164444,
* );
* ```
*/
listSnapshots(
dropletID: number,
query: GPUDropletListSnapshotsParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<GPUDropletListSnapshotsResponse> {
return this._client.get(path`/v2/droplets/${dropletID}/snapshots`, {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
}
export interface DropletBackupPolicy {
/**
* The hour of the day that the backup window will start.
*/
hour?: 0 | 4 | 8 | 12 | 16 | 20;
/**
* The backup plan used for the Droplet. The plan can be either `daily` or
* `weekly`.
*/
plan?: 'daily' | 'weekly';
/**
* The number of days the backup will be retained.
*/
retention_period_days?: number;
/**
* The day of the week on which the backup will occur.
*/
weekday?: 'SUN' | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT';
/**
* The length of the backup window starting from `hour`.
*/
window_length_hours?: number;
}
export type GPUDropletCreateResponse =
| GPUDropletCreateResponse.SingleDropletResponse
| GPUDropletCreateResponse.MultipleDropletResponse;
export namespace GPUDropletCreateResponse {
export interface SingleDropletResponse {
droplet: Shared.Droplet;
links: SingleDropletResponse.Links;
}
export namespace SingleDropletResponse {
export interface Links {
actions?: Array<Shared.ActionLink>;
}
}
export interface MultipleDropletResponse {
droplets: Array<Shared.Droplet>;
links: MultipleDropletResponse.Links;
}
export namespace MultipleDropletResponse {
export interface Links {
actions?: Array<Shared.ActionLink>;
}
}
}
export interface GPUDropletRetrieveResponse {
droplet?: Shared.Droplet;
}
export interface GPUDropletListResponse {
/**
* Information about the response itself.
*/
meta: Shared.MetaProperties;
droplets?: Array<Shared.Droplet>;
links?: Shared.PageLinks;
}
export interface GPUDropletListFirewallsResponse {
/**
* Information about the response itself.
*/
meta: Shared.MetaProperties;
firewalls?: Array<FirewallsAPI.Firewall>;
links?: Shared.PageLinks;
}
export interface GPUDropletListKernelsResponse {
/**
* Information about the response itself.
*/
meta: Shared.MetaProperties;
kernels?: Array<Shared.Kernel | null>;
links?: Shared.PageLinks;
}
export interface GPUDropletListNeighborsResponse {
droplets?: Array<Shared.Droplet>;
}
export interface GPUDropletListSnapshotsResponse {
/**
* Information about the response itself.
*/
meta: Shared.MetaProperties;
links?: Shared.PageLinks;
snapshots?: Array<GPUDropletListSnapshotsResponse.Snapshot>;
}
export namespace GPUDropletListSnapshotsResponse {
export interface Snapshot {
/**
* The unique identifier for the snapshot or backup.
*/
id: number;
/**
* A time value given in ISO8601 combined date and time format that represents when
* the snapshot was created.
*/
created_at: string;
/**
* The minimum size in GB required for a volume or Droplet to use this snapshot.
*/
min_disk_size: number;
/**
* A human-readable name for the snapshot.
*/
name: string;
/**
* An array of the regions that the snapshot is available in. The regions are
* represented by their identifying slug values.
*/
regions: Array<string>;
/**
* The billable size of the snapshot in gigabytes.
*/
size_gigabytes: number;
/**
* Describes the kind of image. It may be one of `snapshot` or `backup`. This
* specifies whether an image is a user-generated Droplet snapshot or automatically
* created Droplet backup.
*/
type: 'snapshot' | 'backup';
}
}
export type GPUDropletCreateParams =
| GPUDropletCreateParams.DropletSingleCreate
| GPUDropletCreateParams.DropletMultiCreate;
export declare namespace GPUDropletCreateParams {
export interface DropletSingleCreate {
/**
* The image ID of a public or private image or the slug identifier for a public
* image. This image will be the base image for your Droplet. Requires `image:read`
* scope.
*/
image: string | number;
/**
* The human-readable string you wish to use when displaying the Droplet name. The
* name, if set to a domain name managed in the DigitalOcean DNS management system,
* will configure a PTR record for the Droplet. The name set during creation will
* also determine the hostname for the Droplet in its internal configuration.
*/
name: string;
/**
* The slug identifier for the size that you wish to select for this Droplet.
*/
size: string;
/**
* An object specifying the backup policy for the Droplet. If omitted and `backups`
* is `true`, the backup plan will default to daily.
*/
backup_policy?: DropletBackupPolicy;
/**
* A boolean indicating whether automated backups should be enabled for the
* Droplet.
*/
backups?: boolean;
/**
* A boolean indicating whether to enable IPv6 on the Droplet.
*/
ipv6?: boolean;
/**
* A boolean indicating whether to install the DigitalOcean agent for monitoring.
*/
monitoring?: boolean;
/**
* @deprecated This parameter has been deprecated. Use `vpc_uuid` instead to
* specify a VPC network for the Droplet. If no `vpc_uuid` is provided, the Droplet
* will be placed in your account's default VPC for the region.
*/
private_networking?: boolean;
/**
* The slug identifier for the region that you wish to deploy the Droplet in. If
* the specific datacenter is not not important, a slug prefix (e.g. `nyc`) can be
* used to deploy the Droplet in any of the that region's locations (`nyc1`,
* `nyc2`, or `nyc3`). If the region is omitted from the create request completely,
* the Droplet may deploy in any region.
*/
region?: string;
/**
* An array containing the IDs or fingerprints of the SSH keys that you wish to
* embed in the Droplet's root account upon creation. You must add the keys to your
* team before they can be embedded on a Droplet. Requires `ssh_key:read` scope.
*/
ssh_keys?: Array<string | number>;
/**
* A flat array of tag names as strings to apply to the Droplet after it is
* created. Tag names can either be existing or new tags. Requires `tag:create`
* scope.
*/
tags?: Array<string> | null;
/**
* A string containing 'user data' which may be used to configure the Droplet on
* first boot, often a 'cloud-config' file or Bash script. It must be plain text
* and may not exceed 64 KiB in size.
*/
user_data?: string;
/**
* An array of IDs for block storage volumes that will be attached to the Droplet
* once created. The volumes must not already be attached to an existing Droplet.
* Requires `block_storage:read` scpoe.
*/
volumes?: Array<string>;
/**
* A string specifying the UUID of the VPC to which the Droplet will be assigned.
* If excluded, the Droplet will be assigned to your account's default VPC for the
* region. Requires `vpc:read` scope.
*/
vpc_uuid?: string;
/**
* A boolean indicating whether to install the DigitalOcean agent used for
* providing access to the Droplet web console in the control panel. By default,
* the agent is installed on new Droplets but installation errors (i.e. OS not
* supported) are ignored. To prevent it from being installed, set to `false`. To
* make installation errors fatal, explicitly set it to `true`.
*/
with_droplet_agent?: boolean;
}
export interface DropletMultiCreate {
/**
* The image ID of a public or private image or the slug identifier for a public
* image. This image will be the base image for your Droplet. Requires `image:read`
* scope.
*/
image: string | number;
/**
* An array of human human-readable strings you wish to use when displaying the
* Droplet name. Each name, if set to a domain name managed in the DigitalOcean DNS
* management system, will configure a PTR record for the Droplet. Each name set
* during creation will also determine the hostname for the Droplet in its internal
* configuration.
*/
names: Array<string>;
/**
* The slug identifier for the size that you wish to select for this Droplet.
*/
size: string;
/**
* An object specifying the backup policy for the Droplet. If omitted and `backups`
* is `true`, the backup plan will default to daily.
*/
backup_policy?: DropletBackupPolicy;
/**
* A boolean indicating whether automated backups should be enabled for the
* Droplet.
*/
backups?: boolean;
/**
* A boolean indicating whether to enable IPv6 on the Droplet.
*/
ipv6?: boolean;
/**
* A boolean indicating whether to install the DigitalOcean agent for monitoring.
*/
monitoring?: boolean;
/**
* @deprecated This parameter has been deprecated. Use `vpc_uuid` instead to
* specify a VPC network for the Droplet. If no `vpc_uuid` is provided, the Droplet
* will be placed in your account's default VPC for the region.
*/
private_networking?: boolean;
/**
* The slug identifier for the region that you wish to deploy the Droplet in. If
* the specific datacenter is not not important, a slug prefix (e.g. `nyc`) can be
* used to deploy the Droplet in any of the that region's locations (`nyc1`,
* `nyc2`, or `nyc3`). If the region is omitted from the create request completely,
* the Droplet may deploy in any region.
*/
region?: string;
/**
* An array containing the IDs or fingerprints of the SSH keys that you wish to
* embed in the Droplet's root account upon creation. You must add the keys to your
* team before they can be embedded on a Droplet. Requires `ssh_key:read` scope.
*/
ssh_keys?: Array<string | number>;
/**
* A flat array of tag names as strings to apply to the Droplet after it is
* created. Tag names can either be existing or new tags. Requires `tag:create`
* scope.
*/
tags?: Array<string> | null;
/**
* A string containing 'user data' which may be used to configure the Droplet on
* first boot, often a 'cloud-config' file or Bash script. It must be plain text
* and may not exceed 64 KiB in size.
*/
user_data?: string;
/**
* An array of IDs for block storage volumes that will be attached to the Droplet
* once created. The volumes must not already be attached to an existing Droplet.
* Requires `block_storage:read` scpoe.
*/
volumes?: Array<string>;
/**
* A string specifying the UUID of the VPC to which the Droplet will be assigned.
* If excluded, the Droplet will be assigned to your account's default VPC for the
* region. Requires `vpc:read` scope.
*/
vpc_uuid?: string;
/**
* A boolean indicating whether to install the DigitalOcean agent used for
* providing access to the Droplet web console in the control panel. By default,
* the agent is installed on new Droplets but installation errors (i.e. OS not
* supported) are ignored. To prevent it from being installed, set to `false`. To
* make installation errors fatal, explicitly set it to `true`.
*/
with_droplet_agent?: boolean;
}
}
export interface GPUDropletListParams {
/**
* Used to filter list response by Droplet name returning only exact matches. It is
* case-insensitive and can not be combined with `tag_name`.
*/
name?: string;
/**
* Which 'page' of paginated results to return.
*/
page?: number;
/**
* Number of items returned per page
*/
per_page?: number;
/**
* Used to filter Droplets by a specific tag. Can not be combined with `name` or
* `type`. Requires `tag:read` scope.
*/
tag_name?: string;
/**
* When `type` is set to `gpus`, only GPU Droplets will be returned. By default,
* only non-GPU Droplets are returned. Can not be combined with `tag_name`.
*/
type?: 'droplets' | 'gpus';
}
export interface GPUDropletDeleteByTagParams {
/**
* Specifies Droplets to be deleted by tag.
*/
tag_name: string;
}
export interface GPUDropletListFirewallsParams {
/**
* Which 'page' of paginated results to return.
*/
page?: number;
/**
* Number of items returned per page
*/
per_page?: number;
}
export interface GPUDropletListKernelsParams {
/**
* Which 'page' of paginated results to return.
*/
page?: number;
/**
* Number of items returned per page
*/
per_page?: number;
}
export interface GPUDropletListSnapshotsParams {
/**
* Which 'page' of paginated results to return.
*/
page?: number;
/**
* Number of items returned per page
*/
per_page?: number;
}
GPUDroplets.Backups = Backups;
GPUDroplets.Actions = Actions;
GPUDroplets.DestroyWithAssociatedResources = DestroyWithAssociatedResources;
GPUDroplets.Autoscale = Autoscale;
GPUDroplets.Firewalls = Firewalls;
GPUDroplets.FloatingIPs = FloatingIPs;
GPUDroplets.Images = Images;
GPUDroplets.LoadBalancers = LoadBalancers;
GPUDroplets.Sizes = Sizes;
GPUDroplets.Snapshots = Snapshots;
GPUDroplets.Volumes = Volumes;
GPUDroplets.Account = Account;
export declare namespace GPUDroplets {
export {
type DropletBackupPolicy as DropletBackupPolicy,
type GPUDropletCreateResponse as GPUDropletCreateResponse,
type GPUDropletRetrieveResponse as GPUDropletRetrieveResponse,
type GPUDropletListResponse as GPUDropletListResponse,
type GPUDropletListFirewallsResponse as GPUDropletListFirewallsResponse,
type GPUDropletListKernelsResponse as GPUDropletListKernelsResponse,
type GPUDropletListNeighborsResponse as GPUDropletListNeighborsResponse,
type GPUDropletListSnapshotsResponse as GPUDropletListSnapshotsResponse,
type GPUDropletCreateParams as GPUDropletCreateParams,
type GPUDropletListParams as GPUDropletListParams,
type GPUDropletDeleteByTagParams as GPUDropletDeleteByTagParams,
type GPUDropletListFirewallsParams as GPUDropletListFirewallsParams,
type GPUDropletListKernelsParams as GPUDropletListKernelsParams,
type GPUDropletListSnapshotsParams as GPUDropletListSnapshotsParams,
};
export {
Backups as Backups,
type BackupListResponse as BackupListResponse,
type BackupListPoliciesResponse as BackupListPoliciesResponse,
type BackupListSupportedPoliciesResponse as BackupListSupportedPoliciesResponse,
type BackupRetrievePolicyResponse as BackupRetrievePolicyResponse,
type BackupListParams as BackupListParams,
type BackupListPoliciesParams as BackupListPoliciesParams,
};
export {
Actions as Actions,
type ActionRetrieveResponse as ActionRetrieveResponse,
type ActionListResponse as ActionListResponse,
type ActionBulkInitiateResponse as ActionBulkInitiateResponse,
type ActionInitiateResponse as ActionInitiateResponse,
type ActionRetrieveParams as ActionRetrieveParams,
type ActionListParams as ActionListParams,
type ActionBulkInitiateParams as ActionBulkInitiateParams,
type ActionInitiateParams as ActionInitiateParams,
};
export {
DestroyWithAssociatedResources as DestroyWithAssociatedResources,
type AssociatedResource as AssociatedResource,
type DestroyedAssociatedResource as DestroyedAssociatedResource,
type DestroyWithAssociatedResourceListResponse as DestroyWithAssociatedResourceListResponse,
type DestroyWithAssociatedResourceCheckStatusResponse as DestroyWithAssociatedResourceCheckStatusResponse,
type DestroyWithAssociatedResourceDeleteDangerousParams as DestroyWithAssociatedResourceDeleteDangerousParams,
type DestroyWithAssociatedResourceDeleteSelectiveParams as DestroyWithAssociatedResourceDeleteSelectiveParams,
};
export {
Autoscale as Autoscale,
type AutoscalePool as AutoscalePool,
type AutoscalePoolDropletTemplate as AutoscalePoolDropletTemplate,
type AutoscalePoolDynamicConfig as AutoscalePoolDynamicConfig,
type AutoscalePoolStaticConfig as AutoscalePoolStaticConfig,
type CurrentUtilization as CurrentUtilization,
type AutoscaleCreateResponse as AutoscaleCreateResponse,
type AutoscaleRetrieveResponse as AutoscaleRetrieveResponse,
type AutoscaleUpdateResponse as AutoscaleUpdateResponse,
type AutoscaleListResponse as AutoscaleListResponse,
type AutoscaleListHistoryResponse as AutoscaleListHistoryResponse,
type AutoscaleListMembersResponse as AutoscaleListMembersResponse,
type AutoscaleCreateParams as AutoscaleCreateParams,
type AutoscaleUpdateParams as AutoscaleUpdateParams,
type AutoscaleListParams as AutoscaleListParams,
type AutoscaleDeleteDangerousParams as AutoscaleDeleteDangerousParams,
type AutoscaleListHistoryParams as AutoscaleListHistoryParams,
type AutoscaleListMembersParams as AutoscaleListMembersParams,
};
export {
Firewalls as Firewalls,
type Firewall as Firewall,
type FirewallCreateResponse as FirewallCreateResponse,
type FirewallRetrieveResponse as FirewallRetrieveResponse,
type FirewallUpdateResponse as FirewallUpdateResponse,
type FirewallListResponse as FirewallListResponse,
type FirewallCreateParams as FirewallCreateParams,
type FirewallUpdateParams as FirewallUpdateParams,
type FirewallListParams as FirewallListParams,
};
export {
FloatingIPs as FloatingIPs,
type FloatingIP as FloatingIP,
type FloatingIPCreateResponse as FloatingIPCreateResponse,
type FloatingIPRetrieveResponse as FloatingIPRetrieveResponse,
type FloatingIPListResponse as FloatingIPListResponse,
type FloatingIPCreateParams as FloatingIPCreateParams,
type FloatingIPListParams as FloatingIPListParams,
};
export {
Images as Images,
type ImageCreateResponse as ImageCreateResponse,
type ImageRetrieveResponse as ImageRetrieveResponse,
type ImageUpdateResponse as ImageUpdateResponse,
type ImageListResponse as ImageListResponse,
type ImageCreateParams as ImageCreateParams,
type ImageUpdateParams as ImageUpdateParams,
type ImageListParams as ImageListParams,
};
export {
LoadBalancers as LoadBalancers,
type Domains as Domains,
type ForwardingRule as ForwardingRule,
type GlbSettings as GlbSettings,
type HealthCheck as HealthCheck,
type LbFirewall as LbFirewall,
type LoadBalancer as LoadBalancer,
type StickySessions as StickySessions,
type LoadBalancerCreateResponse as LoadBalancerCreateResponse,
type LoadBalancerRetrieveResponse as LoadBalancerRetrieveResponse,
type LoadBalancerUpdateResponse as LoadBalancerUpdateResponse,
type LoadBalancerListResponse as LoadBalancerListResponse,
type LoadBalancerCreateParams as LoadBalancerCreateParams,
type LoadBalancerUpdateParams as LoadBalancerUpdateParams,
type LoadBalancerListParams as LoadBalancerListParams,
};
export { Sizes as Sizes, type SizeListResponse as SizeListResponse, type SizeListParams as SizeListParams };
export {
Snapshots as Snapshots,
type SnapshotRetrieveResponse as SnapshotRetrieveResponse,
type SnapshotListResponse as SnapshotListResponse,
type SnapshotListParams as SnapshotListParams,
};
export {
Volumes as Volumes,
type VolumeCreateResponse as VolumeCreateResponse,
type VolumeRetrieveResponse as VolumeRetrieveResponse,
type VolumeListResponse as VolumeListResponse,
type VolumeCreateParams as VolumeCreateParams,
type VolumeListParams as VolumeListParams,
type VolumeDeleteByNameParams as VolumeDeleteByNameParams,
};