POST
/api/v1/reserve_ips/{public_ip}/actions/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '"{\n \"vm_id\": {{vm_id}},\n \"type\": \"attach\"\n}"'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json="{\n \"vm_id\": {{vm_id}},\n \"type\": \"attach\"\n}",)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify("{\n \"vm_id\": {{vm_id}},\n \"type\": \"attach\"\n}"),});console.log(await response.json());curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '"{\n \"type\": \"detach\",\n \"vm_id\": {{vm_id}}\n}"'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json="{\n \"type\": \"detach\",\n \"vm_id\": {{vm_id}}\n}",)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/{public_ip}/actions/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify("{\n \"type\": \"detach\",\n \"vm_id\": {{vm_id}}\n}"),});console.log(await response.json());Attach AddOn IPv4 and Detach AddOn IPv4 share this request; the body you send decides which one runs.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”public_ip
required
string
Path parameter public_ip.
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>apikey
required
string
API key used to authenticate the request
Example
<API_KEY>location
required
string
Specifies the target location for attaching the IPv4 add-on.
Example
<LOCATION>Request Body
Section titled “Request Body”Responses
Section titled “Responses”Successful response
Media typeapplication/json
object
code
HTTP status code of the response
integer
data
object
IP
IPv4 address of the attached add-on
string
status
Status field
string
vm_name
Name of the virtual machine
string
vm_id
Identifier of the virtual machine
integer
errors
object
message
Status message indicating the result of the IPv4 attachment operation.
string
Example
{ "code": 200, "data": { "IP": "1.2.3.4", "status": "Attached", "vm_name": "C3-8GB-792", "vm_id": 123456 }, "message": "IP assigned Successfully."}