reserved_ips
Creates, updates, deletes, gets or lists a reserved_ips resource.
Overview
| Name | reserved_ips |
| Type | Resource |
| Id | digitalocean.compute.reserved_ips |
Fields
The following fields are returned by SELECT queries:
- reserved_ips_get
- reserved_ips_list
The response will be a JSON object with a key called reserved_ip. The value of this will be an object that contains the standard attributes associated with a reserved IP.
| Name | Datatype | Description |
|---|---|---|
project_id | string (uuid) | The UUID of the project to which the reserved IP currently belongs. Requires project:read scope. (example: 746c6152-2fa2-11ed-92d3-27aaa54e4988) |
droplet | | The Droplet that the reserved IP has been assigned to. When you query a reserved 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. |
ip | string (ipv4) | The public IP address of the reserved IP. It also serves as its identifier. (example: 45.55.96.47) |
locked | boolean | A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted. |
region | object | The region that the reserved IP is reserved to. When you query a reserved IP, the entire region object will be returned. |
The response will be a JSON object with a key called reserved_ips. This will be set to an array of reserved IP objects, each of which will contain the standard reserved IP attributes
| Name | Datatype | Description |
|---|---|---|
project_id | string (uuid) | The UUID of the project to which the reserved IP currently belongs. Requires project:read scope. (example: 746c6152-2fa2-11ed-92d3-27aaa54e4988) |
droplet | | The Droplet that the reserved IP has been assigned to. When you query a reserved 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. |
ip | string (ipv4) | The public IP address of the reserved IP. It also serves as its identifier. (example: 45.55.96.47) |
locked | boolean | A boolean value indicating whether or not the reserved IP has pending actions preventing new ones from being submitted. |
region | object | The region that the reserved IP is reserved to. When you query a reserved IP, the entire region object will be returned. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
reserved_ips_get | select | reserved_ip | To show information about a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP_ADDR. | |
reserved_ips_list | select | per_page, page | To list all of the reserved IPs available on your account, send a GET request to /v2/reserved_ips. | |
reserved_ips_create | insert | data__droplet_id | On creation, a reserved IP must be either assigned to a Droplet or reserved to a region. * To create a new reserved IP assigned to a Droplet, send a POST request to /v2/reserved_ips with the droplet_id attribute.* To create a new reserved IP reserved to a region, send a POST request to /v2/reserved_ips with the region attribute.Note: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds. | |
reserved_ips_delete | delete | reserved_ip | To delete a reserved IP and remove it from your account, send a DELETE request to /v2/reserved_ips/$RESERVED_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.
| Name | Datatype | Description |
|---|---|---|
reserved_ip | string (ipv4) | A reserved IP address. (example: 45.55.96.47) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT examples
- reserved_ips_get
- reserved_ips_list
To show information about a reserved IP, send a GET request to /v2/reserved_ips/$RESERVED_IP_ADDR.
SELECT
project_id,
droplet,
ip,
locked,
region
FROM digitalocean.compute.reserved_ips
WHERE reserved_ip = '{{ reserved_ip }}' -- required
;
To list all of the reserved IPs available on your account, send a GET request to /v2/reserved_ips.
SELECT
project_id,
droplet,
ip,
locked,
region
FROM digitalocean.compute.reserved_ips
WHERE per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- reserved_ips_create
- Manifest
On creation, a reserved IP must be either assigned to a Droplet or reserved to a region.
* To create a new reserved IP assigned to a Droplet, send a POST
request to /v2/reserved_ips with the droplet_id attribute.
* To create a new reserved IP reserved to a region, send a POST request to
/v2/reserved_ips with the region attribute.
Note: In addition to the standard rate limiting, only 12 reserved IPs may be created per 60 seconds.
INSERT INTO digitalocean.compute.reserved_ips (
data__droplet_id
)
SELECT
{{ droplet_id }} /* required */
RETURNING
links,
reserved_ip
;
# Description fields are for documentation purposes
- name: reserved_ips
props:
- name: droplet_id
value: integer
description: >
The ID of the Droplet that the reserved IP will be assigned to.
DELETE examples
- reserved_ips_delete
To delete a reserved IP and remove it from your account, send a DELETE request
to /v2/reserved_ips/$RESERVED_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.compute.reserved_ips
WHERE reserved_ip = '{{ reserved_ip }}' --required
;