# GPU Droplets
## Create
`client.gpuDroplets.create(GPUDropletCreateParamsbody, RequestOptionsoptions?): GPUDropletCreateResponse`
**post** `/v2/droplets`
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.
### Parameters
- `GPUDropletCreateParams = DropletSingleCreate | DropletMultiCreate`
- `GPUDropletCreateParamsBase`
- `image: string | number`
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.
- `string`
- `number`
- `name: string`
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.
- `size: string`
The slug identifier for the size that you wish to select for this Droplet.
- `backup_policy?: DropletBackupPolicy`
An object specifying the backup policy for the Droplet. If omitted and `backups` is `true`, the backup plan will default to daily.
- `hour?: 0 | 4 | 8 | 3 more`
The hour of the day that the backup window will start.
- `0`
- `4`
- `8`
- `12`
- `16`
- `20`
- `plan?: "daily" | "weekly"`
The backup plan used for the Droplet. The plan can be either `daily` or `weekly`.
- `"daily"`
- `"weekly"`
- `retention_period_days?: number`
The number of days the backup will be retained.
- `weekday?: "SUN" | "MON" | "TUE" | 4 more`
The day of the week on which the backup will occur.
- `"SUN"`
- `"MON"`
- `"TUE"`
- `"WED"`
- `"THU"`
- `"FRI"`
- `"SAT"`
- `window_length_hours?: number`
The length of the backup window starting from `hour`.
- `backups?: boolean`
A boolean indicating whether automated backups should be enabled for the Droplet.
- `ipv6?: boolean`
A boolean indicating whether to enable IPv6 on the Droplet.
- `monitoring?: boolean`
A boolean indicating whether to install the DigitalOcean agent for monitoring.
- `private_networking?: boolean`
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.
- `region?: string`
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.
- `ssh_keys?: Array`
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.
- `string`
- `number`
- `tags?: Array | null`
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.
- `user_data?: string`
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.
- `volumes?: Array`
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.
- `vpc_uuid?: 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.
- `with_droplet_agent?: boolean`
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`.
- `DropletSingleCreate extends GPUDropletCreateParamsBase`
- `DropletMultiCreate extends GPUDropletCreateParamsBase`
### Returns
- `GPUDropletCreateResponse = SingleDropletResponse | MultipleDropletResponse`
- `SingleDropletResponse`
- `droplet: Droplet`
- `id: number`
A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
- `backup_ids: Array`
An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires `image:read` scope.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
- `disk: number`
The size of the Droplet's disk in gigabytes.
- `features: Array`
An array of features enabled on this Droplet.
- `image: Image`
The Droplet's image.
Requires `image:read` scope.
- `id?: number`
A unique number that can be used to identify and reference a specific image.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the image was created.
- `description?: string`
An optional free-form text field to describe an image.
- `distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more`
The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
- `"Arch Linux"`
- `"CentOS"`
- `"CoreOS"`
- `"Debian"`
- `"Fedora"`
- `"Fedora Atomic"`
- `"FreeBSD"`
- `"Gentoo"`
- `"openSUSE"`
- `"RancherOS"`
- `"Rocky Linux"`
- `"Ubuntu"`
- `"Unknown"`
- `error_message?: string`
A string containing information about errors that may occur when importing
a custom image.
- `min_disk_size?: number | null`
The minimum disk size in GB required for a Droplet to use this image.
- `name?: string`
The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
- `public?: boolean`
This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
- `regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>`
This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
- `"ams1"`
- `"ams2"`
- `"ams3"`
- `"blr1"`
- `"fra1"`
- `"lon1"`
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"tor1"`
- `"syd1"`
- `size_gigabytes?: number | null`
The size of the image in gigabytes.
- `slug?: string | null`
A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
- `status?: "NEW" | "available" | "pending" | 2 more`
A status string indicating the state of a custom image. This may be `NEW`,
`available`, `pending`, `deleted`, or `retired`.
- `"NEW"`
- `"available"`
- `"pending"`
- `"deleted"`
- `"retired"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requires `tag:create` scope.
- `type?: "base" | "snapshot" | "backup" | 2 more`
Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
- `"base"`
- `"snapshot"`
- `"backup"`
- `"custom"`
- `"admin"`
- `locked: boolean`
A boolean value indicating whether the Droplet has been locked, preventing actions by users.
- `memory: number`
Memory of the Droplet in megabytes.
- `name: string`
The human-readable name set for the Droplet instance.
- `networks: Networks`
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
- `v4?: Array`
- `gateway?: string`
The gateway of the specified IPv4 network interface.
For private interfaces, a gateway is not provided. This is denoted by
returning `nil` as its value.
- `ip_address?: string`
The IP address of the IPv4 network interface.
- `netmask?: string`
The netmask of the IPv4 network interface.
- `type?: "public" | "private"`
The type of the IPv4 network interface.
- `"public"`
- `"private"`
- `v6?: Array`
- `gateway?: string`
The gateway of the specified IPv6 network interface.
- `ip_address?: string`
The IP address of the IPv6 network interface.
- `netmask?: number`
The netmask of the IPv6 network interface.
- `type?: "public"`
The type of the IPv6 network interface.
**Note**: IPv6 private networking is not currently supported.
- `"public"`
- `next_backup_window: DropletNextBackupWindow | null`
The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
- `region: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `size: Size`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created with this size.
- `description: string`
A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
- `disk: number`
The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
- `memory: number`
The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
- `price_hourly: number`
This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
- `price_monthly: number`
This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
- `regions: Array`
An array containing the region slugs where this size is available for Droplet creates.
- `slug: string`
A human-readable string that is used to uniquely identify each size.
- `transfer: number`
The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
- `vcpus: number`
The number of CPUs allocated to Droplets of this size.
- `disk_info?: Array`
An array of objects containing information about the disks available to Droplets created with this size.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `size_slug: string`
The unique slug identifier for the size of this Droplet.
- `snapshot_ids: Array`
An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires `image:read` scope.
- `status: "new" | "active" | "off" | "archive"`
A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
- `"new"`
- `"active"`
- `"off"`
- `"archive"`
- `tags: Array`
An array of Tags the Droplet has been tagged with.
Requires `tag:read` scope.
- `vcpus: number`
The number of virtual CPUs.
- `volume_ids: Array`
A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires `block_storage:read` scope.
- `disk_info?: Array`
An array of objects containing information about the disks available to the Droplet.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `kernel?: Kernel | null`
**Note**: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to `null`.
The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `vpc_uuid?: string`
A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires `vpc:read` scope.
- `links: Links`
- `actions?: Array`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `href?: string`
A URL that can be used to access the action.
- `rel?: string`
A string specifying the type of the related action.
- `MultipleDropletResponse`
- `droplets: Array`
- `id: number`
A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
- `backup_ids: Array`
An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires `image:read` scope.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
- `disk: number`
The size of the Droplet's disk in gigabytes.
- `features: Array`
An array of features enabled on this Droplet.
- `image: Image`
The Droplet's image.
Requires `image:read` scope.
- `id?: number`
A unique number that can be used to identify and reference a specific image.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the image was created.
- `description?: string`
An optional free-form text field to describe an image.
- `distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more`
The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
- `"Arch Linux"`
- `"CentOS"`
- `"CoreOS"`
- `"Debian"`
- `"Fedora"`
- `"Fedora Atomic"`
- `"FreeBSD"`
- `"Gentoo"`
- `"openSUSE"`
- `"RancherOS"`
- `"Rocky Linux"`
- `"Ubuntu"`
- `"Unknown"`
- `error_message?: string`
A string containing information about errors that may occur when importing
a custom image.
- `min_disk_size?: number | null`
The minimum disk size in GB required for a Droplet to use this image.
- `name?: string`
The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
- `public?: boolean`
This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
- `regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>`
This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
- `"ams1"`
- `"ams2"`
- `"ams3"`
- `"blr1"`
- `"fra1"`
- `"lon1"`
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"tor1"`
- `"syd1"`
- `size_gigabytes?: number | null`
The size of the image in gigabytes.
- `slug?: string | null`
A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
- `status?: "NEW" | "available" | "pending" | 2 more`
A status string indicating the state of a custom image. This may be `NEW`,
`available`, `pending`, `deleted`, or `retired`.
- `"NEW"`
- `"available"`
- `"pending"`
- `"deleted"`
- `"retired"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requires `tag:create` scope.
- `type?: "base" | "snapshot" | "backup" | 2 more`
Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
- `"base"`
- `"snapshot"`
- `"backup"`
- `"custom"`
- `"admin"`
- `locked: boolean`
A boolean value indicating whether the Droplet has been locked, preventing actions by users.
- `memory: number`
Memory of the Droplet in megabytes.
- `name: string`
The human-readable name set for the Droplet instance.
- `networks: Networks`
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
- `v4?: Array`
- `gateway?: string`
The gateway of the specified IPv4 network interface.
For private interfaces, a gateway is not provided. This is denoted by
returning `nil` as its value.
- `ip_address?: string`
The IP address of the IPv4 network interface.
- `netmask?: string`
The netmask of the IPv4 network interface.
- `type?: "public" | "private"`
The type of the IPv4 network interface.
- `"public"`
- `"private"`
- `v6?: Array`
- `gateway?: string`
The gateway of the specified IPv6 network interface.
- `ip_address?: string`
The IP address of the IPv6 network interface.
- `netmask?: number`
The netmask of the IPv6 network interface.
- `type?: "public"`
The type of the IPv6 network interface.
**Note**: IPv6 private networking is not currently supported.
- `"public"`
- `next_backup_window: DropletNextBackupWindow | null`
The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
- `region: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `size: Size`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created with this size.
- `description: string`
A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
- `disk: number`
The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
- `memory: number`
The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
- `price_hourly: number`
This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
- `price_monthly: number`
This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
- `regions: Array`
An array containing the region slugs where this size is available for Droplet creates.
- `slug: string`
A human-readable string that is used to uniquely identify each size.
- `transfer: number`
The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
- `vcpus: number`
The number of CPUs allocated to Droplets of this size.
- `disk_info?: Array`
An array of objects containing information about the disks available to Droplets created with this size.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `size_slug: string`
The unique slug identifier for the size of this Droplet.
- `snapshot_ids: Array`
An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires `image:read` scope.
- `status: "new" | "active" | "off" | "archive"`
A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
- `"new"`
- `"active"`
- `"off"`
- `"archive"`
- `tags: Array`
An array of Tags the Droplet has been tagged with.
Requires `tag:read` scope.
- `vcpus: number`
The number of virtual CPUs.
- `volume_ids: Array`
A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires `block_storage:read` scope.
- `disk_info?: Array`
An array of objects containing information about the disks available to the Droplet.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `kernel?: Kernel | null`
**Note**: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to `null`.
The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `vpc_uuid?: string`
A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires `vpc:read` scope.
- `links: Links`
- `actions?: Array`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `href?: string`
A URL that can be used to access the action.
- `rel?: string`
A string specifying the type of the related action.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
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',
});
console.log(gpuDroplet);
```
## Retrieve
`client.gpuDroplets.retrieve(numberdropletID, RequestOptionsoptions?): GPUDropletRetrieveResponse`
**get** `/v2/droplets/{droplet_id}`
To show information about an individual Droplet, send a GET request to
`/v2/droplets/$DROPLET_ID`.
### Parameters
- `dropletID: number`
### Returns
- `GPUDropletRetrieveResponse`
- `droplet?: Droplet`
- `id: number`
A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
- `backup_ids: Array`
An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires `image:read` scope.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
- `disk: number`
The size of the Droplet's disk in gigabytes.
- `features: Array`
An array of features enabled on this Droplet.
- `image: Image`
The Droplet's image.
Requires `image:read` scope.
- `id?: number`
A unique number that can be used to identify and reference a specific image.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the image was created.
- `description?: string`
An optional free-form text field to describe an image.
- `distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more`
The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
- `"Arch Linux"`
- `"CentOS"`
- `"CoreOS"`
- `"Debian"`
- `"Fedora"`
- `"Fedora Atomic"`
- `"FreeBSD"`
- `"Gentoo"`
- `"openSUSE"`
- `"RancherOS"`
- `"Rocky Linux"`
- `"Ubuntu"`
- `"Unknown"`
- `error_message?: string`
A string containing information about errors that may occur when importing
a custom image.
- `min_disk_size?: number | null`
The minimum disk size in GB required for a Droplet to use this image.
- `name?: string`
The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
- `public?: boolean`
This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
- `regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>`
This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
- `"ams1"`
- `"ams2"`
- `"ams3"`
- `"blr1"`
- `"fra1"`
- `"lon1"`
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"tor1"`
- `"syd1"`
- `size_gigabytes?: number | null`
The size of the image in gigabytes.
- `slug?: string | null`
A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
- `status?: "NEW" | "available" | "pending" | 2 more`
A status string indicating the state of a custom image. This may be `NEW`,
`available`, `pending`, `deleted`, or `retired`.
- `"NEW"`
- `"available"`
- `"pending"`
- `"deleted"`
- `"retired"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requires `tag:create` scope.
- `type?: "base" | "snapshot" | "backup" | 2 more`
Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
- `"base"`
- `"snapshot"`
- `"backup"`
- `"custom"`
- `"admin"`
- `locked: boolean`
A boolean value indicating whether the Droplet has been locked, preventing actions by users.
- `memory: number`
Memory of the Droplet in megabytes.
- `name: string`
The human-readable name set for the Droplet instance.
- `networks: Networks`
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
- `v4?: Array`
- `gateway?: string`
The gateway of the specified IPv4 network interface.
For private interfaces, a gateway is not provided. This is denoted by
returning `nil` as its value.
- `ip_address?: string`
The IP address of the IPv4 network interface.
- `netmask?: string`
The netmask of the IPv4 network interface.
- `type?: "public" | "private"`
The type of the IPv4 network interface.
- `"public"`
- `"private"`
- `v6?: Array`
- `gateway?: string`
The gateway of the specified IPv6 network interface.
- `ip_address?: string`
The IP address of the IPv6 network interface.
- `netmask?: number`
The netmask of the IPv6 network interface.
- `type?: "public"`
The type of the IPv6 network interface.
**Note**: IPv6 private networking is not currently supported.
- `"public"`
- `next_backup_window: DropletNextBackupWindow | null`
The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
- `region: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `size: Size`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created with this size.
- `description: string`
A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
- `disk: number`
The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
- `memory: number`
The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
- `price_hourly: number`
This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
- `price_monthly: number`
This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
- `regions: Array`
An array containing the region slugs where this size is available for Droplet creates.
- `slug: string`
A human-readable string that is used to uniquely identify each size.
- `transfer: number`
The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
- `vcpus: number`
The number of CPUs allocated to Droplets of this size.
- `disk_info?: Array`
An array of objects containing information about the disks available to Droplets created with this size.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `size_slug: string`
The unique slug identifier for the size of this Droplet.
- `snapshot_ids: Array`
An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires `image:read` scope.
- `status: "new" | "active" | "off" | "archive"`
A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
- `"new"`
- `"active"`
- `"off"`
- `"archive"`
- `tags: Array`
An array of Tags the Droplet has been tagged with.
Requires `tag:read` scope.
- `vcpus: number`
The number of virtual CPUs.
- `volume_ids: Array`
A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires `block_storage:read` scope.
- `disk_info?: Array`
An array of objects containing information about the disks available to the Droplet.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `kernel?: Kernel | null`
**Note**: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to `null`.
The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `vpc_uuid?: string`
A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires `vpc:read` scope.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const gpuDroplet = await client.gpuDroplets.retrieve(3164444);
console.log(gpuDroplet.droplet);
```
## List
`client.gpuDroplets.list(GPUDropletListParamsquery?, RequestOptionsoptions?): GPUDropletListResponse`
**get** `/v2/droplets`
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`.
### Parameters
- `query: GPUDropletListParams`
- `name?: string`
Used to filter list response by Droplet name returning only exact matches. It is case-insensitive and can not be combined with `tag_name`.
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
- `tag_name?: string`
Used to filter Droplets by a specific tag. Can not be combined with `name` or `type`.
Requires `tag:read` scope.
- `type?: "droplets" | "gpus"`
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`.
- `"droplets"`
- `"gpus"`
### Returns
- `GPUDropletListResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `droplets?: Array`
- `id: number`
A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
- `backup_ids: Array`
An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires `image:read` scope.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
- `disk: number`
The size of the Droplet's disk in gigabytes.
- `features: Array`
An array of features enabled on this Droplet.
- `image: Image`
The Droplet's image.
Requires `image:read` scope.
- `id?: number`
A unique number that can be used to identify and reference a specific image.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the image was created.
- `description?: string`
An optional free-form text field to describe an image.
- `distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more`
The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
- `"Arch Linux"`
- `"CentOS"`
- `"CoreOS"`
- `"Debian"`
- `"Fedora"`
- `"Fedora Atomic"`
- `"FreeBSD"`
- `"Gentoo"`
- `"openSUSE"`
- `"RancherOS"`
- `"Rocky Linux"`
- `"Ubuntu"`
- `"Unknown"`
- `error_message?: string`
A string containing information about errors that may occur when importing
a custom image.
- `min_disk_size?: number | null`
The minimum disk size in GB required for a Droplet to use this image.
- `name?: string`
The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
- `public?: boolean`
This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
- `regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>`
This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
- `"ams1"`
- `"ams2"`
- `"ams3"`
- `"blr1"`
- `"fra1"`
- `"lon1"`
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"tor1"`
- `"syd1"`
- `size_gigabytes?: number | null`
The size of the image in gigabytes.
- `slug?: string | null`
A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
- `status?: "NEW" | "available" | "pending" | 2 more`
A status string indicating the state of a custom image. This may be `NEW`,
`available`, `pending`, `deleted`, or `retired`.
- `"NEW"`
- `"available"`
- `"pending"`
- `"deleted"`
- `"retired"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requires `tag:create` scope.
- `type?: "base" | "snapshot" | "backup" | 2 more`
Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
- `"base"`
- `"snapshot"`
- `"backup"`
- `"custom"`
- `"admin"`
- `locked: boolean`
A boolean value indicating whether the Droplet has been locked, preventing actions by users.
- `memory: number`
Memory of the Droplet in megabytes.
- `name: string`
The human-readable name set for the Droplet instance.
- `networks: Networks`
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
- `v4?: Array`
- `gateway?: string`
The gateway of the specified IPv4 network interface.
For private interfaces, a gateway is not provided. This is denoted by
returning `nil` as its value.
- `ip_address?: string`
The IP address of the IPv4 network interface.
- `netmask?: string`
The netmask of the IPv4 network interface.
- `type?: "public" | "private"`
The type of the IPv4 network interface.
- `"public"`
- `"private"`
- `v6?: Array`
- `gateway?: string`
The gateway of the specified IPv6 network interface.
- `ip_address?: string`
The IP address of the IPv6 network interface.
- `netmask?: number`
The netmask of the IPv6 network interface.
- `type?: "public"`
The type of the IPv6 network interface.
**Note**: IPv6 private networking is not currently supported.
- `"public"`
- `next_backup_window: DropletNextBackupWindow | null`
The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
- `region: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `size: Size`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created with this size.
- `description: string`
A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
- `disk: number`
The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
- `memory: number`
The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
- `price_hourly: number`
This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
- `price_monthly: number`
This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
- `regions: Array`
An array containing the region slugs where this size is available for Droplet creates.
- `slug: string`
A human-readable string that is used to uniquely identify each size.
- `transfer: number`
The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
- `vcpus: number`
The number of CPUs allocated to Droplets of this size.
- `disk_info?: Array`
An array of objects containing information about the disks available to Droplets created with this size.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `size_slug: string`
The unique slug identifier for the size of this Droplet.
- `snapshot_ids: Array`
An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires `image:read` scope.
- `status: "new" | "active" | "off" | "archive"`
A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
- `"new"`
- `"active"`
- `"off"`
- `"archive"`
- `tags: Array`
An array of Tags the Droplet has been tagged with.
Requires `tag:read` scope.
- `vcpus: number`
The number of virtual CPUs.
- `volume_ids: Array`
A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires `block_storage:read` scope.
- `disk_info?: Array`
An array of objects containing information about the disks available to the Droplet.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `kernel?: Kernel | null`
**Note**: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to `null`.
The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `vpc_uuid?: string`
A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires `vpc:read` scope.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const gpuDroplets = await client.gpuDroplets.list();
console.log(gpuDroplets.meta);
```
## Delete
`client.gpuDroplets.delete(numberdropletID, RequestOptionsoptions?): void`
**delete** `/v2/droplets/{droplet_id}`
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.
### Parameters
- `dropletID: number`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.delete(3164444);
```
## Delete By Tag
`client.gpuDroplets.deleteByTag(GPUDropletDeleteByTagParamsparams, RequestOptionsoptions?): void`
**delete** `/v2/droplets`
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.
### Parameters
- `params: GPUDropletDeleteByTagParams`
- `tag_name: string`
Specifies Droplets to be deleted by tag.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.deleteByTag({ tag_name: 'tag_name' });
```
## List Firewalls
`client.gpuDroplets.listFirewalls(numberdropletID, GPUDropletListFirewallsParamsquery?, RequestOptionsoptions?): GPUDropletListFirewallsResponse`
**get** `/v2/droplets/{droplet_id}/firewalls`
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.
### Parameters
- `dropletID: number`
- `query: GPUDropletListFirewallsParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `GPUDropletListFirewallsResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `firewalls?: Array`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.listFirewalls(3164444);
console.log(response.meta);
```
## List Kernels
`client.gpuDroplets.listKernels(numberdropletID, GPUDropletListKernelsParamsquery?, RequestOptionsoptions?): GPUDropletListKernelsResponse`
**get** `/v2/droplets/{droplet_id}/kernels`
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.
### Parameters
- `dropletID: number`
- `query: GPUDropletListKernelsParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `GPUDropletListKernelsResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `kernels?: Array`
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.listKernels(3164444);
console.log(response.meta);
```
## List Neighbors
`client.gpuDroplets.listNeighbors(numberdropletID, RequestOptionsoptions?): GPUDropletListNeighborsResponse`
**get** `/v2/droplets/{droplet_id}/neighbors`
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.
### Parameters
- `dropletID: number`
### Returns
- `GPUDropletListNeighborsResponse`
- `droplets?: Array`
- `id: number`
A unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
- `backup_ids: Array`
An array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
Requires `image:read` scope.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the Droplet was created.
- `disk: number`
The size of the Droplet's disk in gigabytes.
- `features: Array`
An array of features enabled on this Droplet.
- `image: Image`
The Droplet's image.
Requires `image:read` scope.
- `id?: number`
A unique number that can be used to identify and reference a specific image.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the image was created.
- `description?: string`
An optional free-form text field to describe an image.
- `distribution?: "Arch Linux" | "CentOS" | "CoreOS" | 10 more`
The name of a custom image's distribution. Currently, the valid values are `Arch Linux`, `CentOS`, `CoreOS`, `Debian`, `Fedora`, `Fedora Atomic`, `FreeBSD`, `Gentoo`, `openSUSE`, `RancherOS`, `Rocky Linux`, `Ubuntu`, and `Unknown`. Any other value will be accepted but ignored, and `Unknown` will be used in its place.
- `"Arch Linux"`
- `"CentOS"`
- `"CoreOS"`
- `"Debian"`
- `"Fedora"`
- `"Fedora Atomic"`
- `"FreeBSD"`
- `"Gentoo"`
- `"openSUSE"`
- `"RancherOS"`
- `"Rocky Linux"`
- `"Ubuntu"`
- `"Unknown"`
- `error_message?: string`
A string containing information about errors that may occur when importing
a custom image.
- `min_disk_size?: number | null`
The minimum disk size in GB required for a Droplet to use this image.
- `name?: string`
The display name that has been given to an image. This is what is shown in the control panel and is generally a descriptive title for the image in question.
- `public?: boolean`
This is a boolean value that indicates whether the image in question is public or not. An image that is public is available to all accounts. A non-public image is only accessible from your account.
- `regions?: Array<"ams1" | "ams2" | "ams3" | 12 more>`
This attribute is an array of the regions that the image is available in. The regions are represented by their identifying slug values.
- `"ams1"`
- `"ams2"`
- `"ams3"`
- `"blr1"`
- `"fra1"`
- `"lon1"`
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"tor1"`
- `"syd1"`
- `size_gigabytes?: number | null`
The size of the image in gigabytes.
- `slug?: string | null`
A uniquely identifying string that is associated with each of the DigitalOcean-provided public images. These can be used to reference a public image as an alternative to the numeric id.
- `status?: "NEW" | "available" | "pending" | 2 more`
A status string indicating the state of a custom image. This may be `NEW`,
`available`, `pending`, `deleted`, or `retired`.
- `"NEW"`
- `"available"`
- `"pending"`
- `"deleted"`
- `"retired"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags.
Requires `tag:create` scope.
- `type?: "base" | "snapshot" | "backup" | 2 more`
Describes the kind of image. It may be one of `base`, `snapshot`, `backup`, `custom`, or `admin`. Respectively, this specifies whether an image is a DigitalOcean base OS image, user-generated Droplet snapshot, automatically created Droplet backup, user-provided virtual machine image, or an image used for DigitalOcean managed resources (e.g. DOKS worker nodes).
- `"base"`
- `"snapshot"`
- `"backup"`
- `"custom"`
- `"admin"`
- `locked: boolean`
A boolean value indicating whether the Droplet has been locked, preventing actions by users.
- `memory: number`
Memory of the Droplet in megabytes.
- `name: string`
The human-readable name set for the Droplet instance.
- `networks: Networks`
The details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
- `v4?: Array`
- `gateway?: string`
The gateway of the specified IPv4 network interface.
For private interfaces, a gateway is not provided. This is denoted by
returning `nil` as its value.
- `ip_address?: string`
The IP address of the IPv4 network interface.
- `netmask?: string`
The netmask of the IPv4 network interface.
- `type?: "public" | "private"`
The type of the IPv4 network interface.
- `"public"`
- `"private"`
- `v6?: Array`
- `gateway?: string`
The gateway of the specified IPv6 network interface.
- `ip_address?: string`
The IP address of the IPv6 network interface.
- `netmask?: number`
The netmask of the IPv6 network interface.
- `type?: "public"`
The type of the IPv6 network interface.
**Note**: IPv6 private networking is not currently supported.
- `"public"`
- `next_backup_window: DropletNextBackupWindow | null`
The details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
- `region: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `size: Size`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created with this size.
- `description: string`
A string describing the class of Droplets created from this size. For example: Basic, General Purpose, CPU-Optimized, Memory-Optimized, or Storage-Optimized.
- `disk: number`
The amount of disk space set aside for Droplets of this size. The value is represented in gigabytes.
- `memory: number`
The amount of RAM allocated to Droplets created of this size. The value is represented in megabytes.
- `price_hourly: number`
This describes the price of the Droplet size as measured hourly. The value is measured in US dollars.
- `price_monthly: number`
This attribute describes the monthly cost of this Droplet size if the Droplet is kept for an entire month. The value is measured in US dollars.
- `regions: Array`
An array containing the region slugs where this size is available for Droplet creates.
- `slug: string`
A human-readable string that is used to uniquely identify each size.
- `transfer: number`
The amount of transfer bandwidth that is available for Droplets created in this size. This only counts traffic on the public interface. The value is given in terabytes.
- `vcpus: number`
The number of CPUs allocated to Droplets of this size.
- `disk_info?: Array`
An array of objects containing information about the disks available to Droplets created with this size.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `size_slug: string`
The unique slug identifier for the size of this Droplet.
- `snapshot_ids: Array`
An array of snapshot IDs of any snapshots created from the Droplet instance.
Requires `image:read` scope.
- `status: "new" | "active" | "off" | "archive"`
A status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
- `"new"`
- `"active"`
- `"off"`
- `"archive"`
- `tags: Array`
An array of Tags the Droplet has been tagged with.
Requires `tag:read` scope.
- `vcpus: number`
The number of virtual CPUs.
- `volume_ids: Array`
A flat array including the unique identifier for each Block Storage volume attached to the Droplet.
Requires `block_storage:read` scope.
- `disk_info?: Array`
An array of objects containing information about the disks available to the Droplet.
- `size?: Size`
- `amount?: number`
The amount of space allocated to the disk.
- `unit?: string`
The unit of measure for the disk size.
- `type?: "local" | "scratch"`
The type of disk. All Droplets contain a `local` disk. Additionally, GPU Droplets can also have a `scratch` disk for non-persistent data.
- `"local"`
- `"scratch"`
- `gpu_info?: GPUInfo`
An object containing information about the GPU capabilities of Droplets created with this size.
- `count?: number`
The number of GPUs allocated to the Droplet.
- `model?: string`
The model of the GPU.
- `vram?: Vram`
- `amount?: number`
The amount of VRAM allocated to the GPU.
- `unit?: string`
The unit of measure for the VRAM.
- `kernel?: Kernel | null`
**Note**: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to `null`.
The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/)
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
- `id?: number`
A unique number used to identify and reference a specific kernel.
- `name?: string`
The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.
- `version?: string`
A standard kernel version string representing the version, patch, and release information.
- `vpc_uuid?: string`
A string specifying the UUID of the VPC to which the Droplet is assigned.
Requires `vpc:read` scope.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.listNeighbors(3164444);
console.log(response.droplets);
```
## List Snapshots
`client.gpuDroplets.listSnapshots(numberdropletID, GPUDropletListSnapshotsParamsquery?, RequestOptionsoptions?): GPUDropletListSnapshotsResponse`
**get** `/v2/droplets/{droplet_id}/snapshots`
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.
### Parameters
- `dropletID: number`
- `query: GPUDropletListSnapshotsParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `GPUDropletListSnapshotsResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
- `snapshots?: Array`
- `id: number`
The unique identifier for the snapshot or backup.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the snapshot was created.
- `min_disk_size: number`
The minimum size in GB required for a volume or Droplet to use this snapshot.
- `name: string`
A human-readable name for the snapshot.
- `regions: Array`
An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values.
- `size_gigabytes: number`
The billable size of the snapshot in gigabytes.
- `type: "snapshot" | "backup"`
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.
- `"snapshot"`
- `"backup"`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.listSnapshots(3164444);
console.log(response.meta);
```
## Domain Types
### Droplet Backup Policy
- `DropletBackupPolicy`
- `hour?: 0 | 4 | 8 | 3 more`
The hour of the day that the backup window will start.
- `0`
- `4`
- `8`
- `12`
- `16`
- `20`
- `plan?: "daily" | "weekly"`
The backup plan used for the Droplet. The plan can be either `daily` or `weekly`.
- `"daily"`
- `"weekly"`
- `retention_period_days?: number`
The number of days the backup will be retained.
- `weekday?: "SUN" | "MON" | "TUE" | 4 more`
The day of the week on which the backup will occur.
- `"SUN"`
- `"MON"`
- `"TUE"`
- `"WED"`
- `"THU"`
- `"FRI"`
- `"SAT"`
- `window_length_hours?: number`
The length of the backup window starting from `hour`.
# Backups
## List
`client.gpuDroplets.backups.list(numberdropletID, BackupListParamsquery?, RequestOptionsoptions?): BackupListResponse`
**get** `/v2/droplets/{droplet_id}/backups`
To retrieve any backups associated with a Droplet, send a GET request to
`/v2/droplets/$DROPLET_ID/backups`.
You will get back a JSON object that has a `backups` key. This will be set to
an array of backup objects, each of which contain the standard
Droplet backup attributes.
### Parameters
- `dropletID: number`
- `query: BackupListParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `BackupListResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `backups?: Array`
- `id: number`
The unique identifier for the snapshot or backup.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the snapshot was created.
- `min_disk_size: number`
The minimum size in GB required for a volume or Droplet to use this snapshot.
- `name: string`
A human-readable name for the snapshot.
- `regions: Array`
An array of the regions that the snapshot is available in. The regions are represented by their identifying slug values.
- `size_gigabytes: number`
The billable size of the snapshot in gigabytes.
- `type: "snapshot" | "backup"`
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.
- `"snapshot"`
- `"backup"`
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const backups = await client.gpuDroplets.backups.list(3164444);
console.log(backups.meta);
```
## List Policies
`client.gpuDroplets.backups.listPolicies(BackupListPoliciesParamsquery?, RequestOptionsoptions?): BackupListPoliciesResponse`
**get** `/v2/droplets/backups/policies`
To list information about the backup policies for all Droplets in the account,
send a GET request to `/v2/droplets/backups/policies`.
### Parameters
- `query: BackupListPoliciesParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `BackupListPoliciesResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
- `policies?: Record`
A map where the keys are the Droplet IDs and the values are
objects containing the backup policy information for each Droplet.
- `backup_enabled?: boolean`
A boolean value indicating whether backups are enabled for the Droplet.
- `backup_policy?: DropletBackupPolicy`
An object specifying the backup policy for the Droplet.
- `hour?: 0 | 4 | 8 | 3 more`
The hour of the day that the backup window will start.
- `0`
- `4`
- `8`
- `12`
- `16`
- `20`
- `plan?: "daily" | "weekly"`
The backup plan used for the Droplet. The plan can be either `daily` or `weekly`.
- `"daily"`
- `"weekly"`
- `retention_period_days?: number`
The number of days the backup will be retained.
- `weekday?: "SUN" | "MON" | "TUE" | 4 more`
The day of the week on which the backup will occur.
- `"SUN"`
- `"MON"`
- `"TUE"`
- `"WED"`
- `"THU"`
- `"FRI"`
- `"SAT"`
- `window_length_hours?: number`
The length of the backup window starting from `hour`.
- `droplet_id?: number`
The unique identifier for the Droplet.
- `next_backup_window?: DropletNextBackupWindow | null`
An object containing keys with the start and end times of the window during which the backup will occur.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.backups.listPolicies();
console.log(response.meta);
```
## List Supported Policies
`client.gpuDroplets.backups.listSupportedPolicies(RequestOptionsoptions?): BackupListSupportedPoliciesResponse`
**get** `/v2/droplets/backups/supported_policies`
To retrieve a list of all supported Droplet backup policies, send a GET
request to `/v2/droplets/backups/supported_policies`.
### Returns
- `BackupListSupportedPoliciesResponse`
- `supported_policies?: Array`
- `name?: string`
The name of the Droplet backup plan.
- `possible_days?: Array`
The day of the week the backup will occur.
- `possible_window_starts?: Array`
An array of integers representing the hours of the day that a backup can
start.
- `retention_period_days?: number`
The number of days that a backup will be kept.
- `window_length_hours?: number`
The number of hours that a backup window is open.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.backups.listSupportedPolicies();
console.log(response.supported_policies);
```
## Retrieve Policy
`client.gpuDroplets.backups.retrievePolicy(numberdropletID, RequestOptionsoptions?): BackupRetrievePolicyResponse`
**get** `/v2/droplets/{droplet_id}/backups/policy`
To show information about an individual Droplet's backup policy, send a GET
request to `/v2/droplets/$DROPLET_ID/backups/policy`.
### Parameters
- `dropletID: number`
### Returns
- `BackupRetrievePolicyResponse`
- `policy?: Policy`
- `backup_enabled?: boolean`
A boolean value indicating whether backups are enabled for the Droplet.
- `backup_policy?: DropletBackupPolicy`
An object specifying the backup policy for the Droplet.
- `hour?: 0 | 4 | 8 | 3 more`
The hour of the day that the backup window will start.
- `0`
- `4`
- `8`
- `12`
- `16`
- `20`
- `plan?: "daily" | "weekly"`
The backup plan used for the Droplet. The plan can be either `daily` or `weekly`.
- `"daily"`
- `"weekly"`
- `retention_period_days?: number`
The number of days the backup will be retained.
- `weekday?: "SUN" | "MON" | "TUE" | 4 more`
The day of the week on which the backup will occur.
- `"SUN"`
- `"MON"`
- `"TUE"`
- `"WED"`
- `"THU"`
- `"FRI"`
- `"SAT"`
- `window_length_hours?: number`
The length of the backup window starting from `hour`.
- `droplet_id?: number`
The unique identifier for the Droplet.
- `next_backup_window?: DropletNextBackupWindow | null`
An object containing keys with the start and end times of the window during which the backup will occur.
- `end?: string`
A time value given in ISO8601 combined date and time format specifying the end of the Droplet's backup window.
- `start?: string`
A time value given in ISO8601 combined date and time format specifying the start of the Droplet's backup window.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.backups.retrievePolicy(3164444);
console.log(response.policy);
```
# Actions
## Retrieve
`client.gpuDroplets.actions.retrieve(numberactionID, ActionRetrieveParamsparams, RequestOptionsoptions?): ActionRetrieveResponse`
**get** `/v2/droplets/{droplet_id}/actions/{action_id}`
To retrieve a Droplet action, send a GET request to
`/v2/droplets/$DROPLET_ID/actions/$ACTION_ID`.
The response will be a JSON object with a key called `action`. The value will
be a Droplet action object.
### Parameters
- `actionID: number`
- `params: ActionRetrieveParams`
- `droplet_id: number`
A unique identifier for a Droplet instance.
### Returns
- `ActionRetrieveResponse`
- `action?: Action`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `completed_at?: string | null`
A time value given in ISO8601 combined date and time format that represents when the action was completed.
- `region?: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `region_slug?: string | null`
A human-readable string that is used as a unique identifier for each region.
- `resource_id?: number | null`
A unique identifier for the resource that the action is associated with.
- `resource_type?: string`
The type of resource that the action is associated with.
- `started_at?: string`
A time value given in ISO8601 combined date and time format that represents when the action was initiated.
- `status?: "in-progress" | "completed" | "errored"`
The current status of the action. This can be "in-progress", "completed", or "errored".
- `"in-progress"`
- `"completed"`
- `"errored"`
- `type?: string`
This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const action = await client.gpuDroplets.actions.retrieve(36804636, { droplet_id: 3164444 });
console.log(action.action);
```
## List
`client.gpuDroplets.actions.list(numberdropletID, ActionListParamsquery?, RequestOptionsoptions?): ActionListResponse`
**get** `/v2/droplets/{droplet_id}/actions`
To retrieve a list of all actions that have been executed for a Droplet, send
a GET request to `/v2/droplets/$DROPLET_ID/actions`.
The results will be returned as a JSON object with an `actions` key. This will
be set to an array filled with `action` objects containing the standard
`action` attributes.
### Parameters
- `dropletID: number`
- `query: ActionListParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `ActionListResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `actions?: Array`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `completed_at?: string | null`
A time value given in ISO8601 combined date and time format that represents when the action was completed.
- `region?: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `region_slug?: string | null`
A human-readable string that is used as a unique identifier for each region.
- `resource_id?: number | null`
A unique identifier for the resource that the action is associated with.
- `resource_type?: string`
The type of resource that the action is associated with.
- `started_at?: string`
A time value given in ISO8601 combined date and time format that represents when the action was initiated.
- `status?: "in-progress" | "completed" | "errored"`
The current status of the action. This can be "in-progress", "completed", or "errored".
- `"in-progress"`
- `"completed"`
- `"errored"`
- `type?: string`
This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const actions = await client.gpuDroplets.actions.list(3164444);
console.log(actions.meta);
```
## Bulk Initiate
`client.gpuDroplets.actions.bulkInitiate(ActionBulkInitiateParamsparams, RequestOptionsoptions?): ActionBulkInitiateResponse`
**post** `/v2/droplets/actions`
Some actions can be performed in bulk on tagged Droplets. The actions can be
initiated by sending a POST to `/v2/droplets/actions?tag_name=$TAG_NAME` with
the action arguments.
Only a sub-set of action types are supported:
- `power_cycle`
- `power_on`
- `power_off`
- `shutdown`
- `enable_ipv6`
- `enable_backups`
- `disable_backups`
- `snapshot` (also requires `image:create` permission)
### Parameters
- `ActionBulkInitiateParams = DropletAction | DropletActionSnapshot`
- `ActionBulkInitiateParamsBase`
- `type: "enable_backups" | "disable_backups" | "reboot" | 12 more`
Body param: The type of action to initiate for the Droplet.
- `"enable_backups"`
- `"disable_backups"`
- `"reboot"`
- `"power_cycle"`
- `"shutdown"`
- `"power_off"`
- `"power_on"`
- `"restore"`
- `"password_reset"`
- `"resize"`
- `"rebuild"`
- `"rename"`
- `"change_kernel"`
- `"enable_ipv6"`
- `"snapshot"`
- `tag_name?: string`
Query param: Used to filter Droplets by a specific tag. Can not be combined with `name` or `type`.
Requires `tag:read` scope.
- `DropletAction extends ActionBulkInitiateParamsBase`
- `DropletActionSnapshot extends ActionBulkInitiateParamsBase`
### Returns
- `ActionBulkInitiateResponse`
- `actions?: Array`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `completed_at?: string | null`
A time value given in ISO8601 combined date and time format that represents when the action was completed.
- `region?: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `region_slug?: string | null`
A human-readable string that is used as a unique identifier for each region.
- `resource_id?: number | null`
A unique identifier for the resource that the action is associated with.
- `resource_type?: string`
The type of resource that the action is associated with.
- `started_at?: string`
A time value given in ISO8601 combined date and time format that represents when the action was initiated.
- `status?: "in-progress" | "completed" | "errored"`
The current status of the action. This can be "in-progress", "completed", or "errored".
- `"in-progress"`
- `"completed"`
- `"errored"`
- `type?: string`
This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.actions.bulkInitiate({ type: 'reboot' });
console.log(response.actions);
```
## Initiate
`client.gpuDroplets.actions.initiate(numberdropletID, ActionInitiateParamsbody, RequestOptionsoptions?): ActionInitiateResponse`
**post** `/v2/droplets/{droplet_id}/actions`
To initiate an action on a Droplet send a POST request to
`/v2/droplets/$DROPLET_ID/actions`. In the JSON body to the request,
set the `type` attribute to on of the supported action types:
| Action | Details | Additionally Required Permission |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `enable_backups` | Enables backups for a Droplet | |
| `disable_backups` | Disables backups for a Droplet | |
| `change_backup_policy` | Update the backup policy for a Droplet | |
| `reboot` | Reboots a Droplet. A `reboot` action is an attempt to reboot the Droplet in a graceful way, similar to using the `reboot` command from the console. | |
| `power_cycle` | Power cycles a Droplet. A `powercycle` action is similar to pushing the reset button on a physical machine, it's similar to booting from scratch. | |
| `shutdown` | Shutsdown a Droplet. A shutdown action is an attempt to shutdown the Droplet in a graceful way, similar to using the `shutdown` command from the console. Since a `shutdown` command can fail, this action guarantees that the command is issued, not that it succeeds. The preferred way to turn off a Droplet is to attempt a shutdown, with a reasonable timeout, followed by a `power_off` action to ensure the Droplet is off. | |
| `power_off` | Powers off a Droplet. A `power_off` event is a hard shutdown and should only be used if the `shutdown` action is not successful. It is similar to cutting the power on a server and could lead to complications. | |
| `power_on` | Powers on a Droplet. | |
| `restore` | Restore a Droplet using a backup image. The image ID that is passed in must be a backup of the current Droplet instance. The operation will leave any embedded SSH keys intact. | droplet:admin |
| `password_reset` | Resets the root password for a Droplet. A new password will be provided via email. It must be changed after first use. | droplet:admin |
| `resize` | Resizes a Droplet. Set the `size` attribute to a size slug. If a permanent resize with disk changes included is desired, set the `disk` attribute to `true`. | droplet:create |
| `rebuild` | Rebuilds a Droplet from a new base image. Set the `image` attribute to an image ID or slug. | droplet:admin |
| `rename` | Renames a Droplet. | |
| `change_kernel` | Changes a Droplet's kernel. Only applies to Droplets with externally managed kernels. All Droplets created after March 2017 use internal kernels by default. | |
| `enable_ipv6` | Enables IPv6 for a Droplet. Once enabled for a Droplet, IPv6 can not be disabled. When enabling IPv6 on an existing Droplet, [additional OS-level configuration](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/#on-existing-droplets) is required. | |
| `snapshot` | Takes a snapshot of a Droplet. | image:create |
### Parameters
- `dropletID: number`
- `ActionInitiateParams = DropletAction | DropletActionEnableBackups | DropletActionChangeBackupPolicy | 6 more`
- `ActionInitiateParamsBase`
- `type: "enable_backups" | "disable_backups" | "reboot" | 12 more`
The type of action to initiate for the Droplet.
- `"enable_backups"`
- `"disable_backups"`
- `"reboot"`
- `"power_cycle"`
- `"shutdown"`
- `"power_off"`
- `"power_on"`
- `"restore"`
- `"password_reset"`
- `"resize"`
- `"rebuild"`
- `"rename"`
- `"change_kernel"`
- `"enable_ipv6"`
- `"snapshot"`
- `DropletAction extends ActionInitiateParamsBase`
- `DropletActionEnableBackups extends ActionInitiateParamsBase`
- `DropletActionChangeBackupPolicy extends ActionInitiateParamsBase`
- `DropletActionRestore extends ActionInitiateParamsBase`
- `DropletActionResize extends ActionInitiateParamsBase`
- `DropletActionRebuild extends ActionInitiateParamsBase`
- `DropletActionRename extends ActionInitiateParamsBase`
- `DropletActionChangeKernel extends ActionInitiateParamsBase`
- `DropletActionSnapshot extends ActionInitiateParamsBase`
### Returns
- `ActionInitiateResponse`
- `action?: Action`
- `id?: number`
A unique numeric ID that can be used to identify and reference an action.
- `completed_at?: string | null`
A time value given in ISO8601 combined date and time format that represents when the action was completed.
- `region?: Region`
- `available: boolean`
This is a boolean value that represents whether new Droplets can be created in this region.
- `features: Array`
This attribute is set to an array which contains features available in this region
- `name: string`
The display name of the region. This will be a full name that is used in the control panel and other interfaces.
- `sizes: Array`
This attribute is set to an array which contains the identifying slugs for the sizes available in this region. sizes:read is required to view.
- `slug: string`
A human-readable string that is used as a unique identifier for each region.
- `region_slug?: string | null`
A human-readable string that is used as a unique identifier for each region.
- `resource_id?: number | null`
A unique identifier for the resource that the action is associated with.
- `resource_type?: string`
The type of resource that the action is associated with.
- `started_at?: string`
A time value given in ISO8601 combined date and time format that represents when the action was initiated.
- `status?: "in-progress" | "completed" | "errored"`
The current status of the action. This can be "in-progress", "completed", or "errored".
- `"in-progress"`
- `"completed"`
- `"errored"`
- `type?: string`
This is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.actions.initiate(3164444, { type: 'reboot' });
console.log(response.action);
```
# Destroy With Associated Resources
## List
`client.gpuDroplets.destroyWithAssociatedResources.list(numberdropletID, RequestOptionsoptions?): DestroyWithAssociatedResourceListResponse`
**get** `/v2/droplets/{droplet_id}/destroy_with_associated_resources`
To list the associated billable resources that can be destroyed along with a
Droplet, send a GET request to the
`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources` endpoint.
This endpoint will only return resources that you are authorized to see. For
example, to see associated Reserved IPs, include the `reserved_ip:read` scope.
The response will be a JSON object containing `snapshots`, `volumes`, and
`volume_snapshots` keys. Each will be set to an array of objects containing
information about the associated resources.
### Parameters
- `dropletID: number`
### Returns
- `DestroyWithAssociatedResourceListResponse`
- `floating_ips?: Array`
Floating IPs that are associated with this Droplet.
Requires `reserved_ip:read` scope.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
- `reserved_ips?: Array`
Reserved IPs that are associated with this Droplet.
Requires `reserved_ip:read` scope.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
- `snapshots?: Array`
Snapshots that are associated with this Droplet.
Requires `image:read` scope.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
- `volume_snapshots?: Array`
Volume Snapshots that are associated with this Droplet.
Requires `block_storage_snapshot:read` scope.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
- `volumes?: Array`
Volumes that are associated with this Droplet.
Requires `block_storage:read` scope.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const destroyWithAssociatedResources = await client.gpuDroplets.destroyWithAssociatedResources.list(3164444);
console.log(destroyWithAssociatedResources.floating_ips);
```
## Check Status
`client.gpuDroplets.destroyWithAssociatedResources.checkStatus(numberdropletID, RequestOptionsoptions?): DestroyWithAssociatedResourceCheckStatusResponse`
**get** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/status`
To check on the status of a request to destroy a Droplet with its associated
resources, send a GET request to the
`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status` endpoint.
### Parameters
- `dropletID: number`
### Returns
- `DestroyWithAssociatedResourceCheckStatusResponse`
An objects containing information about a resources scheduled for deletion.
- `completed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the requested action was completed.
- `droplet?: DestroyedAssociatedResource`
An object containing information about a resource scheduled for deletion.
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
- `failures?: number`
A count of the associated resources that failed to be destroyed, if any.
- `resources?: Resources`
An object containing additional information about resource related to a Droplet requested to be destroyed.
- `floating_ips?: Array`
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
- `reserved_ips?: Array`
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
- `snapshots?: Array`
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
- `volume_snapshots?: Array`
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
- `volumes?: Array`
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.destroyWithAssociatedResources.checkStatus(3164444);
console.log(response.completed_at);
```
## Delete Dangerous
`client.gpuDroplets.destroyWithAssociatedResources.deleteDangerous(numberdropletID, DestroyWithAssociatedResourceDeleteDangerousParamsparams, RequestOptionsoptions?): void`
**delete** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous`
To destroy a Droplet along with all of its associated resources, send a DELETE
request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous`
endpoint. The headers of this request must include an `X-Dangerous` key set to
`true`. To preview which resources will be destroyed, first query the
Droplet's associated resources. This operation _can not_ be reverse and should
be used with caution.
A successful response will include a 202 response code and no content. Use the
status endpoint to check on the success or failure of the destruction of the
individual resources.
### Parameters
- `dropletID: number`
- `params: DestroyWithAssociatedResourceDeleteDangerousParams`
- `xDangerous: boolean`
Acknowledge this action will destroy the Droplet and all associated resources and _can not_ be reversed.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.destroyWithAssociatedResources.deleteDangerous(3164444, { 'X-Dangerous': true });
```
## Delete Selective
`client.gpuDroplets.destroyWithAssociatedResources.deleteSelective(numberdropletID, DestroyWithAssociatedResourceDeleteSelectiveParamsbody?, RequestOptionsoptions?): void`
**delete** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/selective`
To destroy a Droplet along with a sub-set of its associated resources, send a
DELETE request to the `/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective`
endpoint. The JSON body of the request should include `reserved_ips`, `snapshots`, `volumes`,
or `volume_snapshots` keys each set to an array of IDs for the associated
resources to be destroyed. The IDs can be found by querying the Droplet's
associated resources. Any associated resource not included in the request
will remain and continue to accrue changes on your account.
A successful response will include a 202 response code and no content. Use
the status endpoint to check on the success or failure of the destruction of
the individual resources.
### Parameters
- `dropletID: number`
- `body: DestroyWithAssociatedResourceDeleteSelectiveParams`
- `floating_ips?: Array`
An array of unique identifiers for the floating IPs to be scheduled for deletion.
- `reserved_ips?: Array`
An array of unique identifiers for the reserved IPs to be scheduled for deletion.
- `snapshots?: Array`
An array of unique identifiers for the snapshots to be scheduled for deletion.
- `volume_snapshots?: Array`
An array of unique identifiers for the volume snapshots to be scheduled for deletion.
- `volumes?: Array`
An array of unique identifiers for the volumes to be scheduled for deletion.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.destroyWithAssociatedResources.deleteSelective(3164444);
```
## Retry
`client.gpuDroplets.destroyWithAssociatedResources.retry(numberdropletID, RequestOptionsoptions?): void`
**post** `/v2/droplets/{droplet_id}/destroy_with_associated_resources/retry`
If the status of a request to destroy a Droplet with its associated resources
reported any errors, it can be retried by sending a POST request to the
`/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry` endpoint.
Only one destroy can be active at a time per Droplet. If a retry is issued
while another destroy is in progress for the Droplet a 409 status code will
be returned. A successful response will include a 202 response code and no
content.
### Parameters
- `dropletID: number`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.destroyWithAssociatedResources.retry(3164444);
```
## Domain Types
### Associated Resource
- `AssociatedResource`
An objects containing information about a resource associated with a Droplet.
- `id?: string`
The unique identifier for the resource associated with the Droplet.
- `cost?: string`
The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.
- `name?: string`
The name of the resource associated with the Droplet.
### Destroyed Associated Resource
- `DestroyedAssociatedResource`
An object containing information about a resource scheduled for deletion.
- `id?: string`
The unique identifier for the resource scheduled for deletion.
- `destroyed_at?: string`
A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.
- `error_message?: string`
A string indicating that the resource was not successfully destroyed and providing additional information.
- `name?: string`
The name of the resource scheduled for deletion.
# Autoscale
## Create
`client.gpuDroplets.autoscale.create(AutoscaleCreateParamsbody, RequestOptionsoptions?): AutoscaleCreateResponse`
**post** `/v2/droplets/autoscale`
To create a new autoscale pool, send a POST request to `/v2/droplets/autoscale` setting the required attributes.
The response body will contain a JSON object with a key called `autoscale_pool` containing the standard attributes for the new autoscale pool.
### Parameters
- `body: AutoscaleCreateParams`
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name of the autoscale pool. This field cannot be updated
### Returns
- `AutoscaleCreateResponse`
- `autoscale_pool?: AutoscalePool`
- `id: string`
A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.
- `active_resources_count: number`
The number of active Droplets in the autoscale pool.
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name set for the autoscale pool.
- `status: "active" | "deleting" | "error"`
The current status of the autoscale pool.
- `"active"`
- `"deleting"`
- `"error"`
- `updated_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.
- `current_utilization?: CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const autoscale = await client.gpuDroplets.autoscale.create({
config: { min_instances: 1, max_instances: 5, target_cpu_utilization: 0.5, cooldown_minutes: 10 },
droplet_template: {
name: 'example.com',
region: 'nyc3',
size: 'c-2',
image: 'ubuntu-20-04-x64',
ssh_keys: ['3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45'],
backups: true,
ipv6: true,
monitoring: true,
tags: ['env:prod', 'web'],
user_data: '#cloud-config\nruncmd:\n - touch /test.txt\n',
vpc_uuid: '760e09ef-dc84-11e8-981e-3cfdfeaae000',
},
name: 'my-autoscale-pool',
});
console.log(autoscale.autoscale_pool);
```
## Retrieve
`client.gpuDroplets.autoscale.retrieve(stringautoscalePoolID, RequestOptionsoptions?): AutoscaleRetrieveResponse`
**get** `/v2/droplets/autoscale/{autoscale_pool_id}`
To show information about an individual autoscale pool, send a GET request to
`/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`.
### Parameters
- `autoscalePoolID: string`
### Returns
- `AutoscaleRetrieveResponse`
- `autoscale_pool?: AutoscalePool`
- `id: string`
A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.
- `active_resources_count: number`
The number of active Droplets in the autoscale pool.
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name set for the autoscale pool.
- `status: "active" | "deleting" | "error"`
The current status of the autoscale pool.
- `"active"`
- `"deleting"`
- `"error"`
- `updated_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.
- `current_utilization?: CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const autoscale = await client.gpuDroplets.autoscale.retrieve('0d3db13e-a604-4944-9827-7ec2642d32ac');
console.log(autoscale.autoscale_pool);
```
## Update
`client.gpuDroplets.autoscale.update(stringautoscalePoolID, AutoscaleUpdateParamsbody, RequestOptionsoptions?): AutoscaleUpdateResponse`
**put** `/v2/droplets/autoscale/{autoscale_pool_id}`
To update the configuration of an existing autoscale pool, send a PUT request to
`/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`. The request must contain a full representation
of the autoscale pool including existing attributes.
### Parameters
- `autoscalePoolID: string`
- `body: AutoscaleUpdateParams`
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name of the autoscale pool. This field cannot be updated
### Returns
- `AutoscaleUpdateResponse`
- `autoscale_pool?: AutoscalePool`
- `id: string`
A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.
- `active_resources_count: number`
The number of active Droplets in the autoscale pool.
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name set for the autoscale pool.
- `status: "active" | "deleting" | "error"`
The current status of the autoscale pool.
- `"active"`
- `"deleting"`
- `"error"`
- `updated_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.
- `current_utilization?: CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const autoscale = await client.gpuDroplets.autoscale.update('0d3db13e-a604-4944-9827-7ec2642d32ac', {
config: { target_number_instances: 2 },
droplet_template: {
name: 'example.com',
region: 'nyc3',
size: 'c-2',
image: 'ubuntu-20-04-x64',
ssh_keys: ['3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45'],
backups: true,
ipv6: true,
monitoring: true,
tags: ['env:prod', 'web'],
user_data: '#cloud-config\nruncmd:\n - touch /test.txt\n',
vpc_uuid: '760e09ef-dc84-11e8-981e-3cfdfeaae000',
},
name: 'my-autoscale-pool',
});
console.log(autoscale.autoscale_pool);
```
## List
`client.gpuDroplets.autoscale.list(AutoscaleListParamsquery?, RequestOptionsoptions?): AutoscaleListResponse`
**get** `/v2/droplets/autoscale`
To list all autoscale pools in your team, send a GET request to `/v2/droplets/autoscale`.
The response body will be a JSON object with a key of `autoscale_pools` containing an array of autoscale pool objects.
These each contain the standard autoscale pool attributes.
### Parameters
- `query: AutoscaleListParams`
- `name?: string`
The name of the autoscale pool
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `AutoscaleListResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `autoscale_pools?: Array`
- `id: string`
A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.
- `active_resources_count: number`
The number of active Droplets in the autoscale pool.
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name set for the autoscale pool.
- `status: "active" | "deleting" | "error"`
The current status of the autoscale pool.
- `"active"`
- `"deleting"`
- `"error"`
- `updated_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.
- `current_utilization?: CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const autoscales = await client.gpuDroplets.autoscale.list();
console.log(autoscales.meta);
```
## Delete
`client.gpuDroplets.autoscale.delete(stringautoscalePoolID, RequestOptionsoptions?): void`
**delete** `/v2/droplets/autoscale/{autoscale_pool_id}`
To destroy an autoscale pool, send a DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID` endpoint.
A successful response will include a 202 response code and no content.
### Parameters
- `autoscalePoolID: string`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.autoscale.delete('0d3db13e-a604-4944-9827-7ec2642d32ac');
```
## Delete Dangerous
`client.gpuDroplets.autoscale.deleteDangerous(stringautoscalePoolID, AutoscaleDeleteDangerousParamsparams, RequestOptionsoptions?): void`
**delete** `/v2/droplets/autoscale/{autoscale_pool_id}/dangerous`
To destroy an autoscale pool and its associated resources (Droplets),
send a DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous` endpoint.
### Parameters
- `autoscalePoolID: string`
- `params: AutoscaleDeleteDangerousParams`
- `xDangerous: boolean`
Acknowledge this action will destroy the autoscale pool and its associated resources and _can not_ be reversed.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.autoscale.deleteDangerous('0d3db13e-a604-4944-9827-7ec2642d32ac', {
'X-Dangerous': true,
});
```
## List History
`client.gpuDroplets.autoscale.listHistory(stringautoscalePoolID, AutoscaleListHistoryParamsquery?, RequestOptionsoptions?): AutoscaleListHistoryResponse`
**get** `/v2/droplets/autoscale/{autoscale_pool_id}/history`
To list all of the scaling history events of an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/history`.
The response body will be a JSON object with a key of `history`. This will be
set to an array containing objects each representing a history event.
### Parameters
- `autoscalePoolID: string`
- `query: AutoscaleListHistoryParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `AutoscaleListHistoryResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `history?: Array`
- `created_at: string`
The creation time of the history event in ISO8601 combined date and time format.
- `current_instance_count: number`
The current number of Droplets in the autoscale pool.
- `desired_instance_count: number`
The target number of Droplets for the autoscale pool after the scaling event.
- `history_event_id: string`
The unique identifier of the history event.
- `reason: "CONFIGURATION_CHANGE" | "SCALE_UP" | "SCALE_DOWN"`
The reason for the scaling event.
- `"CONFIGURATION_CHANGE"`
- `"SCALE_UP"`
- `"SCALE_DOWN"`
- `status: "in_progress" | "success" | "error"`
The status of the scaling event.
- `"in_progress"`
- `"success"`
- `"error"`
- `updated_at: string`
The last updated time of the history event in ISO8601 combined date and time format.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.autoscale.listHistory('0d3db13e-a604-4944-9827-7ec2642d32ac');
console.log(response.meta);
```
## List Members
`client.gpuDroplets.autoscale.listMembers(stringautoscalePoolID, AutoscaleListMembersParamsquery?, RequestOptionsoptions?): AutoscaleListMembersResponse`
**get** `/v2/droplets/autoscale/{autoscale_pool_id}/members`
To list the Droplets in an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/members`.
The response body will be a JSON object with a key of `droplets`. This will be
set to an array containing information about each of the Droplets in the autoscale pool.
### Parameters
- `autoscalePoolID: string`
- `query: AutoscaleListMembersParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `AutoscaleListMembersResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `droplets?: Array`
- `created_at: string`
The creation time of the Droplet in ISO8601 combined date and time format.
- `current_utilization: CurrentUtilization`
- `cpu?: number`
The CPU utilization average of the individual Droplet.
- `memory?: number`
The memory utilization average of the individual Droplet.
- `droplet_id: number`
The unique identifier of the Droplet.
- `health_status: string`
The health status of the Droplet.
- `status: "provisioning" | "active" | "deleting" | "off"`
The power status of the Droplet.
- `"provisioning"`
- `"active"`
- `"deleting"`
- `"off"`
- `updated_at: string`
The last updated time of the Droplet in ISO8601 combined date and time format.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const response = await client.gpuDroplets.autoscale.listMembers('0d3db13e-a604-4944-9827-7ec2642d32ac');
console.log(response.meta);
```
## Domain Types
### Autoscale Pool
- `AutoscalePool`
- `id: string`
A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.
- `active_resources_count: number`
The number of active Droplets in the autoscale pool.
- `config: AutoscalePoolStaticConfig | AutoscalePoolDynamicConfig`
The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
- `created_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.
- `droplet_template: AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
- `name: string`
The human-readable name set for the autoscale pool.
- `status: "active" | "deleting" | "error"`
The current status of the autoscale pool.
- `"active"`
- `"deleting"`
- `"error"`
- `updated_at: string`
A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.
- `current_utilization?: CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
### Autoscale Pool Droplet Template
- `AutoscalePoolDropletTemplate`
- `image: string`
The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.
- `region: "nyc1" | "nyc2" | "nyc3" | 11 more`
The datacenter in which all of the Droplets will be created.
- `"nyc1"`
- `"nyc2"`
- `"nyc3"`
- `"ams2"`
- `"ams3"`
- `"sfo1"`
- `"sfo2"`
- `"sfo3"`
- `"sgp1"`
- `"lon1"`
- `"fra1"`
- `"tor1"`
- `"blr1"`
- `"syd1"`
- `size: string`
The Droplet size to be used for all Droplets in the autoscale pool.
- `ssh_keys: Array`
The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint.
Requires `ssh_key:read` scope.
- `ipv6?: boolean`
Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.
- `name?: string`
The name(s) to be applied to all Droplets in the autoscale pool.
- `project_id?: string`
The project that the Droplets in the autoscale pool will belong to.
Requires `project:read` scope.
- `tags?: Array`
The tags to apply to each of the Droplets in the autoscale pool.
Requires `tag:read` scope.
- `user_data?: string`
A string containing user data that cloud-init consumes to configure a Droplet on first boot. User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size.
- `vpc_uuid?: string`
The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets.
Requires `vpc:read` scope.
- `with_droplet_agent?: boolean`
Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.
### Autoscale Pool Dynamic Config
- `AutoscalePoolDynamicConfig`
- `max_instances: number`
The maximum number of Droplets in an autoscale pool.
- `min_instances: number`
The minimum number of Droplets in an autoscale pool.
- `cooldown_minutes?: number`
The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.
- `target_cpu_utilization?: number`
Target CPU utilization as a decimal.
- `target_memory_utilization?: number`
Target memory utilization as a decimal.
### Autoscale Pool Static Config
- `AutoscalePoolStaticConfig`
- `target_number_instances: number`
Fixed number of instances in an autoscale pool.
### Current Utilization
- `CurrentUtilization`
- `cpu?: number`
The average CPU utilization of the autoscale pool.
- `memory?: number`
The average memory utilization of the autoscale pool.
# Firewalls
## Create
`client.gpuDroplets.firewalls.create(FirewallCreateParamsparams?, RequestOptionsoptions?): FirewallCreateResponse`
**post** `/v2/firewalls`
To create a new firewall, send a POST request to `/v2/firewalls`. The request
must contain at least one inbound or outbound access rule.
### Parameters
- `params: FirewallCreateParams`
- `body?: Body`
### Returns
- `FirewallCreateResponse`
- `firewall?: Firewall`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const firewall = await client.gpuDroplets.firewalls.create();
console.log(firewall.firewall);
```
## Retrieve
`client.gpuDroplets.firewalls.retrieve(stringfirewallID, RequestOptionsoptions?): FirewallRetrieveResponse`
**get** `/v2/firewalls/{firewall_id}`
To show information about an existing firewall, send a GET request to `/v2/firewalls/$FIREWALL_ID`.
### Parameters
- `firewallID: string`
### Returns
- `FirewallRetrieveResponse`
- `firewall?: Firewall`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const firewall = await client.gpuDroplets.firewalls.retrieve('bb4b2611-3d72-467b-8602-280330ecd65c');
console.log(firewall.firewall);
```
## Update
`client.gpuDroplets.firewalls.update(stringfirewallID, FirewallUpdateParamsparams, RequestOptionsoptions?): FirewallUpdateResponse`
**put** `/v2/firewalls/{firewall_id}`
To update the configuration of an existing firewall, send a PUT request to
`/v2/firewalls/$FIREWALL_ID`. The request should contain a full representation
of the firewall including existing attributes. **Note that any attributes that
are not provided will be reset to their default values.**
You must have read access (e.g. `droplet:read`) to all resources attached
to the firewall to successfully update the firewall.
### Parameters
- `firewallID: string`
- `params: FirewallUpdateParams`
- `firewall: Firewall`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Returns
- `FirewallUpdateResponse`
- `firewall?: Firewall`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const firewall = await client.gpuDroplets.firewalls.update('bb4b2611-3d72-467b-8602-280330ecd65c', {
firewall: { name: 'frontend-firewall' },
});
console.log(firewall.firewall);
```
## List
`client.gpuDroplets.firewalls.list(FirewallListParamsquery?, RequestOptionsoptions?): FirewallListResponse`
**get** `/v2/firewalls`
To list all of the firewalls available on your account, send a GET request to `/v2/firewalls`.
### Parameters
- `query: FirewallListParams`
- `page?: number`
Which 'page' of paginated results to return.
- `per_page?: number`
Number of items returned per page
### Returns
- `FirewallListResponse`
- `meta: MetaProperties`
Information about the response itself.
- `total?: number`
Number of objects returned by the request.
- `firewalls?: Array`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `links?: PageLinks`
- `pages?: ForwardLinks | BackwardLinks | unknown`
- `ForwardLinks`
- `last?: string`
URI of the last page of the results.
- `next?: string`
URI of the next page of the results.
- `BackwardLinks`
- `first?: string`
URI of the first page of the results.
- `prev?: string`
URI of the previous page of the results.
- `unknown`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
const firewalls = await client.gpuDroplets.firewalls.list();
console.log(firewalls.meta);
```
## Delete
`client.gpuDroplets.firewalls.delete(stringfirewallID, RequestOptionsoptions?): void`
**delete** `/v2/firewalls/{firewall_id}`
To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.delete('bb4b2611-3d72-467b-8602-280330ecd65c');
```
## Domain Types
### Firewall
- `Firewall`
- `id?: string`
A unique ID that can be used to identify and reference a firewall.
- `created_at?: string`
A time value given in ISO8601 combined date and time format that represents when the firewall was created.
- `droplet_ids?: Array | null`
An array containing the IDs of the Droplets assigned to the firewall.
Requires `droplet:read` scope.
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `name?: string`
A human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `pending_changes?: Array`
An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
- `droplet_id?: number`
- `removing?: boolean`
- `status?: string`
- `status?: "waiting" | "succeeded" | "failed"`
A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
- `"waiting"`
- `"succeeded"`
- `"failed"`
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
# Droplets
## Add
`client.gpuDroplets.firewalls.droplets.add(stringfirewallID, DropletAddParamsbody, RequestOptionsoptions?): void`
**post** `/v2/firewalls/{firewall_id}/droplets`
To assign a Droplet to a firewall, send a POST request to
`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there
should be a `droplet_ids` attribute containing a list of Droplet IDs.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: DropletAddParams`
- `droplet_ids: Array`
An array containing the IDs of the Droplets to be assigned to the firewall.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.droplets.add('bb4b2611-3d72-467b-8602-280330ecd65c', {
droplet_ids: [49696269],
});
```
## Remove
`client.gpuDroplets.firewalls.droplets.remove(stringfirewallID, DropletRemoveParamsbody, RequestOptionsoptions?): void`
**delete** `/v2/firewalls/{firewall_id}/droplets`
To remove a Droplet from a firewall, send a DELETE request to
`/v2/firewalls/$FIREWALL_ID/droplets`. In the body of the request, there should
be a `droplet_ids` attribute containing a list of Droplet IDs.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: DropletRemoveParams`
- `droplet_ids: Array`
An array containing the IDs of the Droplets to be removed from the firewall.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.droplets.remove('bb4b2611-3d72-467b-8602-280330ecd65c', {
droplet_ids: [49696269],
});
```
# Tags
## Add
`client.gpuDroplets.firewalls.tags.add(stringfirewallID, TagAddParamsbody, RequestOptionsoptions?): void`
**post** `/v2/firewalls/{firewall_id}/tags`
To assign a tag representing a group of Droplets to a firewall, send a POST
request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the request,
there should be a `tags` attribute containing a list of tag names.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: TagAddParams`
- `tags: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.tags.add('bb4b2611-3d72-467b-8602-280330ecd65c', { tags: ['frontend'] });
```
## Remove
`client.gpuDroplets.firewalls.tags.remove(stringfirewallID, TagRemoveParamsbody, RequestOptionsoptions?): void`
**delete** `/v2/firewalls/{firewall_id}/tags`
To remove a tag representing a group of Droplets from a firewall, send a
DELETE request to `/v2/firewalls/$FIREWALL_ID/tags`. In the body of the
request, there should be a `tags` attribute containing a list of tag names.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: TagRemoveParams`
- `tags: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.tags.remove('bb4b2611-3d72-467b-8602-280330ecd65c', {
tags: ['frontend'],
});
```
# Rules
## Add
`client.gpuDroplets.firewalls.rules.add(stringfirewallID, RuleAddParamsbody?, RequestOptionsoptions?): void`
**post** `/v2/firewalls/{firewall_id}/rules`
To add additional access rules to a firewall, send a POST request to
`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an
inbound_rules and/or outbound_rules attribute containing an array of rules to
be added.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: RuleAddParams`
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `outbound_rules?: Array | null`
- `destinations: FirewallRuleTarget`
An object specifying locations to which outbound traffic that will be allowed.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array | null`
A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requires `tag:create` and `tag:read` scopes.
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
### Example
```typescript
import Gradient from '@digitalocean/gradient';
const client = new Gradient();
await client.gpuDroplets.firewalls.rules.add('bb4b2611-3d72-467b-8602-280330ecd65c', {
inbound_rules: [{ protocol: 'tcp', ports: '3306', sources: { droplet_ids: [49696269] } }],
outbound_rules: [{ protocol: 'tcp', ports: '3306', destinations: { droplet_ids: [49696269] } }],
});
```
## Remove
`client.gpuDroplets.firewalls.rules.remove(stringfirewallID, RuleRemoveParamsbody?, RequestOptionsoptions?): void`
**delete** `/v2/firewalls/{firewall_id}/rules`
To remove access rules from a firewall, send a DELETE request to
`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an
`inbound_rules` and/or `outbound_rules` attribute containing an array of rules
to be removed.
No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.
### Parameters
- `firewallID: string`
- `body: RuleRemoveParams`
- `inbound_rules?: Array | null`
- `ports: string`
The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
- `protocol: "tcp" | "udp" | "icmp"`
The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
- `"tcp"`
- `"udp"`
- `"icmp"`
- `sources: FirewallRuleTarget`
An object specifying locations from which inbound traffic will be accepted.
- `addresses?: Array`
An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
- `droplet_ids?: Array`
An array containing the IDs of the Droplets to which the firewall will allow traffic.
- `kubernetes_ids?: Array`
An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
- `load_balancer_uids?: Array`
An array containing the IDs of the load balancers to which the firewall will allow traffic.
- `tags?: Array