# 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 | 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.remove('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] } }], }); ``` # Floating IPs ## Create `client.gpuDroplets.floatingIPs.create(FloatingIPCreateParamsbody, RequestOptionsoptions?): FloatingIPCreateResponse` **post** `/v2/floating_ips` On creation, a floating IP must be either assigned to a Droplet or reserved to a region. * To create a new floating IP assigned to a Droplet, send a POST request to `/v2/floating_ips` with the `droplet_id` attribute. * To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute. ### Parameters - `FloatingIPCreateParams = AssignToDroplet | ReserveToRegion` - `FloatingIPCreateParamsBase` - `droplet_id: number` The ID of the Droplet that the floating IP will be assigned to. - `AssignToDroplet extends FloatingIPCreateParamsBase` - `ReserveToRegion extends FloatingIPCreateParamsBase` ### Returns - `FloatingIPCreateResponse` - `floating_ip?: FloatingIP` - `droplet?: unknown | Droplet` The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.

Requires `droplet:read` scope. - `unknown` - `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. - `ip?: string` The public IP address of the floating IP. It also serves as its identifier. - `locked?: boolean` A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted. - `project_id?: string` The UUID of the project to which the reserved IP currently belongs.

Requires `project:read` scope. - `region?: Region` The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned. - `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. - `droplets?: 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 floatingIP = await client.gpuDroplets.floatingIPs.create({ droplet_id: 2457247 }); console.log(floatingIP.floating_ip); ``` ## Retrieve `client.gpuDroplets.floatingIPs.retrieve(stringfloatingIP, RequestOptionsoptions?): FloatingIPRetrieveResponse` **get** `/v2/floating_ips/{floating_ip}` To show information about a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP_ADDR`. ### Parameters - `floatingIP: string` ### Returns - `FloatingIPRetrieveResponse` - `floating_ip?: FloatingIP` - `droplet?: unknown | Droplet` The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.

Requires `droplet:read` scope. - `unknown` - `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. - `ip?: string` The public IP address of the floating IP. It also serves as its identifier. - `locked?: boolean` A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted. - `project_id?: string` The UUID of the project to which the reserved IP currently belongs.

Requires `project:read` scope. - `region?: Region` The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const floatingIP = await client.gpuDroplets.floatingIPs.retrieve('45.55.96.47'); console.log(floatingIP.floating_ip); ``` ## List `client.gpuDroplets.floatingIPs.list(FloatingIPListParamsquery?, RequestOptionsoptions?): FloatingIPListResponse` **get** `/v2/floating_ips` To list all of the floating IPs available on your account, send a GET request to `/v2/floating_ips`. ### Parameters - `query: FloatingIPListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `FloatingIPListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `floating_ips?: Array` - `droplet?: unknown | Droplet` The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.

Requires `droplet:read` scope. - `unknown` - `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. - `ip?: string` The public IP address of the floating IP. It also serves as its identifier. - `locked?: boolean` A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted. - `project_id?: string` The UUID of the project to which the reserved IP currently belongs.

Requires `project:read` scope. - `region?: Region` The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned. - `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 floatingIPs = await client.gpuDroplets.floatingIPs.list(); console.log(floatingIPs.meta); ``` ## Delete `client.gpuDroplets.floatingIPs.delete(stringfloatingIP, RequestOptionsoptions?): void` **delete** `/v2/floating_ips/{floating_ip}` To delete a floating IP and remove it from your account, send a DELETE request to `/v2/floating_ips/$FLOATING_IP_ADDR`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ### Parameters - `floatingIP: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.floatingIPs.delete('45.55.96.47'); ``` ## Domain Types ### Floating IP - `FloatingIP` - `droplet?: unknown | Droplet` The Droplet that the floating IP has been assigned to. When you query a floating IP, if it is assigned to a Droplet, the entire Droplet object will be returned. If it is not assigned, the value will be null.

Requires `droplet:read` scope. - `unknown` - `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. - `ip?: string` The public IP address of the floating IP. It also serves as its identifier. - `locked?: boolean` A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted. - `project_id?: string` The UUID of the project to which the reserved IP currently belongs.

Requires `project:read` scope. - `region?: Region` The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned. # Actions ## Create `client.gpuDroplets.floatingIPs.actions.create(stringfloatingIP, ActionCreateParamsbody, RequestOptionsoptions?): ActionCreateResponse` **post** `/v2/floating_ips/{floating_ip}/actions` To initiate an action on a floating IP send a POST request to `/v2/floating_ips/$FLOATING_IP/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: | Action | Details | | ---------- | ------------------------------------- | | `assign` | Assigns a floating IP to a Droplet | | `unassign` | Unassign a floating IP from a Droplet | ### Parameters - `floatingIP: string` - `ActionCreateParams = FloatingIPActionUnassign | FloatingIPActionAssign` - `ActionCreateParamsBase` - `type: "assign" | "unassign"` The type of action to initiate for the floating IP. - `"assign"` - `"unassign"` - `FloatingIPActionUnassign extends ActionCreateParamsBase` - `FloatingIPActionAssign extends ActionCreateParamsBase` ### Returns - `ActionCreateResponse` - `action?: Action` - `project_id?: string` The UUID of the project to which the reserved IP currently belongs. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const action = await client.gpuDroplets.floatingIPs.actions.create('45.55.96.47', { type: 'assign' }); console.log(action.action); ``` ## Retrieve `client.gpuDroplets.floatingIPs.actions.retrieve(numberactionID, ActionRetrieveParamsparams, RequestOptionsoptions?): ActionRetrieveResponse` **get** `/v2/floating_ips/{floating_ip}/actions/{action_id}` To retrieve the status of a floating IP action, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID`. ### Parameters - `actionID: number` - `params: ActionRetrieveParams` - `floating_ip: string` A floating IP address. ### Returns - `ActionRetrieveResponse` - `action?: Action` - `project_id?: string` The UUID of the project to which the reserved IP currently belongs. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const action = await client.gpuDroplets.floatingIPs.actions.retrieve(36804636, { floating_ip: '45.55.96.47', }); console.log(action.action); ``` ## List `client.gpuDroplets.floatingIPs.actions.list(stringfloatingIP, RequestOptionsoptions?): ActionListResponse` **get** `/v2/floating_ips/{floating_ip}/actions` To retrieve all actions that have been executed on a floating IP, send a GET request to `/v2/floating_ips/$FLOATING_IP/actions`. ### Parameters - `floatingIP: string` ### 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.floatingIPs.actions.list('45.55.96.47'); console.log(actions.meta); ``` # Images ## Create `client.gpuDroplets.images.create(ImageCreateParamsbody, RequestOptionsoptions?): ImageCreateResponse` **post** `/v2/images` To create a new custom image, send a POST request to /v2/images. The body must contain a url attribute pointing to a Linux virtual machine image to be imported into DigitalOcean. The image must be in the raw, qcow2, vhdx, vdi, or vmdk format. It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. ### Parameters - `body: ImageCreateParams` - `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"` - `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. - `region?: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `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. - `url?: string` A URL from which the custom Linux virtual machine image may be retrieved. The image it points to must be in the raw, qcow2, vhdx, vdi, or vmdk format. It may be compressed using gzip or bzip2 and must be smaller than 100 GB after being decompressed. ### Returns - `ImageCreateResponse` - `image?: Image` - `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"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const image = await client.gpuDroplets.images.create(); console.log(image.image); ``` ## Retrieve `client.gpuDroplets.images.retrieve(number | stringimageID, RequestOptionsoptions?): ImageRetrieveResponse` **get** `/v2/images/{image_id}` To retrieve information about an image, send a `GET` request to `/v2/images/$IDENTIFIER`. ### Parameters - `imageID: number | string` - `number` - `string` ### Returns - `ImageRetrieveResponse` - `image: Image` - `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"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const image = await client.gpuDroplets.images.retrieve(0); console.log(image.image); ``` ## Update `client.gpuDroplets.images.update(numberimageID, ImageUpdateParamsbody, RequestOptionsoptions?): ImageUpdateResponse` **put** `/v2/images/{image_id}` To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`. Set the `name` attribute to the new value you would like to use. For custom images, the `description` and `distribution` attributes may also be updated. ### Parameters - `imageID: number` - `body: ImageUpdateParams` - `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"` - `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. ### Returns - `ImageUpdateResponse` - `image: Image` - `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"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const image = await client.gpuDroplets.images.update(62137902); console.log(image.image); ``` ## List `client.gpuDroplets.images.list(ImageListParamsquery?, RequestOptionsoptions?): ImageListResponse` **get** `/v2/images` To list all of the images available on your account, send a GET request to /v2/images. ## Filtering Results --- It's possible to request filtered results by including certain query parameters. **Image Type** Either 1-Click Application or OS Distribution images can be filtered by using the `type` query parameter. > Important: The `type` query parameter does not directly relate to the `type` attribute. To retrieve only ***distribution*** images, include the `type` query parameter set to distribution, `/v2/images?type=distribution`. To retrieve only ***application*** images, include the `type` query parameter set to application, `/v2/images?type=application`. **User Images** To retrieve only the private images of a user, include the `private` query parameter set to true, `/v2/images?private=true`. **Tags** To list all images 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/images?tag_name=$TAG_NAME`. ### Parameters - `query: ImageListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page - `_private?: boolean` Used to filter only user images. - `tag_name?: string` Used to filter images by a specific tag. - `type?: "application" | "distribution"` Filters results based on image type which can be either `application` or `distribution`. - `"application"` - `"distribution"` ### Returns - `ImageListResponse` - `images: Array` - `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"` - `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` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const images = await client.gpuDroplets.images.list(); console.log(images.images); ``` ## Delete `client.gpuDroplets.images.delete(numberimageID, RequestOptionsoptions?): void` **delete** `/v2/images/{image_id}` To delete a snapshot or custom image, send a `DELETE` request to `/v2/images/$IMAGE_ID`. ### Parameters - `imageID: number` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.images.delete(62137902); ``` # Actions ## Create `client.gpuDroplets.images.actions.create(numberimageID, ActionCreateParamsbody, RequestOptionsoptions?): Action` **post** `/v2/images/{image_id}/actions` The following actions are available on an Image. ## Convert an Image to a Snapshot To convert an image, for example, a backup to a snapshot, send a POST request to `/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `convert`. ## Transfer an Image To transfer an image to another region, send a POST request to `/v2/images/$IMAGE_ID/actions`. Set the `type` attribute to `transfer` and set `region` attribute to the slug identifier of the region you wish to transfer to. ### Parameters - `imageID: number` - `ActionCreateParams = ImageActionBase | ImageActionTransfer` - `ActionCreateParamsBase` - `type: "convert" | "transfer"` The action to be taken on the image. Can be either `convert` or `transfer`. - `"convert"` - `"transfer"` - `ImageActionBase extends ActionCreateParamsBase` - `ImageActionTransfer extends ActionCreateParamsBase` ### Returns - `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.images.actions.create(62137902, { type: 'convert' }); console.log(action.id); ``` ## Retrieve `client.gpuDroplets.images.actions.retrieve(numberactionID, ActionRetrieveParamsparams, RequestOptionsoptions?): Action` **get** `/v2/images/{image_id}/actions/{action_id}` To retrieve the status of an image action, send a GET request to `/v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID`. ### Parameters - `actionID: number` - `params: ActionRetrieveParams` - `image_id: number` A unique number that can be used to identify and reference a specific image. ### Returns - `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.images.actions.retrieve(36804636, { image_id: 62137902 }); console.log(action.id); ``` ## List `client.gpuDroplets.images.actions.list(numberimageID, RequestOptionsoptions?): ActionListResponse` **get** `/v2/images/{image_id}/actions` To retrieve all actions that have been executed on an image, send a GET request to `/v2/images/$IMAGE_ID/actions`. ### Parameters - `imageID: number` ### 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.images.actions.list(62137902); console.log(actions.meta); ``` # Load Balancers ## Create `client.gpuDroplets.loadBalancers.create(LoadBalancerCreateParamsbody, RequestOptionsoptions?): LoadBalancerCreateResponse` **post** `/v2/load_balancers` To create a new load balancer instance, send a POST request to `/v2/load_balancers`. You can specify the Droplets that will sit behind the load balancer using one of two methods: * Set `droplet_ids` to a list of specific Droplet IDs. * Set `tag` to the name of a tag. All Droplets with this tag applied will be assigned to the load balancer. Additional Droplets will be automatically assigned as they are tagged. These methods are mutually exclusive. ### Parameters - `LoadBalancerCreateParams = AssignDropletsByID | AssignDropletsByTag` - `LoadBalancerCreateParamsBase` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `size?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. - `AssignDropletsByID extends LoadBalancerCreateParamsBase` - `AssignDropletsByTag extends LoadBalancerCreateParamsBase` ### Returns - `LoadBalancerCreateResponse` - `load_balancer?: LoadBalancer` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `id?: string` A unique ID that can be used to identify and reference a load balancer. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the load balancer was created. - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `ip?: string` An attribute containing the public-facing IP address of the load balancer. - `ipv6?: string` An attribute containing the public-facing IPv6 address of the load balancer. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: Region` The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. - `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?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `status?: "new" | "active" | "errored"` A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. - `"new"` - `"active"` - `"errored"` - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `tag?: string` The name of a Droplet tag corresponding to Droplets assigned to the load balancer. - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const loadBalancer = await client.gpuDroplets.loadBalancers.create({ forwarding_rules: [ { entry_protocol: 'http', entry_port: 80, target_protocol: 'http', target_port: 80 }, { entry_protocol: 'https', entry_port: 443, target_protocol: 'https', target_port: 443, tls_passthrough: true, }, ], droplet_ids: [3164444, 3164445], firewall: { deny: ['cidr:1.2.0.0/16', 'ip:2.3.4.5'], allow: ['ip:1.2.3.4', 'cidr:2.3.4.0/24'] }, http_idle_timeout_seconds: 60, name: 'example-lb-01', project_id: '9cc10173-e9ea-4176-9dbc-a4cee4c4ff30', region: 'nyc3', }); console.log(loadBalancer.load_balancer); ``` ## Retrieve `client.gpuDroplets.loadBalancers.retrieve(stringlbID, RequestOptionsoptions?): LoadBalancerRetrieveResponse` **get** `/v2/load_balancers/{lb_id}` To show information about a load balancer instance, send a GET request to `/v2/load_balancers/$LOAD_BALANCER_ID`. ### Parameters - `lbID: string` ### Returns - `LoadBalancerRetrieveResponse` - `load_balancer?: LoadBalancer` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `id?: string` A unique ID that can be used to identify and reference a load balancer. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the load balancer was created. - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `ip?: string` An attribute containing the public-facing IP address of the load balancer. - `ipv6?: string` An attribute containing the public-facing IPv6 address of the load balancer. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: Region` The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. - `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?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `status?: "new" | "active" | "errored"` A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. - `"new"` - `"active"` - `"errored"` - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `tag?: string` The name of a Droplet tag corresponding to Droplets assigned to the load balancer. - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const loadBalancer = await client.gpuDroplets.loadBalancers.retrieve('4de7ac8b-495b-4884-9a69-1050c6793cd6'); console.log(loadBalancer.load_balancer); ``` ## Update `client.gpuDroplets.loadBalancers.update(stringlbID, LoadBalancerUpdateParamsbody, RequestOptionsoptions?): LoadBalancerUpdateResponse` **put** `/v2/load_balancers/{lb_id}` To update a load balancer's settings, send a PUT request to `/v2/load_balancers/$LOAD_BALANCER_ID`. The request should contain a full representation of the load balancer including existing attributes. It may contain _one of_ the `droplets_ids` or `tag` attributes as they are mutually exclusive. **Note that any attribute that is not provided will be reset to its default value.** ### Parameters - `lbID: string` - `LoadBalancerUpdateParams = AssignDropletsByID | AssignDropletsByTag` - `LoadBalancerUpdateParamsBase` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `size?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. - `AssignDropletsByID extends LoadBalancerUpdateParamsBase` - `AssignDropletsByTag extends LoadBalancerUpdateParamsBase` ### Returns - `LoadBalancerUpdateResponse` - `load_balancer?: LoadBalancer` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `id?: string` A unique ID that can be used to identify and reference a load balancer. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the load balancer was created. - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `ip?: string` An attribute containing the public-facing IP address of the load balancer. - `ipv6?: string` An attribute containing the public-facing IPv6 address of the load balancer. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: Region` The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. - `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?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `status?: "new" | "active" | "errored"` A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. - `"new"` - `"active"` - `"errored"` - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `tag?: string` The name of a Droplet tag corresponding to Droplets assigned to the load balancer. - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const loadBalancer = await client.gpuDroplets.loadBalancers.update('4de7ac8b-495b-4884-9a69-1050c6793cd6', { forwarding_rules: [ { entry_protocol: 'http', entry_port: 80, target_protocol: 'http', target_port: 80, certificate_id: '', tls_passthrough: false, }, { entry_protocol: 'https', entry_port: 443, target_protocol: 'https', target_port: 443, certificate_id: '', tls_passthrough: true, }, ], algorithm: 'round_robin', droplet_ids: [3164444, 3164445], enable_backend_keepalive: true, enable_proxy_protocol: true, firewall: { deny: ['cidr:1.2.0.0/16', 'ip:2.3.4.5'], allow: ['ip:1.2.3.4', 'cidr:2.3.4.0/24'] }, health_check: { protocol: 'http', port: 80, path: '/', check_interval_seconds: 10, response_timeout_seconds: 5, healthy_threshold: 5, unhealthy_threshold: 3, }, http_idle_timeout_seconds: 60, name: 'updated-example-lb-01', project_id: '9cc10173-e9ea-4176-9dbc-a4cee4c4ff30', region: 'nyc3', sticky_sessions: { type: 'none' }, vpc_uuid: 'c33931f2-a26a-4e61-b85c-4e95a2ec431b', }); console.log(loadBalancer.load_balancer); ``` ## List `client.gpuDroplets.loadBalancers.list(LoadBalancerListParamsquery?, RequestOptionsoptions?): LoadBalancerListResponse` **get** `/v2/load_balancers` To list all of the load balancer instances on your account, send a GET request to `/v2/load_balancers`. ### Parameters - `query: LoadBalancerListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `LoadBalancerListResponse` - `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` - `load_balancers?: Array` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `id?: string` A unique ID that can be used to identify and reference a load balancer. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the load balancer was created. - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `ip?: string` An attribute containing the public-facing IP address of the load balancer. - `ipv6?: string` An attribute containing the public-facing IPv6 address of the load balancer. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: Region` The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. - `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?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `status?: "new" | "active" | "errored"` A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. - `"new"` - `"active"` - `"errored"` - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `tag?: string` The name of a Droplet tag corresponding to Droplets assigned to the load balancer. - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const loadBalancers = await client.gpuDroplets.loadBalancers.list(); console.log(loadBalancers.meta); ``` ## Delete `client.gpuDroplets.loadBalancers.delete(stringlbID, RequestOptionsoptions?): void` **delete** `/v2/load_balancers/{lb_id}` To delete a load balancer instance, disassociating any Droplets assigned to it and removing it from your account, send a DELETE request to `/v2/load_balancers/$LOAD_BALANCER_ID`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ### Parameters - `lbID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.delete('4de7ac8b-495b-4884-9a69-1050c6793cd6'); ``` ## Delete Cache `client.gpuDroplets.loadBalancers.deleteCache(stringlbID, RequestOptionsoptions?): void` **delete** `/v2/load_balancers/{lb_id}/cache` To delete a Global load balancer CDN cache, send a DELETE request to `/v2/load_balancers/$LOAD_BALANCER_ID/cache`. A successful request will receive a 204 status code with no body in response. This indicates that the request was processed successfully. ### Parameters - `lbID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.deleteCache('4de7ac8b-495b-4884-9a69-1050c6793cd6'); ``` ## Domain Types ### Domains - `Domains` An object specifying domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. ### Forwarding Rule - `ForwardingRule` An object specifying a forwarding rule for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. ### Glb Settings - `GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` ### Health Check - `HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. ### Lb Firewall - `LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') ### Load Balancer - `LoadBalancer` - `forwarding_rules: Array` An array of objects specifying the forwarding rules for a load balancer. - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. - `id?: string` A unique ID that can be used to identify and reference a load balancer. - `algorithm?: "round_robin" | "least_connections"` This field has been deprecated. You can no longer specify an algorithm for load balancers. - `"round_robin"` - `"least_connections"` - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the load balancer was created. - `disable_lets_encrypt_dns_records?: boolean` A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. - `domains?: Array` An array of objects specifying the domain configurations for a Global load balancer. - `certificate_id?: string` The ID of the TLS certificate used for SSL termination. - `is_managed?: boolean` A boolean value indicating if the domain is already managed by DigitalOcean. If true, all A and AAAA records required to enable Global load balancers will be automatically added. - `name?: string` FQDN to associate with a Global load balancer. - `droplet_ids?: Array` An array containing the IDs of the Droplets assigned to the load balancer. - `enable_backend_keepalive?: boolean` A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. - `enable_proxy_protocol?: boolean` A boolean value indicating whether PROXY Protocol is in use. - `firewall?: LbFirewall` An object specifying allow and deny rules to control traffic to the load balancer. - `allow?: Array` the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `deny?: Array` the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') - `glb_settings?: GlbSettings` An object specifying forwarding configurations for a Global load balancer. - `cdn?: Cdn` An object specifying CDN configurations for a Global load balancer. - `is_enabled?: boolean` A boolean flag to enable CDN caching. - `failover_threshold?: number` An integer value as a percentage to indicate failure threshold to decide how the regional priorities will take effect. A value of `50` would indicate that the Global load balancer will choose a lower priority region to forward traffic to once this failure threshold has been reached for the higher priority region. - `region_priorities?: Record` A map of region string to an integer priority value indicating preference for which regional target a Global load balancer will forward traffic to. A lower value indicates a higher priority. - `target_port?: number` An integer representing the port on the target backends which the load balancer will forward traffic to. - `target_protocol?: "http" | "https" | "http2"` The protocol used for forwarding traffic from the load balancer to the target backends. The possible values are `http`, `https` and `http2`. - `"http"` - `"https"` - `"http2"` - `health_check?: HealthCheck` An object specifying health check settings for the load balancer. - `check_interval_seconds?: number` The number of seconds between between two consecutive health checks. - `healthy_threshold?: number` The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. - `path?: string` The path on the backend Droplets to which the load balancer instance will send a request. - `port?: number` An integer representing the port on the backend Droplets on which the health check will attempt a connection. - `protocol?: "http" | "https" | "tcp"` The protocol used for health checks sent to the backend Droplets. The possible values are `http`, `https`, or `tcp`. - `"http"` - `"https"` - `"tcp"` - `response_timeout_seconds?: number` The number of seconds the load balancer instance will wait for a response until marking a health check as failed. - `unhealthy_threshold?: number` The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool. - `http_idle_timeout_seconds?: number` An integer value which configures the idle timeout for HTTP requests to the target droplets. - `ip?: string` An attribute containing the public-facing IP address of the load balancer. - `ipv6?: string` An attribute containing the public-facing IPv6 address of the load balancer. - `name?: string` A human-readable name for a load balancer instance. - `network?: "EXTERNAL" | "INTERNAL"` A string indicating whether the load balancer should be external or internal. Internal load balancers have no public IPs and are only accessible to resources on the same VPC network. This property cannot be updated after creating the load balancer. - `"EXTERNAL"` - `"INTERNAL"` - `network_stack?: "IPV4" | "DUALSTACK"` A string indicating whether the load balancer will support IPv4 or both IPv4 and IPv6 networking. This property cannot be updated after creating the load balancer. - `"IPV4"` - `"DUALSTACK"` - `project_id?: string` The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created. - `redirect_http_to_https?: boolean` A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443. - `region?: Region` The region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned. - `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?: "lb-small" | "lb-medium" | "lb-large"` This field has been replaced by the `size_unit` field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes. * `lb-small` = 1 node * `lb-medium` = 3 nodes * `lb-large` = 6 nodes You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation. - `"lb-small"` - `"lb-medium"` - `"lb-large"` - `size_unit?: number` How many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the `size` field to scale load balancers that reside in these regions. - `status?: "new" | "active" | "errored"` A status string indicating the current state of the load balancer. This can be `new`, `active`, or `errored`. - `"new"` - `"active"` - `"errored"` - `sticky_sessions?: StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` - `tag?: string` The name of a Droplet tag corresponding to Droplets assigned to the load balancer. - `target_load_balancer_ids?: Array` An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. - `tls_cipher_policy?: "DEFAULT" | "STRONG"` A string indicating the policy for the TLS cipher suites used by the load balancer. The possible values are `DEFAULT` or `STRONG`. The default value is `DEFAULT`. - `"DEFAULT"` - `"STRONG"` - `type?: "REGIONAL" | "REGIONAL_NETWORK" | "GLOBAL"` A string indicating whether the load balancer should be a standard regional HTTP load balancer, a regional network load balancer that routes traffic at the TCP/UDP transport layer, or a global load balancer. - `"REGIONAL"` - `"REGIONAL_NETWORK"` - `"GLOBAL"` - `vpc_uuid?: string` A string specifying the UUID of the VPC to which the load balancer is assigned. ### Sticky Sessions - `StickySessions` An object specifying sticky sessions settings for the load balancer. - `cookie_name?: string` The name of the cookie sent to the client. This attribute is only returned when using `cookies` for the sticky sessions type. - `cookie_ttl_seconds?: number` The number of seconds until the cookie set by the load balancer expires. This attribute is only returned when using `cookies` for the sticky sessions type. - `type?: "cookies" | "none"` An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are `cookies` or `none`. - `"cookies"` - `"none"` # Droplets ## Add `client.gpuDroplets.loadBalancers.droplets.add(stringlbID, DropletAddParamsbody, RequestOptionsoptions?): void` **post** `/v2/load_balancers/{lb_id}/droplets` To assign a Droplet to a load balancer instance, send a POST request to `/v2/load_balancers/$LOAD_BALANCER_ID/droplets`. In the body of the request, there should be a `droplet_ids` attribute containing a list of Droplet IDs. Individual Droplets can not be added to a load balancer configured with a Droplet tag. Attempting to do so will result in a "422 Unprocessable Entity" response from the API. 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 - `lbID: string` - `body: DropletAddParams` - `droplet_ids: Array` An array containing the IDs of the Droplets assigned to the load balancer. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.droplets.add('4de7ac8b-495b-4884-9a69-1050c6793cd6', { droplet_ids: [3164444, 3164445], }); ``` ## Remove `client.gpuDroplets.loadBalancers.droplets.remove(stringlbID, DropletRemoveParamsbody, RequestOptionsoptions?): void` **delete** `/v2/load_balancers/{lb_id}/droplets` To remove a Droplet from a load balancer instance, send a DELETE request to `/v2/load_balancers/$LOAD_BALANCER_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 - `lbID: string` - `body: DropletRemoveParams` - `droplet_ids: Array` An array containing the IDs of the Droplets assigned to the load balancer. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.droplets.remove('4de7ac8b-495b-4884-9a69-1050c6793cd6', { droplet_ids: [3164444, 3164445], }); ``` # Forwarding Rules ## Add `client.gpuDroplets.loadBalancers.forwardingRules.add(stringlbID, ForwardingRuleAddParamsbody, RequestOptionsoptions?): void` **post** `/v2/load_balancers/{lb_id}/forwarding_rules` To add an additional forwarding rule to a load balancer instance, send a POST request to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In the body of the request, there should be a `forwarding_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 - `lbID: string` - `body: ForwardingRuleAddParams` - `forwarding_rules: Array` - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.forwardingRules.add('4de7ac8b-495b-4884-9a69-1050c6793cd6', { forwarding_rules: [{ entry_port: 443, entry_protocol: 'https', target_port: 80, target_protocol: 'http' }], }); ``` ## Remove `client.gpuDroplets.loadBalancers.forwardingRules.remove(stringlbID, ForwardingRuleRemoveParamsbody, RequestOptionsoptions?): void` **delete** `/v2/load_balancers/{lb_id}/forwarding_rules` To remove forwarding rules from a load balancer instance, send a DELETE request to `/v2/load_balancers/$LOAD_BALANCER_ID/forwarding_rules`. In the body of the request, there should be a `forwarding_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 - `lbID: string` - `body: ForwardingRuleRemoveParams` - `forwarding_rules: Array` - `entry_port: number` An integer representing the port on which the load balancer instance will listen. - `entry_protocol: "http" | "https" | "http2" | 3 more` The protocol used for traffic to the load balancer. The possible values are: `http`, `https`, `http2`, `http3`, `tcp`, or `udp`. If you set the `entry_protocol` to `udp`, the `target_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"http3"` - `"tcp"` - `"udp"` - `target_port: number` An integer representing the port on the backend Droplets to which the load balancer will send traffic. - `target_protocol: "http" | "https" | "http2" | 2 more` The protocol used for traffic from the load balancer to the backend Droplets. The possible values are: `http`, `https`, `http2`, `tcp`, or `udp`. If you set the `target_protocol` to `udp`, the `entry_protocol` must be set to `udp`. When using UDP, the load balancer requires that you set up a health check with a port that uses TCP, HTTP, or HTTPS to work properly. - `"http"` - `"https"` - `"http2"` - `"tcp"` - `"udp"` - `certificate_id?: string` The ID of the TLS certificate used for SSL termination if enabled. - `tls_passthrough?: boolean` A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.loadBalancers.forwardingRules.remove('4de7ac8b-495b-4884-9a69-1050c6793cd6', { forwarding_rules: [{ entry_port: 443, entry_protocol: 'https', target_port: 80, target_protocol: 'http' }], }); ``` # Sizes ## List `client.gpuDroplets.sizes.list(SizeListParamsquery?, RequestOptionsoptions?): SizeListResponse` **get** `/v2/sizes` To list all of available Droplet sizes, send a GET request to `/v2/sizes`. The response will be a JSON object with a key called `sizes`. The value of this will be an array of `size` objects each of which contain the standard size attributes. ### Parameters - `query: SizeListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `SizeListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `sizes: Array` - `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. - `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 sizes = await client.gpuDroplets.sizes.list(); console.log(sizes.meta); ``` # Snapshots ## Retrieve `client.gpuDroplets.snapshots.retrieve(number | stringsnapshotID, RequestOptionsoptions?): SnapshotRetrieveResponse` **get** `/v2/snapshots/{snapshot_id}` To retrieve information about a snapshot, send a GET request to `/v2/snapshots/$SNAPSHOT_ID`. The response will be a JSON object with a key called `snapshot`. The value of this will be an snapshot object containing the standard snapshot attributes. ### Parameters - `snapshotID: number | string` The ID of a Droplet snapshot. - `number` - `string` ### Returns - `SnapshotRetrieveResponse` - `snapshot?: Snapshots` - `id: string` The unique identifier for the snapshot. - `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. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshot = await client.gpuDroplets.snapshots.retrieve(6372321); console.log(snapshot.snapshot); ``` ## List `client.gpuDroplets.snapshots.list(SnapshotListParamsquery?, RequestOptionsoptions?): SnapshotListResponse` **get** `/v2/snapshots` To list all of the snapshots available on your account, send a GET request to `/v2/snapshots`. The response will be a JSON object with a key called `snapshots`. This will be set to an array of `snapshot` objects, each of which will contain the standard snapshot attributes. ### Filtering Results by Resource Type It's possible to request filtered results by including certain query parameters. #### List Droplet Snapshots To retrieve only snapshots based on Droplets, include the `resource_type` query parameter set to `droplet`. For example, `/v2/snapshots?resource_type=droplet`. #### List Volume Snapshots To retrieve only snapshots based on volumes, include the `resource_type` query parameter set to `volume`. For example, `/v2/snapshots?resource_type=volume`. ### Parameters - `query: SnapshotListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page - `resource_type?: "droplet" | "volume"` Used to filter snapshots by a resource type. - `"droplet"` - `"volume"` ### Returns - `SnapshotListResponse` - `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: string` The unique identifier for the snapshot. - `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. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshots = await client.gpuDroplets.snapshots.list(); console.log(snapshots.meta); ``` ## Delete `client.gpuDroplets.snapshots.delete(number | stringsnapshotID, RequestOptionsoptions?): void` **delete** `/v2/snapshots/{snapshot_id}` Both Droplet and volume snapshots are managed through the `/v2/snapshots/` endpoint. To delete a snapshot, send a DELETE request to `/v2/snapshots/$SNAPSHOT_ID`. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. ### Parameters - `snapshotID: number | string` The ID of a Droplet snapshot. - `number` - `string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.snapshots.delete(6372321); ``` # Volumes ## Create `client.gpuDroplets.volumes.create(VolumeCreateParamsbody, RequestOptionsoptions?): VolumeCreateResponse` **post** `/v2/volumes` To create a new volume, send a POST request to `/v2/volumes`. Optionally, a `filesystem_type` attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. ### Parameters - `VolumeCreateParams = VolumesExt4 | VolumesXfs` - `VolumeCreateParamsBase` - `name: string` A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. - `region: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `size_gigabytes: number` The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. - `description?: string` An optional free-form text field to describe a block storage volume. - `filesystem_label?: string` The label applied to the filesystem. Labels for ext4 type filesystems may contain 16 characters while labels for xfs type filesystems are limited to 12 characters. May only be used in conjunction with filesystem_type. - `filesystem_type?: string` The name of the filesystem type to be used on the volume. When provided, the volume will automatically be formatted to the specified filesystem type. Currently, the available options are `ext4` and `xfs`. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to other Droplets is not recommended. - `snapshot_id?: string` The unique identifier for the volume snapshot from which to create the volume. - `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. - `VolumesExt4 extends VolumeCreateParamsBase` - `VolumesXfs extends VolumeCreateParamsBase` ### Returns - `VolumeCreateResponse` - `volume?: Volume` - `id?: string` The unique identifier for the block storage volume. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. - `description?: string` An optional free-form text field to describe a block storage volume. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. - `filesystem_label?: string` The label currently applied to the filesystem. - `filesystem_type?: string` The type of filesystem currently in-use on the volume. - `name?: string` A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. - `region?: Region` The region that the block storage volume is located in. When setting a region, the value should be the slug identifier for the region. When you query a block storage volume, the entire region object will be returned. - `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_gigabytes?: number` The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. - `tags?: Array | null` A flat array of tag names as strings applied to the resource.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const volume = await client.gpuDroplets.volumes.create({ name: 'ext4-example', region: 'nyc1', size_gigabytes: 10, description: 'Block store for examples', filesystem_label: 'ext4_volume_01', filesystem_type: 'ext4', }); console.log(volume.volume); ``` ## Retrieve `client.gpuDroplets.volumes.retrieve(stringvolumeID, RequestOptionsoptions?): VolumeRetrieveResponse` **get** `/v2/volumes/{volume_id}` To show information about a block storage volume, send a GET request to `/v2/volumes/$VOLUME_ID`. ### Parameters - `volumeID: string` ### Returns - `VolumeRetrieveResponse` - `volume?: Volume` - `id?: string` The unique identifier for the block storage volume. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. - `description?: string` An optional free-form text field to describe a block storage volume. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. - `filesystem_label?: string` The label currently applied to the filesystem. - `filesystem_type?: string` The type of filesystem currently in-use on the volume. - `name?: string` A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. - `region?: Region` The region that the block storage volume is located in. When setting a region, the value should be the slug identifier for the region. When you query a block storage volume, the entire region object will be returned. - `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_gigabytes?: number` The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. - `tags?: Array | null` A flat array of tag names as strings applied to the resource.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const volume = await client.gpuDroplets.volumes.retrieve('7724db7c-e098-11e5-b522-000f53304e51'); console.log(volume.volume); ``` ## List `client.gpuDroplets.volumes.list(VolumeListParamsquery?, RequestOptionsoptions?): VolumeListResponse` **get** `/v2/volumes` To list all of the block storage volumes available on your account, send a GET request to `/v2/volumes`. ## Filtering Results ### By Region The `region` may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: `/v2/volumes?region=nyc1` ### By Name It is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to `/v2/volumes?name=$VOLUME_NAME`. **Note:** You can only create one volume per region with the same name. ### By Name and Region It is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME®ion=nyc1`. ### Parameters - `query: VolumeListParams` - `name?: string` The block storage volume's name. - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page - `region?: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource is available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` ### Returns - `VolumeListResponse` - `meta: MetaProperties` Information about the response itself. - `total?: number` Number of objects returned by the request. - `volumes: Array` Array of volumes. - `id?: string` The unique identifier for the block storage volume. - `created_at?: string` A time value given in ISO8601 combined date and time format that represents when the block storage volume was created. - `description?: string` An optional free-form text field to describe a block storage volume. - `droplet_ids?: Array | null` An array containing the IDs of the Droplets the volume is attached to. Note that at this time, a volume can only be attached to a single Droplet. - `filesystem_label?: string` The label currently applied to the filesystem. - `filesystem_type?: string` The type of filesystem currently in-use on the volume. - `name?: string` A human-readable name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters. The name must begin with a letter. - `region?: Region` The region that the block storage volume is located in. When setting a region, the value should be the slug identifier for the region. When you query a block storage volume, the entire region object will be returned. - `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_gigabytes?: number` The size of the block storage volume in GiB (1024^3). This field does not apply when creating a volume from a snapshot. - `tags?: Array | null` A flat array of tag names as strings applied to the resource.

Requires `tag: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 volumes = await client.gpuDroplets.volumes.list(); console.log(volumes.meta); ``` ## Delete `client.gpuDroplets.volumes.delete(stringvolumeID, RequestOptionsoptions?): void` **delete** `/v2/volumes/{volume_id}` To delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to `/v2/volumes/$VOLUME_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 - `volumeID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.volumes.delete('7724db7c-e098-11e5-b522-000f53304e51'); ``` ## Delete By Name `client.gpuDroplets.volumes.deleteByName(VolumeDeleteByNameParamsparams?, RequestOptionsoptions?): void` **delete** `/v2/volumes` Block storage volumes may also be deleted by name by sending a DELETE request with the volume's **name** and the **region slug** for the region it is located in as query parameters to `/v2/volumes?name=$VOLUME_NAME®ion=nyc1`. 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 - `params: VolumeDeleteByNameParams` - `name?: string` The block storage volume's name. - `region?: "ams1" | "ams2" | "ams3" | 12 more` The slug identifier for the region where the resource is available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.volumes.deleteByName(); ``` # Actions ## Retrieve `client.gpuDroplets.volumes.actions.retrieve(numberactionID, ActionRetrieveParamsparams, RequestOptionsoptions?): ActionRetrieveResponse` **get** `/v2/volumes/{volume_id}/actions/{action_id}` To retrieve the status of a volume action, send a GET request to `/v2/volumes/$VOLUME_ID/actions/$ACTION_ID`. ### Parameters - `actionID: number` - `params: ActionRetrieveParams` - `volume_id: string` Path param: The ID of the block storage volume. - `page?: number` Query param: Which 'page' of paginated results to return. - `per_page?: number` Query param: Number of items returned per page ### Returns - `ActionRetrieveResponse` - `action?: VolumeAction` - `resource_id?: number | null` - `type?: string` This is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach action. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const action = await client.gpuDroplets.volumes.actions.retrieve(36804636, { volume_id: '7724db7c-e098-11e5-b522-000f53304e51', }); console.log(action.action); ``` ## List `client.gpuDroplets.volumes.actions.list(stringvolumeID, ActionListParamsquery?, RequestOptionsoptions?): ActionListResponse` **get** `/v2/volumes/{volume_id}/actions` To retrieve all actions that have been executed on a volume, send a GET request to `/v2/volumes/$VOLUME_ID/actions`. ### Parameters - `volumeID: string` - `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` - `resource_id?: number | null` - `type?: string` This is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach 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.volumes.actions.list('7724db7c-e098-11e5-b522-000f53304e51'); console.log(actions.meta); ``` ## Initiate By ID `client.gpuDroplets.volumes.actions.initiateByID(stringvolumeID, ActionInitiateByIDParamsparams, RequestOptionsoptions?): ActionInitiateByIDResponse` **post** `/v2/volumes/{volume_id}/actions` To initiate an action on a block storage volume by Id, send a POST request to `~/v2/volumes/$VOLUME_ID/actions`. The body should contain the appropriate attributes for the respective action. ## Attach a Block Storage Volume to a Droplet | Attribute | Details | | ---------- | ------------------------------------------------------------------- | | type | This must be `attach` | | droplet_id | Set to the Droplet's ID | | region | Set to the slug representing the region where the volume is located | Each volume may only be attached to a single Droplet. However, up to fifteen volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, [additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/) is required. ## Remove a Block Storage Volume from a Droplet | Attribute | Details | | ---------- | ------------------------------------------------------------------- | | type | This must be `detach` | | droplet_id | Set to the Droplet's ID | | region | Set to the slug representing the region where the volume is located | ## Resize a Volume | Attribute | Details | | -------------- | ------------------------------------------------------------------- | | type | This must be `resize` | | size_gigabytes | The new size of the block storage volume in GiB (1024^3) | | region | Set to the slug representing the region where the volume is located | Volumes may only be resized upwards. The maximum size for a volume is 16TiB. ### Parameters - `volumeID: string` - `ActionInitiateByIDParams = VolumeActionPostAttach | VolumeActionPostDetach | VolumeActionPostResize` - `ActionInitiateByIDParamsBase` - `droplet_id: number` Body param: The unique identifier for the Droplet the volume will be attached or detached from. - `type: "attach" | "detach" | "resize"` Body param: The volume action to initiate. - `"attach"` - `"detach"` - `"resize"` - `page?: number` Query param: Which 'page' of paginated results to return. - `per_page?: number` Query param: Number of items returned per page - `region?: "ams1" | "ams2" | "ams3" | 12 more` Body param: The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `tags?: Array | null` Body param: 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. - `VolumeActionPostAttach extends ActionInitiateByIDParamsBase` - `VolumeActionPostDetach extends ActionInitiateByIDParamsBase` - `VolumeActionPostResize extends ActionInitiateByIDParamsBase` ### Returns - `ActionInitiateByIDResponse` - `action?: VolumeAction` - `resource_id?: number | null` - `type?: string` This is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach action. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.volumes.actions.initiateByID( '7724db7c-e098-11e5-b522-000f53304e51', { droplet_id: 11612190, type: 'attach', region: 'nyc1', tags: ['aninterestingtag'] }, ); console.log(response.action); ``` ## Initiate By Name `client.gpuDroplets.volumes.actions.initiateByName(ActionInitiateByNameParamsparams, RequestOptionsoptions?): ActionInitiateByNameResponse` **post** `/v2/volumes/actions` To initiate an action on a block storage volume by Name, send a POST request to `~/v2/volumes/actions`. The body should contain the appropriate attributes for the respective action. ## Attach a Block Storage Volume to a Droplet | Attribute | Details | | ----------- | ------------------------------------------------------------------- | | type | This must be `attach` | | volume_name | The name of the block storage volume | | droplet_id | Set to the Droplet's ID | | region | Set to the slug representing the region where the volume is located | Each volume may only be attached to a single Droplet. However, up to fifteen volumes may be attached to a Droplet at a time. Pre-formatted volumes will be automatically mounted to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018 when attached. On older Droplets, [additional configuration](https://docs.digitalocean.com/products/volumes/how-to/mount/) is required. ## Remove a Block Storage Volume from a Droplet | Attribute | Details | | ----------- | ------------------------------------------------------------------- | | type | This must be `detach` | | volume_name | The name of the block storage volume | | droplet_id | Set to the Droplet's ID | | region | Set to the slug representing the region where the volume is located | ### Parameters - `ActionInitiateByNameParams = VolumeActionPostAttach | VolumeActionPostDetach` - `ActionInitiateByNameParamsBase` - `droplet_id: number` Body param: The unique identifier for the Droplet the volume will be attached or detached from. - `type: "attach" | "detach" | "resize"` Body param: The volume action to initiate. - `"attach"` - `"detach"` - `"resize"` - `page?: number` Query param: Which 'page' of paginated results to return. - `per_page?: number` Query param: Number of items returned per page - `region?: "ams1" | "ams2" | "ams3" | 12 more` Body param: The slug identifier for the region where the resource will initially be available. - `"ams1"` - `"ams2"` - `"ams3"` - `"blr1"` - `"fra1"` - `"lon1"` - `"nyc1"` - `"nyc2"` - `"nyc3"` - `"sfo1"` - `"sfo2"` - `"sfo3"` - `"sgp1"` - `"tor1"` - `"syd1"` - `tags?: Array | null` Body param: 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. - `VolumeActionPostAttach extends ActionInitiateByNameParamsBase` - `VolumeActionPostDetach extends ActionInitiateByNameParamsBase` ### Returns - `ActionInitiateByNameResponse` - `action?: VolumeAction` - `resource_id?: number | null` - `type?: string` This is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach action. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const response = await client.gpuDroplets.volumes.actions.initiateByName({ droplet_id: 11612190, type: 'attach', region: 'nyc1', tags: ['aninterestingtag'], }); console.log(response.action); ``` ## Domain Types ### Volume Action - `VolumeAction extends Action` - `resource_id?: number | null` - `type?: string` This is the type of action that the object represents. For example, this could be "attach_volume" to represent the state of a volume attach action. # Snapshots ## Create `client.gpuDroplets.volumes.snapshots.create(stringvolumeID, SnapshotCreateParamsbody, RequestOptionsoptions?): SnapshotCreateResponse` **post** `/v2/volumes/{volume_id}/snapshots` To create a snapshot from a volume, sent a POST request to `/v2/volumes/$VOLUME_ID/snapshots`. ### Parameters - `volumeID: string` - `body: SnapshotCreateParams` - `name: string` A human-readable name for the volume snapshot. - `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. ### Returns - `SnapshotCreateResponse` - `snapshot?: Snapshots` - `id: string` The unique identifier for the snapshot. - `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. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshot = await client.gpuDroplets.volumes.snapshots.create('7724db7c-e098-11e5-b522-000f53304e51', { name: 'big-data-snapshot1475261774', }); console.log(snapshot.snapshot); ``` ## Retrieve `client.gpuDroplets.volumes.snapshots.retrieve(stringsnapshotID, RequestOptionsoptions?): SnapshotRetrieveResponse` **get** `/v2/volumes/snapshots/{snapshot_id}` To retrieve the details of a snapshot that has been created from a volume, send a GET request to `/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`. ### Parameters - `snapshotID: string` ### Returns - `SnapshotRetrieveResponse` - `snapshot?: Snapshots` - `id: string` The unique identifier for the snapshot. - `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. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshot = await client.gpuDroplets.volumes.snapshots.retrieve('fbe805e8-866b-11e6-96bf-000f53315a41'); console.log(snapshot.snapshot); ``` ## List `client.gpuDroplets.volumes.snapshots.list(stringvolumeID, SnapshotListParamsquery?, RequestOptionsoptions?): SnapshotListResponse` **get** `/v2/volumes/{volume_id}/snapshots` To retrieve the snapshots that have been created from a volume, send a GET request to `/v2/volumes/$VOLUME_ID/snapshots`. ### Parameters - `volumeID: string` - `query: SnapshotListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `SnapshotListResponse` - `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: string` The unique identifier for the snapshot. - `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. - `resource_id: string` The unique identifier for the resource that the snapshot originated from. - `resource_type: "droplet" | "volume"` The type of resource that the snapshot originated from. - `"droplet"` - `"volume"` - `size_gigabytes: number` The billable size of the snapshot in gigabytes. - `tags: Array | null` An array of Tags the snapshot has been tagged with.

Requires `tag:read` scope. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const snapshots = await client.gpuDroplets.volumes.snapshots.list('7724db7c-e098-11e5-b522-000f53304e51'); console.log(snapshots.meta); ``` ## Delete `client.gpuDroplets.volumes.snapshots.delete(stringsnapshotID, RequestOptionsoptions?): void` **delete** `/v2/volumes/snapshots/{snapshot_id}` To delete a volume snapshot, send a DELETE request to `/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID`. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. ### Parameters - `snapshotID: string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.volumes.snapshots.delete('fbe805e8-866b-11e6-96bf-000f53315a41'); ``` # Account # Keys ## Create `client.gpuDroplets.account.keys.create(KeyCreateParamsbody, RequestOptionsoptions?): KeyCreateResponse` **post** `/v2/account/keys` To add a new SSH public key to your DigitalOcean account, send a POST request to `/v2/account/keys`. Set the `name` attribute to the name you wish to use and the `public_key` attribute to the full public key you are adding. ### Parameters - `body: KeyCreateParams` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. ### Returns - `KeyCreateResponse` - `ssh_key?: SSHKeys` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. - `id?: number` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `fingerprint?: string` A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const key = await client.gpuDroplets.account.keys.create({ name: 'My SSH Public Key', public_key: 'ssh-rsa AEXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example', }); console.log(key.ssh_key); ``` ## Retrieve `client.gpuDroplets.account.keys.retrieve(number | stringsshKeyIdentifier, RequestOptionsoptions?): KeyRetrieveResponse` **get** `/v2/account/keys/{ssh_key_identifier}` To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`. The response will be a JSON object with the key `ssh_key` and value an ssh_key object which contains the standard ssh_key attributes. ### Parameters - `sshKeyIdentifier: number | string` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `number` - `string` ### Returns - `KeyRetrieveResponse` - `ssh_key?: SSHKeys` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. - `id?: number` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `fingerprint?: string` A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const key = await client.gpuDroplets.account.keys.retrieve(512189); console.log(key.ssh_key); ``` ## Update `client.gpuDroplets.account.keys.update(number | stringsshKeyIdentifier, KeyUpdateParamsbody, RequestOptionsoptions?): KeyUpdateResponse` **put** `/v2/account/keys/{ssh_key_identifier}` To update the name of an SSH key, send a PUT request to either `/v2/account/keys/$SSH_KEY_ID` or `/v2/account/keys/$SSH_KEY_FINGERPRINT`. Set the `name` attribute to the new name you want to use. ### Parameters - `sshKeyIdentifier: number | string` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `number` - `string` - `body: KeyUpdateParams` - `name?: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. ### Returns - `KeyUpdateResponse` - `ssh_key?: SSHKeys` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. - `id?: number` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `fingerprint?: string` A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const key = await client.gpuDroplets.account.keys.update(512189); console.log(key.ssh_key); ``` ## List `client.gpuDroplets.account.keys.list(KeyListParamsquery?, RequestOptionsoptions?): KeyListResponse` **get** `/v2/account/keys` To list all of the keys in your account, send a GET request to `/v2/account/keys`. The response will be a JSON object with a key set to `ssh_keys`. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes. ### Parameters - `query: KeyListParams` - `page?: number` Which 'page' of paginated results to return. - `per_page?: number` Number of items returned per page ### Returns - `KeyListResponse` - `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` - `ssh_keys?: Array` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. - `id?: number` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `fingerprint?: string` A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account. ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); const keys = await client.gpuDroplets.account.keys.list(); console.log(keys.meta); ``` ## Delete `client.gpuDroplets.account.keys.delete(number | stringsshKeyIdentifier, RequestOptionsoptions?): void` **delete** `/v2/account/keys/{ssh_key_identifier}` To destroy a public SSH key that you have in your account, send a DELETE request to `/v2/account/keys/$KEY_ID` or `/v2/account/keys/$KEY_FINGERPRINT`. A 204 status will be returned, indicating that the action was successful and that the response body is empty. ### Parameters - `sshKeyIdentifier: number | string` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `number` - `string` ### Example ```typescript import Gradient from '@digitalocean/gradient'; const client = new Gradient(); await client.gpuDroplets.account.keys.delete(512189); ``` ## Domain Types ### SSH Keys - `SSHKeys` - `name: string` A human-readable display name for this key, used to easily identify the SSH keys when they are displayed. - `public_key: string` The entire public key string that was uploaded. Embedded into the root user's `authorized_keys` file if you include this key during Droplet creation. - `id?: number` A unique identification number for this key. Can be used to embed a specific SSH key into a Droplet. - `fingerprint?: string` A unique identifier that differentiates this key from other keys using a format that SSH recognizes. The fingerprint is created when the key is added to your account.