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.
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"droplet_id": 2457247
}
resp = client.reserved_ips.create(body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.
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.
When assigning a reserved IP to a Droplet at same time as it created, the response’s links
object will contain links to both the Droplet and the assignment action. The latter can be used to check the status of the action.
Unauthorized
API Rate limit exceeded
Server error.
Unexpected error