reserved_ip_actions
Creates, updates, deletes, gets or lists a reserved_ip_actions
resource.
Overview
Name | reserved_ip_actions |
Type | Resource |
Id | digitalocean.compute.reserved_ip_actions |
Fields
The following fields are returned by SELECT
queries:
- reserved_ips_actions_get
- reserved_ips_actions_list
The response will be an object with a key called action
. The value of this will be an object that contains the standard reserved IP action attributes.
Name | Datatype | Description |
---|---|---|
action | object |
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 reserved IP action attributes.
Name | Datatype | Description |
---|---|---|
id | integer | A unique numeric ID that can be used to identify and reference an action. |
resource_id | integer | A unique identifier for the resource that the action is associated with. |
completed_at | string (date-time) | A time value given in ISO8601 combined date and time format that represents when the action was completed. (example: 2020-11-14T16:30:06Z) |
region | object | |
region_slug | string | A human-readable string that is used as a unique identifier for each region. (example: nyc3) |
resource_type | string | The type of resource that the action is associated with. (example: droplet) |
started_at | string (date-time) | A time value given in ISO8601 combined date and time format that represents when the action was initiated. (example: 2020-11-14T16:29:21Z) |
status | string | The current status of the action. This can be "in-progress", "completed", or "errored". (example: completed, default: in-progress) |
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: create) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
reserved_ips_actions_get | select | reserved_ip , action_id | To retrieve the status of a reserved IP action, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID . | |
reserved_ips_actions_list | select | reserved_ip | To retrieve all actions that have been executed on a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions . | |
reserved_ips_actions_post | exec | reserved_ip | To initiate an action on a reserved IP send a POST request to/v2/reserved_ips/$RESERVED_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 reserved IP to a Droplet| unassign | Unassign a reserved 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.
Name | Datatype | Description |
---|---|---|
action_id | integer | A unique numeric ID that can be used to identify and reference an action. (example: 36804636) |
reserved_ip | string (ipv4) | A reserved IP address. (example: 45.55.96.47) |
SELECT
examples
- reserved_ips_actions_get
- reserved_ips_actions_list
To retrieve the status of a reserved IP action, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions/$ACTION_ID
.
SELECT
action
FROM digitalocean.compute.reserved_ip_actions
WHERE reserved_ip = '{{ reserved_ip }}' -- required
AND action_id = '{{ action_id }}' -- required;
To retrieve all actions that have been executed on a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP/actions
.
SELECT
id,
resource_id,
completed_at,
region,
region_slug,
resource_type,
started_at,
status,
type
FROM digitalocean.compute.reserved_ip_actions
WHERE reserved_ip = '{{ reserved_ip }}' -- required;
Lifecycle Methods
- reserved_ips_actions_post
To initiate an action on a reserved IP send a POST request to/v2/reserved_ips/$RESERVED_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 reserved IP to a Droplet
| unassign
| Unassign a reserved IP from a Droplet
EXEC digitalocean.compute.reserved_ip_actions.reserved_ips_actions_post
@reserved_ip='{{ reserved_ip }}' --required;