Skip to main content

floating_ips

Creates, updates, deletes, gets or lists a floating_ips resource.

Overview

Namefloating_ips
TypeResource
Iddigitalocean.network.floating_ips

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called floating_ip. The value of this will be an object that contains the standard attributes associated with a floating IP.

NameDatatypeDescription
project_idstring (uuid)The UUID of the project to which the reserved IP currently belongs.

Requires project:read scope. (example: 746c6152-2fa2-11ed-92d3-27aaa54e4988)
dropletThe 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.
ipstring (ipv4)The public IP address of the floating IP. It also serves as its identifier. (example: 45.55.96.47)
lockedbooleanA boolean value indicating whether or not the floating IP has pending actions preventing new ones from being submitted.
regionobjectThe region that the floating IP is reserved to. When you query a floating IP, the entire region object will be returned.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
floating_ips_getselectfloating_ipTo show information about a floating IP, send a GET request to /v2/floating_ips/$FLOATING_IP_ADDR.
floating_ips_listselectper_page, pageTo list all of the floating IPs available on your account, send a GET request to /v2/floating_ips.
floating_ips_createinsertOn 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.

Note: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds.
floating_ips_deletedeletefloating_ipTo 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

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
floating_ipstring (ipv4)A floating IP address. (example: 45.55.96.47)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

To show information about a floating IP, send a GET request to /v2/floating_ips/$FLOATING_IP_ADDR.

SELECT
project_id,
droplet,
ip,
locked,
region
FROM digitalocean.network.floating_ips
WHERE floating_ip = '{{ floating_ip }}' -- required;

INSERT examples

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.

Note: In addition to the standard rate limiting, only 12 floating IPs may be created per 60 seconds.

INSERT INTO digitalocean.network.floating_ips (

)
SELECT

RETURNING
floating_ip,
links
;

DELETE examples

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.

DELETE FROM digitalocean.network.floating_ips
WHERE floating_ip = '{{ floating_ip }}' --required;