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 |
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
reserved_ip |
string | True | A reserved IP address. | |
body |
JSON or IO[bytes] | False | The type attribute set in the request body will specify the action that |
|
will be taken on the reserved IP. | ||||
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req={
"type": "unassign"
}
resp = client.reserved_ips_actions.post(reserved_ip="49.32.13.21", body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.