Skip to main content

floating_ip_actions

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

Overview

Namefloating_ip_actions
TypeResource
Iddigitalocean.network.floating_ip_actions

Fields

The following fields are returned by SELECT queries:

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

NameDatatypeDescription
actionobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
floating_ips_action_getselectfloating_ip, action_idTo retrieve the status of a floating IP action, send a GET request to /v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID.
floating_ips_action_listselectfloating_ipTo retrieve all actions that have been executed on a floating IP, send a GET request to /v2/floating_ips/$FLOATING_IP/actions.
floating_ips_action_postexecfloating_ipTo 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

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
action_idintegerA unique numeric ID that can be used to identify and reference an action. (example: 36804636)
floating_ipstring (ipv4)A floating IP address. (example: 45.55.96.47)

SELECT examples

To retrieve the status of a floating IP action, send a GET request to /v2/floating_ips/$FLOATING_IP/actions/$ACTION_ID.

SELECT
action
FROM digitalocean.network.floating_ip_actions
WHERE floating_ip = '{{ floating_ip }}' -- required
AND action_id = '{{ action_id }}' -- required;

Lifecycle Methods

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

EXEC digitalocean.network.floating_ip_actions.floating_ips_action_post 
@floating_ip='{{ floating_ip }}' --required;