curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/public_reserveip_actions/?project_id=<PROJECT_ID>&apikey=<BASE_URL>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '"{\n \"public_ip\": {{public_ip}},\n \"type\": \"detach\",\n \"vm_id\": {{vm_id}}\n}"'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/public_reserveip_actions/", params={"project_id": "<PROJECT_ID>", "apikey": "<BASE_URL>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json="{\n \"public_ip\": {{public_ip}},\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_reserveip_actions/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<BASE_URL>", location: "<LOCATION>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify("{\n \"public_ip\": {{public_ip}},\n \"type\": \"detach\",\n \"vm_id\": {{vm_id}}\n}"),});console.log(await response.json());curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/public_reserveip_actions/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '"{\n \"public_ip\": {{public_ip}},\n \"type\": \"attach\",\n \"vm_id\": {{vm_id}}\n}"'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/public_reserveip_actions/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json="{\n \"public_ip\": {{public_ip}},\n \"type\": \"attach\",\n \"vm_id\": {{vm_id}}\n}",)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/reserve_ips/public_reserveip_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 \"public_ip\": {{public_ip}},\n \"type\": \"attach\",\n \"vm_id\": {{vm_id}}\n}"),});console.log(await response.json());Detach Public IP and Attach Public IP share this request; the body you send decides which one runs.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>API key used to authorize the detach public IP request
Example
<BASE_URL>E2E Myaccount region where the public IP is located
Example
<LOCATION>Request Body
Section titled “Request Body”JSON-formatted string specifying the public IP to detach, the operation type, and the target VM ID
Example
{ "public_ip": {{public_ip}}, "type": "detach", "vm_id": {{vm_id}}}JSON string containing the attach public IP request payload
Example
{ "public_ip": {{public_ip}}, "type": "attach", "vm_id": {{vm_id}}}Responses
Section titled “Responses”Successful response
object
HTTP status code of the detach operation
object
The public IPv4 address assigned to the detached resource
Indicates the result status of the detach public IP operation
Name of the virtual machine associated with the detach operation
object
Status message indicating the result of the detach public IP operation.
Example
{ "code": 200, "data": { "IP": "1.2.3.4", "status": "", "vm_name": "--" }, "message": "IP Detached Successfully."}