Unassign IP Address from VS

To delete an IP address assignment from a particular VS, you have to remove the IP and rebuild the network. There are two API calls for IP deletion: one unassigns an address, but actually leaves it on a VS, and the second removes the address, rebuilds the network and thus reboots a VS.
To delete an IP address without rebuilding a network:

DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xml
DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.json

XML Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.json

To delete an IP address and rebuild a network:

DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_network=1
DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.json?rebuild_network=1

XML Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_network=1

JSON Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.json?rebuild_network=1

You will get a 204 status response on success, and 404 if there is no such IP address join with a requested ID or you entered incorrect URL.