Skip to content
  • Auto
  • Light
  • Dark

GPU Droplets

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) -> metaMetaPropertiesdropletslistlinksPageLinksGPUDropletListResponse
get/v2/droplets
List all Firewalls Applied to a Droplet
gpu_droplets.list_firewalls(intdroplet_id, GPUDropletListFirewallsParams**kwargs) -> metaMetaPropertiesfirewallslistlinksPageLinksGPUDropletListFirewallsResponse
get/v2/droplets/{droplet_id}/firewalls
List All Available Kernels for a Droplet
gpu_droplets.list_kernels(intdroplet_id, GPUDropletListKernelsParams**kwargs) -> metaMetaPropertieskernelslistlinksPageLinksGPUDropletListKernelsResponse
get/v2/droplets/{droplet_id}/kernels
List Neighbors for a Droplet
gpu_droplets.list_neighbors(intdroplet_id) -> dropletslistGPUDropletListNeighborsResponse
get/v2/droplets/{droplet_id}/neighbors
List Snapshots for a Droplet
gpu_droplets.list_snapshots(intdroplet_id, GPUDropletListSnapshotsParams**kwargs) -> metaMetaPropertieslinksPageLinkssnapshotslistGPUDropletListSnapshotsResponse
get/v2/droplets/{droplet_id}/snapshots
Retrieve an Existing Droplet
gpu_droplets.retrieve(intdroplet_id) -> dropletDropletGPUDropletRetrieveResponse
get/v2/droplets/{droplet_id}
Droplet Backup Policy
DropletBackupPolicyclass
ShowShow
hourliteral
optional
Optional[Literal[0, 4, 8, 3 more]]

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

Hide ParametersShow Parameters
0
4
8
12
16
20
planliteral
optional
Optional[Literal["daily", "weekly"]]

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

Hide ParametersShow Parameters
"daily"
"weekly"
retention_period_daysint
optional

The number of days the backup will be retained.

weekdayliteral
optional
Optional[Literal["SUN", "MON", "TUE", 4 more]]

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

Hide ParametersShow Parameters
"SUN"
"MON"
"TUE"
"WED"
"THU"
"FRI"
"SAT"
window_length_hoursint
optional

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) -> ssh_keySSHKeyKeyCreateResponse
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) -> metaMetaPropertieslinksPageLinksssh_keyslistKeyListResponse
get/v2/account/keys
Retrieve an Existing SSH Key
gpu_droplets.account.keys.retrieve(Union[int, str]ssh_key_identifier) -> ssh_keySSHKeyKeyRetrieveResponse
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) -> ssh_keySSHKeyKeyUpdateResponse
put/v2/account/keys/{ssh_key_identifier}

GPU DropletsActions

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

GPU DropletsAutoscale

Create a New Autoscale Pool
gpu_droplets.autoscale.create(AutoscaleCreateParams**kwargs) -> autoscale_poolAutoscalePoolAutoscaleCreateResponse
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) -> metaMetaPropertiesautoscale_poolslistlinksPageLinksAutoscaleListResponse
get/v2/droplets/autoscale
List history events
gpu_droplets.autoscale.list_history(strautoscale_pool_id, AutoscaleListHistoryParams**kwargs) -> metaMetaPropertieshistorylistlinksPageLinksAutoscaleListHistoryResponse
get/v2/droplets/autoscale/{autoscale_pool_id}/history
List members
gpu_droplets.autoscale.list_members(strautoscale_pool_id, AutoscaleListMembersParams**kwargs) -> metaMetaPropertiesdropletslistlinksPageLinksAutoscaleListMembersResponse
get/v2/droplets/autoscale/{autoscale_pool_id}/members
Retrieve an Existing Autoscale Pool
gpu_droplets.autoscale.retrieve(strautoscale_pool_id) -> autoscale_poolAutoscalePoolAutoscaleRetrieveResponse
get/v2/droplets/autoscale/{autoscale_pool_id}
Update Autoscale Pool
gpu_droplets.autoscale.update(strautoscale_pool_id, AutoscaleUpdateParams**kwargs) -> autoscale_poolAutoscalePoolAutoscaleUpdateResponse
put/v2/droplets/autoscale/{autoscale_pool_id}
Autoscale Pool
AutoscalePoolclass
ShowShow
idstr

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

active_resources_countint

The number of active Droplets in the autoscale pool.

configConfig

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

Hide ParametersShow Parameters
target_number_instancesintAutoscalePoolStaticConfig
max_instancesintmin_instancesintcooldown_minutesinttarget_cpu_utilizationfloattarget_memory_utilizationfloatAutoscalePoolDynamicConfig
created_atdatetime

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

formatdate-time
droplet_templateimagestrregionliteralsizestrssh_keyslistipv6boolnamestrproject_idstrtagslistuser_datastrvpc_uuidstrwith_droplet_agentboolAutoscalePoolDropletTemplate
namestr

The human-readable name set for the autoscale pool.

statusliteral
Literal["active", "deleting", "error"]

The current status of the autoscale pool.

Hide ParametersShow Parameters
"active"
"deleting"
"error"
updated_atdatetime

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

formatdate-time
current_utilizationCurrentUtilization
optional
Autoscale Pool Droplet Template
AutoscalePoolDropletTemplateclass
ShowShow
imagestr

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

regionliteral
Literal["nyc1", "nyc2", "nyc3", 11 more]

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

Hide ParametersShow Parameters
"nyc1"
"nyc2"
"nyc3"
"ams2"
"ams3"
"sfo1"
"sfo2"
"sfo3"
"sgp1"
"lon1"
"fra1"
"tor1"
"blr1"
"syd1"
sizestr

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

ssh_keyslist
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.

ipv6bool
optional

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

namestr
optional

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

project_idstr
optional

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

tagslist
optional
Optional[List[str]]

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

user_datastr
optional

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_uuidstr
optional

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_agentbool
optional

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

Autoscale Pool Dynamic Config
AutoscalePoolDynamicConfigclass
ShowShow
max_instancesint

The maximum number of Droplets in an autoscale pool.

minimum1
maximum1000
min_instancesint

The minimum number of Droplets in an autoscale pool.

minimum1
maximum500
cooldown_minutesint
optional

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

minimum5
maximum20
target_cpu_utilizationfloat
optional

Target CPU utilization as a decimal.

formatfloat
minimum0.05
maximum1
target_memory_utilizationfloat
optional

Target memory utilization as a decimal.

formatfloat
minimum0.05
maximum1
Autoscale Pool Static Config
AutoscalePoolStaticConfigclass
ShowShow
target_number_instancesint

Fixed number of instances in an autoscale pool.

minimum1
maximum1000
Current Utilization
CurrentUtilizationclass
ShowShow
cpufloat
optional

The average CPU utilization of the autoscale pool.

formatfloat
minimum0
maximum1
memoryfloat
optional

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) -> metaMetaPropertiesbackupslistlinksPageLinksBackupListResponse
get/v2/droplets/{droplet_id}/backups
List Backup Policies for All Existing Droplets
gpu_droplets.backups.list_policies(BackupListPoliciesParams**kwargs) -> metaMetaPropertieslinksPageLinkspoliciesDict[str, Policies]BackupListPoliciesResponse
get/v2/droplets/backups/policies
List Supported Droplet Backup Policies
gpu_droplets.backups.list_supported_policies() -> supported_policieslistBackupListSupportedPoliciesResponse
get/v2/droplets/backups/supported_policies
Retrieve the Backup Policy for an Existing Droplet
gpu_droplets.backups.retrieve_policy(intdroplet_id) -> policyPolicyBackupRetrievePolicyResponse
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) -> completed_atdatetimedropletDestroyedAssociatedResourcefailuresintresourcesResourcesDestroyWithAssociatedResourceCheckStatusResponse
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) -> floating_ipslistreserved_ipslistsnapshotslistvolume_snapshotslistvolumeslistDestroyWithAssociatedResourceListResponse
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
Associated Resource
AssociatedResourceclass

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

ShowShow
idstr
optional

The unique identifier for the resource associated with the Droplet.

coststr
optional

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

namestr
optional

The name of the resource associated with the Droplet.

Destroyed Associated Resource
DestroyedAssociatedResourceclass

An object containing information about a resource scheduled for deletion.

ShowShow
idstr
optional

The unique identifier for the resource scheduled for deletion.

destroyed_atdatetime
optional

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_messagestr
optional

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

namestr
optional

The name of the resource scheduled for deletion.

GPU DropletsFirewalls

Create a New Firewall
gpu_droplets.firewalls.create(FirewallCreateParams**kwargs) -> firewallFirewallFirewallCreateResponse
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) -> metaMetaPropertiesfirewallslistlinksPageLinksFirewallListResponse
get/v2/firewalls
Retrieve an Existing Firewall
gpu_droplets.firewalls.retrieve(strfirewall_id) -> firewallFirewallFirewallRetrieveResponse
get/v2/firewalls/{firewall_id}
Update a Firewall
gpu_droplets.firewalls.update(strfirewall_id, FirewallUpdateParams**kwargs) -> firewallFirewallFirewallUpdateResponse
put/v2/firewalls/{firewall_id}
Firewall
Firewallclass
ShowShow
idstr
optional

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

created_atdatetime
optional

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

formatdate-time
droplet_idslist
optional
Optional[List[int]]

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

Requires droplet:read scope.

inbound_ruleslist
optional
Optional[List[InboundRule]]
Hide ParametersShow Parameters
portsstr

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".

protocolliteral
Literal["tcp", "udp", "icmp"]

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

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
sourcesaddresseslistdroplet_idslistkubernetes_idslistload_balancer_uidslisttagslistFirewallRuleTarget

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

namestr
optional

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_ruleslist
optional
Optional[List[OutboundRule]]
Hide ParametersShow Parameters
destinationsaddresseslistdroplet_idslistkubernetes_idslistload_balancer_uidslisttagslistFirewallRuleTarget

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

portsstr

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".

protocolliteral
Literal["tcp", "udp", "icmp"]

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

Hide ParametersShow Parameters
"tcp"
"udp"
"icmp"
pending_changeslist
optional
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.

Hide ParametersShow Parameters
droplet_idint
optional
removingbool
optional
statusstr
optional
statusliteral
optional
Optional[Literal["waiting", "succeeded", "failed"]]

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

Hide ParametersShow Parameters
"waiting"
"succeeded"
"failed"
tagslist
optional
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) -> floating_ipFloatingIPlinksLinksFloatingIPCreateResponse
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) -> metaMetaPropertiesfloating_ipslistlinksPageLinksFloatingIPListResponse
get/v2/floating_ips
Retrieve an Existing Floating IP
gpu_droplets.floating_ips.retrieve(strfloating_ip) -> floating_ipFloatingIPFloatingIPRetrieveResponse
get/v2/floating_ips/{floating_ip}
Floating IP
FloatingIPclass
ShowShow
dropletDropletNullobjectDroplet
optional

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.

Hide ParametersShow Parameters
idintbackup_idslistcreated_atdatetimediskintfeatureslistimageImagelockedboolmemoryintnamestrnetworksNetworksnext_backup_windowDropletNextBackupWindowregionRegionsizeSizesize_slugstrsnapshot_idsliststatusliteraltagslistvcpusintvolume_idslistdisk_infolistgpu_infoGPUInfokernelKernelvpc_uuidstrDroplet
DropletNulltype
Optional[object]

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

ipstr
optional

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

formatipv4
lockedbool
optional

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

project_idstr
optional

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

Requires project:read scope.

formatuuid
regionRegion
optional

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) -> actionActionActionCreateResponse
post/v2/floating_ips/{floating_ip}/actions
List All Actions for a Floating IP
gpu_droplets.floating_ips.actions.list(strfloating_ip) -> metaMetaPropertiesactionslistlinksPageLinksActionListResponse
get/v2/floating_ips/{floating_ip}/actions
Retrieve an Existing Floating IP Action
gpu_droplets.floating_ips.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> actionActionActionRetrieveResponse
get/v2/floating_ips/{floating_ip}/actions/{action_id}

GPU DropletsImages

Create a Custom Image
gpu_droplets.images.create(ImageCreateParams**kwargs) -> imageImageImageCreateResponse
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) -> imageslistmetaMetaPropertieslinksPageLinksImageListResponse
get/v2/images
Retrieve an Existing Image
gpu_droplets.images.retrieve(Union[int, str]image_id) -> imageImageImageRetrieveResponse
get/v2/images/{image_id}
Update an Image
gpu_droplets.images.update(intimage_id, ImageUpdateParams**kwargs) -> imageImageImageUpdateResponse
put/v2/images/{image_id}

GPU DropletsImagesActions

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

GPU DropletsLoad Balancers

Create a New Load Balancer
gpu_droplets.load_balancers.create(LoadBalancerCreateParams**kwargs) -> load_balancerLoadBalancerLoadBalancerCreateResponse
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) -> metaMetaPropertieslinksPageLinksload_balancerslistLoadBalancerListResponse
get/v2/load_balancers
Retrieve an Existing Load Balancer
gpu_droplets.load_balancers.retrieve(strlb_id) -> load_balancerLoadBalancerLoadBalancerRetrieveResponse
get/v2/load_balancers/{lb_id}
Update a Load Balancer
gpu_droplets.load_balancers.update(strlb_id, LoadBalancerUpdateParams**kwargs) -> load_balancerLoadBalancerLoadBalancerUpdateResponse
put/v2/load_balancers/{lb_id}
Domains
Domainsclass

An object specifying domain configurations for a Global load balancer.

ShowShow
certificate_idstr
optional

The ID of the TLS certificate used for SSL termination.

is_managedbool
optional

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.

namestr
optional

FQDN to associate with a Global load balancer.

Forwarding Rule
ForwardingRuleclass

An object specifying a forwarding rule for a load balancer.

ShowShow
entry_portint

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

entry_protocolliteral
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.

Hide ParametersShow Parameters
"http"
"https"
"http2"
"http3"
"tcp"
"udp"
target_portint

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

target_protocolliteral
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.

Hide ParametersShow Parameters
"http"
"https"
"http2"
"tcp"
"udp"
certificate_idstr
optional

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

tls_passthroughbool
optional

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

Glb Settings
GlbSettingsclass

An object specifying forwarding configurations for a Global load balancer.

ShowShow
cdnis_enabledboolCdn
optional

An object specifying CDN configurations for a Global load balancer.

Hide ParametersShow Parameters
is_enabledbool
optional

A boolean flag to enable CDN caching.

failover_thresholdint
optional

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_prioritiesDict[str, int]
optional
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_portint
optional

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

target_protocolliteral
optional
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.

Hide ParametersShow Parameters
"http"
"https"
"http2"
Health Check
HealthCheckclass

An object specifying health check settings for the load balancer.

ShowShow
check_interval_secondsint
optional

The number of seconds between between two consecutive health checks.

healthy_thresholdint
optional

The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool.

pathstr
optional

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

portint
optional

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

protocolliteral
optional
Optional[Literal["http", "https", "tcp"]]

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

Hide ParametersShow Parameters
"http"
"https"
"tcp"
response_timeout_secondsint
optional

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

unhealthy_thresholdint
optional

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
LbFirewallclass

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

ShowShow
allowlist
optional
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')

denylist
optional
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')

Load Balancer
LoadBalancerclass
ShowShow
forwarding_ruleslist
List[entry_portintentry_protocolliteraltarget_portinttarget_protocolliteralcertificate_idstrtls_passthroughboolForwardingRule]

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

Hide ParametersShow Parameters
entry_portint

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

entry_protocolliteral
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.

Hide ParametersShow Parameters
"http"
"https"
"http2"
"http3"
"tcp"
"udp"
target_portint

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

target_protocolliteral
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.

Hide ParametersShow Parameters
"http"
"https"
"http2"
"tcp"
"udp"
certificate_idstr
optional

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

tls_passthroughbool
optional

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

idstr
optional

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

formatuuid
algorithmliteral
optional
deprecated
Optional[Literal["round_robin", "least_connections"]]

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

Hide ParametersShow Parameters
"round_robin"
"least_connections"
created_atdatetime
optional

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_recordsbool
optional

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

domainslist
optional
Optional[List[certificate_idstris_managedboolnamestrDomains]]

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

Hide ParametersShow Parameters
certificate_idstr
optional

The ID of the TLS certificate used for SSL termination.

is_managedbool
optional

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.

namestr
optional

FQDN to associate with a Global load balancer.

droplet_idslist
optional
Optional[List[int]]

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

enable_backend_keepalivebool
optional

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

enable_proxy_protocolbool
optional

A boolean value indicating whether PROXY Protocol is in use.

firewallLbFirewall
optional

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

glb_settingsGlbSettings
optional

An object specifying forwarding configurations for a Global load balancer.

health_checkHealthCheck
optional

An object specifying health check settings for the load balancer.

http_idle_timeout_secondsint
optional

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

minimum30
maximum600
ipstr
optional

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

ipv6str
optional

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

namestr
optional

A human-readable name for a load balancer instance.

networkliteral
optional
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.

Hide ParametersShow Parameters
"EXTERNAL"
"INTERNAL"
network_stackliteral
optional
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.

Hide ParametersShow Parameters
"IPV4"
"DUALSTACK"
project_idstr
optional

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_httpsbool
optional

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

regionRegion
optional

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.

sizeliteral
optional
deprecated
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.

Hide ParametersShow Parameters
"lb-small"
"lb-medium"
"lb-large"
size_unitint
optional

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
statusliteral
optional
Optional[Literal["new", "active", "errored"]]

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

Hide ParametersShow Parameters
"new"
"active"
"errored"
sticky_sessionsStickySessions
optional

An object specifying sticky sessions settings for the load balancer.

tagstr
optional

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

target_load_balancer_idslist
optional
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_policyliteral
optional
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.

Hide ParametersShow Parameters
"DEFAULT"
"STRONG"
typeliteral
optional
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.

Hide ParametersShow Parameters
"REGIONAL"
"REGIONAL_NETWORK"
"GLOBAL"
vpc_uuidstr
optional

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

formatuuid
Sticky Sessions
StickySessionsclass

An object specifying sticky sessions settings for the load balancer.

ShowShow
typeliteral
optional
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.

Hide ParametersShow Parameters
"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) -> metaMetaPropertiessizeslistlinksPageLinksSizeListResponse
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) -> metaMetaPropertieslinksPageLinkssnapshotslistSnapshotListResponse
get/v2/snapshots
Retrieve an Existing Snapshot
gpu_droplets.snapshots.retrieve(Union[int, str]snapshot_id) -> snapshotSnapshotsSnapshotRetrieveResponse
get/v2/snapshots/{snapshot_id}

GPU DropletsVolumes

Create a New Block Storage Volume
gpu_droplets.volumes.create(VolumeCreateParams**kwargs) -> volumeVolumeVolumeCreateResponse
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) -> metaMetaPropertiesvolumeslistlinksPageLinksVolumeListResponse
get/v2/volumes
Retrieve an Existing Block Storage Volume
gpu_droplets.volumes.retrieve(strvolume_id) -> volumeVolumeVolumeRetrieveResponse
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) -> actionVolumeActionActionInitiateByIDResponse
post/v2/volumes/{volume_id}/actions
Initiate A Block Storage Action By Volume Name
gpu_droplets.volumes.actions.initiate_by_name(ActionInitiateByNameParams**kwargs) -> actionVolumeActionActionInitiateByNameResponse
post/v2/volumes/actions
List All Actions for a Volume
gpu_droplets.volumes.actions.list(strvolume_id, ActionListParams**kwargs) -> metaMetaPropertiesactionslistlinksPageLinksActionListResponse
get/v2/volumes/{volume_id}/actions
Retrieve an Existing Volume Action
gpu_droplets.volumes.actions.retrieve(intaction_id, ActionRetrieveParams**kwargs) -> actionVolumeActionActionRetrieveResponse
get/v2/volumes/{volume_id}/actions/{action_id}
Volume Action
VolumeActionclass
ShowShow
resource_idint
optional
typestr
optional

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) -> snapshotSnapshotsSnapshotCreateResponse
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) -> metaMetaPropertieslinksPageLinkssnapshotslistSnapshotListResponse
get/v2/volumes/{volume_id}/snapshots
Retrieve an Existing Volume Snapshot
gpu_droplets.volumes.snapshots.retrieve(strsnapshot_id) -> snapshotSnapshotsSnapshotRetrieveResponse
get/v2/volumes/snapshots/{snapshot_id}