Skip to content
  • Auto
  • Light
  • Dark

GPU Droplets

GPU Droplets

Create a New Droplet
gpu_droplets.create(GPUDropletCreateParams**kwargs) -> GPUDropletCreateResponse
post/v2/droplets
Delete an Existing Droplet
gpu_droplets.delete(intdroplet_id)
delete/v2/droplets/{droplet_id}
Deleting Droplets by Tag
gpu_droplets.delete_by_tag(GPUDropletDeleteByTagParams**kwargs)
delete/v2/droplets
List All Droplets
gpu_droplets.list(GPUDropletListParams**kwargs) -> GPUDropletListResponse
get/v2/droplets
List all Firewalls Applied to a Droplet
gpu_droplets.list_firewalls(intdroplet_id, GPUDropletListFirewallsParams**kwargs) -> GPUDropletListFirewallsResponse
get/v2/droplets/{droplet_id}/firewalls
List All Available Kernels for a Droplet
gpu_droplets.list_kernels(intdroplet_id, GPUDropletListKernelsParams**kwargs) -> GPUDropletListKernelsResponse
get/v2/droplets/{droplet_id}/kernels
List Neighbors for a Droplet
gpu_droplets.list_neighbors(intdroplet_id) -> GPUDropletListNeighborsResponse
get/v2/droplets/{droplet_id}/neighbors
List Snapshots for a Droplet
gpu_droplets.list_snapshots(intdroplet_id, GPUDropletListSnapshotsParams**kwargs) -> GPUDropletListSnapshotsResponse
get/v2/droplets/{droplet_id}/snapshots
Retrieve an Existing Droplet
gpu_droplets.retrieve(intdroplet_id) -> GPUDropletRetrieveResponse
get/v2/droplets/{droplet_id}
ModelsExpand Collapse
class DropletBackupPolicy:
hour: Optional[Literal[0, 4, 8, 3 more]]

The hour of the day that the backup window will start.

Accepts one of the following:
0
4
8
12
16
20
plan: Optional[Literal["daily", "weekly"]]

The backup plan used for the Droplet. The plan can be either daily or weekly.

Accepts one of the following:
"daily"
"weekly"
retention_period_days: Optional[int]

The number of days the backup will be retained.

weekday: Optional[Literal["SUN", "MON", "TUE", 4 more]]

The day of the week on which the backup will occur.

Accepts one of the following:
"SUN"
"MON"
"TUE"
"WED"
"THU"
"FRI"
"SAT"
window_length_hours: Optional[int]

The length of the backup window starting from hour.

GPU DropletsAccount

GPU DropletsAccountKeys

Create a New SSH Key
gpu_droplets.account.keys.create(KeyCreateParams**kwargs) -> KeyCreateResponse
post/v2/account/keys
Delete an SSH Key
gpu_droplets.account.keys.delete(Union[int, str]ssh_key_identifier)
delete/v2/account/keys/{ssh_key_identifier}
List All SSH Keys
gpu_droplets.account.keys.list(KeyListParams**kwargs) -> KeyListResponse
get/v2/account/keys
Retrieve an Existing SSH Key
gpu_droplets.account.keys.retrieve(Union[int, str]ssh_key_identifier) -> KeyRetrieveResponse
get/v2/account/keys/{ssh_key_identifier}
Update an SSH Key's Name
gpu_droplets.account.keys.update(Union[int, str]ssh_key_identifier, KeyUpdateParams**kwargs) -> KeyUpdateResponse
put/v2/account/keys/{ssh_key_identifier}

GPU DropletsActions

Acting on Tagged Droplets
gpu_droplets.actions.bulk_initiate(ActionBulkInitiateParams**kwargs) -> ActionBulkInitiateResponse
post/v2/droplets/actions
Initiate a Droplet Action
gpu_droplets.actions.initiate(intdroplet_id, ActionInitiateParams**kwargs) -> ActionInitiateResponse
post/v2/droplets/{droplet_id}/actions
List Actions for a Droplet
gpu_droplets.actions.list(intdroplet_id, ActionListParams**kwargs) -> ActionListResponse
get/v2/droplets/{droplet_id}/actions
Retrieve a Droplet Action
gpu_droplets.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> ActionRetrieveResponse
get/v2/droplets/{droplet_id}/actions/{action_id}

GPU DropletsAutoscale

Create a New Autoscale Pool
gpu_droplets.autoscale.create(AutoscaleCreateParams**kwargs) -> AutoscaleCreateResponse
post/v2/droplets/autoscale
Delete autoscale pool
gpu_droplets.autoscale.delete(strautoscale_pool_id)
delete/v2/droplets/autoscale/{autoscale_pool_id}
Delete autoscale pool and resources
gpu_droplets.autoscale.delete_dangerous(strautoscale_pool_id, AutoscaleDeleteDangerousParams**kwargs)
delete/v2/droplets/autoscale/{autoscale_pool_id}/dangerous
List All Autoscale Pools
gpu_droplets.autoscale.list(AutoscaleListParams**kwargs) -> AutoscaleListResponse
get/v2/droplets/autoscale
List history events
gpu_droplets.autoscale.list_history(strautoscale_pool_id, AutoscaleListHistoryParams**kwargs) -> AutoscaleListHistoryResponse
get/v2/droplets/autoscale/{autoscale_pool_id}/history
List members
gpu_droplets.autoscale.list_members(strautoscale_pool_id, AutoscaleListMembersParams**kwargs) -> AutoscaleListMembersResponse
get/v2/droplets/autoscale/{autoscale_pool_id}/members
Retrieve an Existing Autoscale Pool
gpu_droplets.autoscale.retrieve(strautoscale_pool_id) -> AutoscaleRetrieveResponse
get/v2/droplets/autoscale/{autoscale_pool_id}
Update Autoscale Pool
gpu_droplets.autoscale.update(strautoscale_pool_id, AutoscaleUpdateParams**kwargs) -> AutoscaleUpdateResponse
put/v2/droplets/autoscale/{autoscale_pool_id}
ModelsExpand Collapse
class AutoscalePool:
id: str

A unique identifier for each autoscale pool instance. This is automatically generated upon autoscale pool creation.

active_resources_count: int

The number of active Droplets in the autoscale pool.

config: Config

The scaling configuration for an autoscale pool, which is how the pool scales up and down (either by resource utilization or static configuration).

created_at: datetime

A time value given in ISO8601 combined date and time format that represents when the autoscale pool was created.

formatdate-time
name: str

The human-readable name set for the autoscale pool.

status: Literal["active", "deleting", "error"]

The current status of the autoscale pool.

Accepts one of the following:
"active"
"deleting"
"error"
updated_at: datetime

A time value given in ISO8601 combined date and time format that represents when the autoscale pool was last updated.

formatdate-time
current_utilization: Optional[CurrentUtilization]
class AutoscalePoolDropletTemplate:
image: str

The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID.

region: Literal["nyc1", "nyc2", "nyc3", 11 more]

The datacenter in which all of the Droplets will be created.

Accepts one of the following:
"nyc1"
"nyc2"
"nyc3"
"ams2"
"ams3"
"sfo1"
"sfo2"
"sfo3"
"sgp1"
"lon1"
"fra1"
"tor1"
"blr1"
"syd1"
size: str

The Droplet size to be used for all Droplets in the autoscale pool.

ssh_keys: List[str]

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: Optional[bool]

Assigns a unique IPv6 address to each of the Droplets in the autoscale pool.

name: Optional[str]

The name(s) to be applied to all Droplets in the autoscale pool.

project_id: Optional[str]

The project that the Droplets in the autoscale pool will belong to. Requires project:read scope.

tags: Optional[List[str]]

The tags to apply to each of the Droplets in the autoscale pool. Requires tag:read scope.

user_data: Optional[str]

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: Optional[str]

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: Optional[bool]

Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling.

class AutoscalePoolDynamicConfig:
max_instances: int

The maximum number of Droplets in an autoscale pool.

minimum1
maximum1000
min_instances: int

The minimum number of Droplets in an autoscale pool.

minimum1
maximum500
cooldown_minutes: Optional[int]

The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes.

minimum5
maximum20
target_cpu_utilization: Optional[float]

Target CPU utilization as a decimal.

formatfloat
minimum0.05
maximum1
target_memory_utilization: Optional[float]

Target memory utilization as a decimal.

formatfloat
minimum0.05
maximum1
class AutoscalePoolStaticConfig:
target_number_instances: int

Fixed number of instances in an autoscale pool.

minimum1
maximum1000
class CurrentUtilization:
cpu: Optional[float]

The average CPU utilization of the autoscale pool.

formatfloat
minimum0
maximum1
memory: Optional[float]

The average memory utilization of the autoscale pool.

formatfloat
minimum0
maximum1

GPU DropletsBackups

List Backups for a Droplet
gpu_droplets.backups.list(intdroplet_id, BackupListParams**kwargs) -> BackupListResponse
get/v2/droplets/{droplet_id}/backups
List Backup Policies for All Existing Droplets
gpu_droplets.backups.list_policies(BackupListPoliciesParams**kwargs) -> BackupListPoliciesResponse
get/v2/droplets/backups/policies
List Supported Droplet Backup Policies
gpu_droplets.backups.list_supported_policies() -> BackupListSupportedPoliciesResponse
get/v2/droplets/backups/supported_policies
Retrieve the Backup Policy for an Existing Droplet
gpu_droplets.backups.retrieve_policy(intdroplet_id) -> BackupRetrievePolicyResponse
get/v2/droplets/{droplet_id}/backups/policy

GPU DropletsDestroy With Associated Resources

Check Status of a Droplet Destroy with Associated Resources Request
gpu_droplets.destroy_with_associated_resources.check_status(intdroplet_id) -> DestroyWithAssociatedResourceCheckStatusResponse
get/v2/droplets/{droplet_id}/destroy_with_associated_resources/status
Destroy a Droplet and All of its Associated Resources (Dangerous)
gpu_droplets.destroy_with_associated_resources.delete_dangerous(intdroplet_id, DestroyWithAssociatedResourceDeleteDangerousParams**kwargs)
delete/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous
Selectively Destroy a Droplet and its Associated Resources
gpu_droplets.destroy_with_associated_resources.delete_selective(intdroplet_id, DestroyWithAssociatedResourceDeleteSelectiveParams**kwargs)
delete/v2/droplets/{droplet_id}/destroy_with_associated_resources/selective
List Associated Resources for a Droplet
gpu_droplets.destroy_with_associated_resources.list(intdroplet_id) -> DestroyWithAssociatedResourceListResponse
get/v2/droplets/{droplet_id}/destroy_with_associated_resources
Retry a Droplet Destroy with Associated Resources Request
gpu_droplets.destroy_with_associated_resources.retry(intdroplet_id)
post/v2/droplets/{droplet_id}/destroy_with_associated_resources/retry
ModelsExpand Collapse
class AssociatedResource:

An objects containing information about a resource associated with a Droplet.

id: Optional[str]

The unique identifier for the resource associated with the Droplet.

cost: Optional[str]

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

name: Optional[str]

The name of the resource associated with the Droplet.

class DestroyedAssociatedResource:

An object containing information about a resource scheduled for deletion.

id: Optional[str]

The unique identifier for the resource scheduled for deletion.

destroyed_at: Optional[datetime]

A time value given in ISO8601 combined date and time format indicating when the resource was destroyed if the request was successful.

formatdate-time
error_message: Optional[str]

A string indicating that the resource was not successfully destroyed and providing additional information.

name: Optional[str]

The name of the resource scheduled for deletion.

GPU DropletsFirewalls

Create a New Firewall
gpu_droplets.firewalls.create(FirewallCreateParams**kwargs) -> FirewallCreateResponse
post/v2/firewalls
Delete a Firewall
gpu_droplets.firewalls.delete(strfirewall_id)
delete/v2/firewalls/{firewall_id}
List All Firewalls
gpu_droplets.firewalls.list(FirewallListParams**kwargs) -> FirewallListResponse
get/v2/firewalls
Retrieve an Existing Firewall
gpu_droplets.firewalls.retrieve(strfirewall_id) -> FirewallRetrieveResponse
get/v2/firewalls/{firewall_id}
Update a Firewall
gpu_droplets.firewalls.update(strfirewall_id, FirewallUpdateParams**kwargs) -> FirewallUpdateResponse
put/v2/firewalls/{firewall_id}
ModelsExpand Collapse
class Firewall:
id: Optional[str]

A unique ID that can be used to identify and reference a firewall.

created_at: Optional[datetime]

A time value given in ISO8601 combined date and time format that represents when the firewall was created.

formatdate-time
droplet_ids: Optional[List[int]]

An array containing the IDs of the Droplets assigned to the firewall.

Requires droplet:read scope.

inbound_rules: Optional[List[InboundRule]]
ports: str

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: Literal["tcp", "udp", "icmp"]

The type of traffic to be allowed. This may be one of tcp, udp, or icmp.

Accepts one of the following:
"tcp"
"udp"
"icmp"

An object specifying locations from which inbound traffic will be accepted.

name: Optional[str]

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: Optional[List[OutboundRule]]
destinations: FirewallRuleTarget

An object specifying locations to which outbound traffic that will be allowed.

ports: str

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: Literal["tcp", "udp", "icmp"]

The type of traffic to be allowed. This may be one of tcp, udp, or icmp.

Accepts one of the following:
"tcp"
"udp"
"icmp"
pending_changes: Optional[List[PendingChange]]

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: Optional[int]
removing: Optional[bool]
status: Optional[str]
status: Optional[Literal["waiting", "succeeded", "failed"]]

A status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".

Accepts one of the following:
"waiting"
"succeeded"
"failed"
tags: Optional[List[str]]

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.

GPU DropletsFirewallsDroplets

Add Droplets to a Firewall
gpu_droplets.firewalls.droplets.add(strfirewall_id, DropletAddParams**kwargs)
post/v2/firewalls/{firewall_id}/droplets
Remove Droplets from a Firewall
gpu_droplets.firewalls.droplets.remove(strfirewall_id, DropletRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/droplets

GPU DropletsFirewallsRules

Add Rules to a Firewall
gpu_droplets.firewalls.rules.add(strfirewall_id, RuleAddParams**kwargs)
post/v2/firewalls/{firewall_id}/rules
Remove Rules from a Firewall
gpu_droplets.firewalls.rules.remove(strfirewall_id, RuleRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/rules

GPU DropletsFirewallsTags

Add Tags to a Firewall
gpu_droplets.firewalls.tags.add(strfirewall_id, TagAddParams**kwargs)
post/v2/firewalls/{firewall_id}/tags
Remove Tags from a Firewall
gpu_droplets.firewalls.tags.remove(strfirewall_id, TagRemoveParams**kwargs)
delete/v2/firewalls/{firewall_id}/tags

GPU DropletsFloating IPs

Create a New Floating IP
gpu_droplets.floating_ips.create(FloatingIPCreateParams**kwargs) -> FloatingIPCreateResponse
post/v2/floating_ips
Delete a Floating IP
gpu_droplets.floating_ips.delete(strfloating_ip)
delete/v2/floating_ips/{floating_ip}
List All Floating IPs
gpu_droplets.floating_ips.list(FloatingIPListParams**kwargs) -> FloatingIPListResponse
get/v2/floating_ips
Retrieve an Existing Floating IP
gpu_droplets.floating_ips.retrieve(strfloating_ip) -> FloatingIPRetrieveResponse
get/v2/floating_ips/{floating_ip}
ModelsExpand Collapse
class FloatingIP:
droplet: Optional[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.

DropletNull = Optional[object]

If the floating IP is not assigned to a Droplet, the value will be null.

ip: Optional[str]

The public IP address of the floating IP. It also serves as its identifier.

formatipv4
locked: Optional[bool]

A boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.

project_id: Optional[str]

The UUID of the project to which the reserved IP currently belongs.

Requires project:read scope.

formatuuid
region: Optional[Region]

The region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned.

GPU DropletsFloating IPsActions

Initiate a Floating IP Action
gpu_droplets.floating_ips.actions.create(strfloating_ip, ActionCreateParams**kwargs) -> ActionCreateResponse
post/v2/floating_ips/{floating_ip}/actions
List All Actions for a Floating IP
gpu_droplets.floating_ips.actions.list(strfloating_ip) -> ActionListResponse
get/v2/floating_ips/{floating_ip}/actions
Retrieve an Existing Floating IP Action
gpu_droplets.floating_ips.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> ActionRetrieveResponse
get/v2/floating_ips/{floating_ip}/actions/{action_id}

GPU DropletsImages

Create a Custom Image
gpu_droplets.images.create(ImageCreateParams**kwargs) -> ImageCreateResponse
post/v2/images
Delete an Image
gpu_droplets.images.delete(intimage_id)
delete/v2/images/{image_id}
List All Images
gpu_droplets.images.list(ImageListParams**kwargs) -> ImageListResponse
get/v2/images
Retrieve an Existing Image
gpu_droplets.images.retrieve(Union[int, str]image_id) -> ImageRetrieveResponse
get/v2/images/{image_id}
Update an Image
gpu_droplets.images.update(intimage_id, ImageUpdateParams**kwargs) -> ImageUpdateResponse
put/v2/images/{image_id}

GPU DropletsImagesActions

Initiate an Image Action
gpu_droplets.images.actions.create(intimage_id, ActionCreateParams**kwargs) -> Action
post/v2/images/{image_id}/actions
List All Actions for an Image
gpu_droplets.images.actions.list(intimage_id) -> ActionListResponse
get/v2/images/{image_id}/actions
Retrieve an Existing Action
gpu_droplets.images.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> Action
get/v2/images/{image_id}/actions/{action_id}

GPU DropletsLoad Balancers

Create a New Load Balancer
gpu_droplets.load_balancers.create(LoadBalancerCreateParams**kwargs) -> LoadBalancerCreateResponse
post/v2/load_balancers
Delete a Load Balancer
gpu_droplets.load_balancers.delete(strlb_id)
delete/v2/load_balancers/{lb_id}
Delete a Global Load Balancer CDN Cache
gpu_droplets.load_balancers.delete_cache(strlb_id)
delete/v2/load_balancers/{lb_id}/cache
List All Load Balancers
gpu_droplets.load_balancers.list(LoadBalancerListParams**kwargs) -> LoadBalancerListResponse
get/v2/load_balancers
Retrieve an Existing Load Balancer
gpu_droplets.load_balancers.retrieve(strlb_id) -> LoadBalancerRetrieveResponse
get/v2/load_balancers/{lb_id}
Update a Load Balancer
gpu_droplets.load_balancers.update(strlb_id, LoadBalancerUpdateParams**kwargs) -> LoadBalancerUpdateResponse
put/v2/load_balancers/{lb_id}
ModelsExpand Collapse
class Domains:

An object specifying domain configurations for a Global load balancer.

certificate_id: Optional[str]

The ID of the TLS certificate used for SSL termination.

is_managed: Optional[bool]

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: Optional[str]

FQDN to associate with a Global load balancer.

class ForwardingRule:

An object specifying a forwarding rule for a load balancer.

entry_port: int

An integer representing the port on which the load balancer instance will listen.

entry_protocol: Literal["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.

Accepts one of the following:
"http"
"https"
"http2"
"http3"
"tcp"
"udp"
target_port: int

An integer representing the port on the backend Droplets to which the load balancer will send traffic.

target_protocol: Literal["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.

Accepts one of the following:
"http"
"https"
"http2"
"tcp"
"udp"
certificate_id: Optional[str]

The ID of the TLS certificate used for SSL termination if enabled.

tls_passthrough: Optional[bool]

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets.

class GlbSettings:

An object specifying forwarding configurations for a Global load balancer.

cdn: Optional[Cdn]

An object specifying CDN configurations for a Global load balancer.

is_enabled: Optional[bool]

A boolean flag to enable CDN caching.

failover_threshold: Optional[int]

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: Optional[Dict[str, int]]

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: Optional[int]

An integer representing the port on the target backends which the load balancer will forward traffic to.

target_protocol: Optional[Literal["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.

Accepts one of the following:
"http"
"https"
"http2"
class HealthCheck:

An object specifying health check settings for the load balancer.

check_interval_seconds: Optional[int]

The number of seconds between between two consecutive health checks.

healthy_threshold: Optional[int]

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: Optional[str]

The path on the backend Droplets to which the load balancer instance will send a request.

port: Optional[int]

An integer representing the port on the backend Droplets on which the health check will attempt a connection.

protocol: Optional[Literal["http", "https", "tcp"]]

The protocol used for health checks sent to the backend Droplets. The possible values are http, https, or tcp.

Accepts one of the following:
"http"
"https"
"tcp"
response_timeout_seconds: Optional[int]

The number of seconds the load balancer instance will wait for a response until marking a health check as failed.

unhealthy_threshold: Optional[int]

The number of times a health check must fail for a backend Droplet to be marked "unhealthy" and be removed from the pool.

class LbFirewall:

An object specifying allow and deny rules to control traffic to the load balancer.

allow: Optional[List[str]]

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: Optional[List[str]]

the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16')

class LoadBalancer:
forwarding_rules: List[ForwardingRule]

An array of objects specifying the forwarding rules for a load balancer.

entry_port: int

An integer representing the port on which the load balancer instance will listen.

entry_protocol: Literal["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.

Accepts one of the following:
"http"
"https"
"http2"
"http3"
"tcp"
"udp"
target_port: int

An integer representing the port on the backend Droplets to which the load balancer will send traffic.

target_protocol: Literal["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.

Accepts one of the following:
"http"
"https"
"http2"
"tcp"
"udp"
certificate_id: Optional[str]

The ID of the TLS certificate used for SSL termination if enabled.

tls_passthrough: Optional[bool]

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets.

id: Optional[str]

A unique ID that can be used to identify and reference a load balancer.

formatuuid
Deprecatedalgorithm: Optional[Literal["round_robin", "least_connections"]]

This field has been deprecated. You can no longer specify an algorithm for load balancers.

Accepts one of the following:
"round_robin"
"least_connections"
created_at: Optional[datetime]

A time value given in ISO8601 combined date and time format that represents when the load balancer was created.

formatdate-time
disable_lets_encrypt_dns_records: Optional[bool]

A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer.

domains: Optional[List[Domains]]

An array of objects specifying the domain configurations for a Global load balancer.

certificate_id: Optional[str]

The ID of the TLS certificate used for SSL termination.

is_managed: Optional[bool]

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: Optional[str]

FQDN to associate with a Global load balancer.

droplet_ids: Optional[List[int]]

An array containing the IDs of the Droplets assigned to the load balancer.

enable_backend_keepalive: Optional[bool]

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets.

enable_proxy_protocol: Optional[bool]

A boolean value indicating whether PROXY Protocol is in use.

firewall: Optional[LbFirewall]

An object specifying allow and deny rules to control traffic to the load balancer.

glb_settings: Optional[GlbSettings]

An object specifying forwarding configurations for a Global load balancer.

health_check: Optional[HealthCheck]

An object specifying health check settings for the load balancer.

http_idle_timeout_seconds: Optional[int]

An integer value which configures the idle timeout for HTTP requests to the target droplets.

minimum30
maximum600
ip: Optional[str]

An attribute containing the public-facing IP address of the load balancer.

ipv6: Optional[str]

An attribute containing the public-facing IPv6 address of the load balancer.

name: Optional[str]

A human-readable name for a load balancer instance.

network: Optional[Literal["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.

Accepts one of the following:
"EXTERNAL"
"INTERNAL"
network_stack: Optional[Literal["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.

Accepts one of the following:
"IPV4"
"DUALSTACK"
project_id: Optional[str]

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: Optional[bool]

A boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443.

region: Optional[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.

Deprecatedsize: Optional[Literal["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.

Accepts one of the following:
"lb-small"
"lb-medium"
"lb-large"
size_unit: Optional[int]

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.

minimum1
maximum100
status: Optional[Literal["new", "active", "errored"]]

A status string indicating the current state of the load balancer. This can be new, active, or errored.

Accepts one of the following:
"new"
"active"
"errored"
sticky_sessions: Optional[StickySessions]

An object specifying sticky sessions settings for the load balancer.

tag: Optional[str]

The name of a Droplet tag corresponding to Droplets assigned to the load balancer.

target_load_balancer_ids: Optional[List[str]]

An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer.

tls_cipher_policy: Optional[Literal["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.

Accepts one of the following:
"DEFAULT"
"STRONG"
type: Optional[Literal["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.

Accepts one of the following:
"REGIONAL"
"REGIONAL_NETWORK"
"GLOBAL"
vpc_uuid: Optional[str]

A string specifying the UUID of the VPC to which the load balancer is assigned.

formatuuid
class StickySessions:

An object specifying sticky sessions settings for the load balancer.

The name of the cookie sent to the client. This attribute is only returned when using cookies for the sticky sessions type.

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: Optional[Literal["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.

Accepts one of the following:
"cookies"
"none"

GPU DropletsLoad BalancersDroplets

Add Droplets to a Load Balancer
gpu_droplets.load_balancers.droplets.add(strlb_id, DropletAddParams**kwargs)
post/v2/load_balancers/{lb_id}/droplets
Remove Droplets from a Load Balancer
gpu_droplets.load_balancers.droplets.remove(strlb_id, DropletRemoveParams**kwargs)
delete/v2/load_balancers/{lb_id}/droplets

GPU DropletsLoad BalancersForwarding Rules

Add Forwarding Rules to a Load Balancer
gpu_droplets.load_balancers.forwarding_rules.add(strlb_id, ForwardingRuleAddParams**kwargs)
post/v2/load_balancers/{lb_id}/forwarding_rules
Remove Forwarding Rules from a Load Balancer
gpu_droplets.load_balancers.forwarding_rules.remove(strlb_id, ForwardingRuleRemoveParams**kwargs)
delete/v2/load_balancers/{lb_id}/forwarding_rules

GPU DropletsSizes

List All Droplet Sizes
gpu_droplets.sizes.list(SizeListParams**kwargs) -> SizeListResponse
get/v2/sizes

GPU DropletsSnapshots

Delete a Snapshot
gpu_droplets.snapshots.delete(Union[int, str]snapshot_id)
delete/v2/snapshots/{snapshot_id}
List All Snapshots
gpu_droplets.snapshots.list(SnapshotListParams**kwargs) -> SnapshotListResponse
get/v2/snapshots
Retrieve an Existing Snapshot
gpu_droplets.snapshots.retrieve(Union[int, str]snapshot_id) -> SnapshotRetrieveResponse
get/v2/snapshots/{snapshot_id}

GPU DropletsVolumes

Create a New Block Storage Volume
gpu_droplets.volumes.create(VolumeCreateParams**kwargs) -> VolumeCreateResponse
post/v2/volumes
Delete a Block Storage Volume
gpu_droplets.volumes.delete(strvolume_id)
delete/v2/volumes/{volume_id}
Delete a Block Storage Volume by Name
gpu_droplets.volumes.delete_by_name(VolumeDeleteByNameParams**kwargs)
delete/v2/volumes
List All Block Storage Volumes
gpu_droplets.volumes.list(VolumeListParams**kwargs) -> VolumeListResponse
get/v2/volumes
Retrieve an Existing Block Storage Volume
gpu_droplets.volumes.retrieve(strvolume_id) -> VolumeRetrieveResponse
get/v2/volumes/{volume_id}

GPU DropletsVolumesActions

Initiate A Block Storage Action By Volume Id
gpu_droplets.volumes.actions.initiate_by_id(strvolume_id, ActionInitiateByIDParams**kwargs) -> ActionInitiateByIDResponse
post/v2/volumes/{volume_id}/actions
Initiate A Block Storage Action By Volume Name
gpu_droplets.volumes.actions.initiate_by_name(ActionInitiateByNameParams**kwargs) -> ActionInitiateByNameResponse
post/v2/volumes/actions
List All Actions for a Volume
gpu_droplets.volumes.actions.list(strvolume_id, ActionListParams**kwargs) -> ActionListResponse
get/v2/volumes/{volume_id}/actions
Retrieve an Existing Volume Action
gpu_droplets.volumes.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> ActionRetrieveResponse
get/v2/volumes/{volume_id}/actions/{action_id}
ModelsExpand Collapse
class VolumeAction:
resource_id: Optional[int]
type: Optional[str]

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.

GPU DropletsVolumesSnapshots

Create Snapshot from a Volume
gpu_droplets.volumes.snapshots.create(strvolume_id, SnapshotCreateParams**kwargs) -> SnapshotCreateResponse
post/v2/volumes/{volume_id}/snapshots
Delete a Volume Snapshot
gpu_droplets.volumes.snapshots.delete(strsnapshot_id)
delete/v2/volumes/snapshots/{snapshot_id}
List Snapshots for a Volume
gpu_droplets.volumes.snapshots.list(strvolume_id, SnapshotListParams**kwargs) -> SnapshotListResponse
get/v2/volumes/{volume_id}/snapshots
Retrieve an Existing Volume Snapshot
gpu_droplets.volumes.snapshots.retrieve(strsnapshot_id) -> SnapshotRetrieveResponse
get/v2/volumes/snapshots/{snapshot_id}