Skip to content

Floating IP API reference

See https://docs.openstack.org/api-ref/network/.

In these methods, {floating_ip_id} is the ID of the floating IP, {server_id} is the ID of the instance, and "floating_ip_address" is the actual floating IP address. These endpoints allow you to list available floating IPs, allocate new floating IPs from a pool, associate and disassociate floating IPs with instances, and release floating IPs when they are no longer needed.

List floating IPs

Bash
GET /os-floating-ips

Show floating IP details

Bash
GET /os-floating-ips/{floating_ip_id}

Allocate a floating IP

Bash
POST /os-floating-ips

Request body

JSON
{
 "pool": "public"
}

  • The "pool" attribute specifies the name of the floating IP pool from which to allocate the IP.

Associate a floating IP with an instance

Bash
POST /servers/{server_id}/action

Request body

JSON
{
 "addFloatingIp": {
   "address": "floating_ip_address"
 }
}

  • {server_id} is the ID of the instance, and "address" is the floating IP address to associate.

Disassociate a floating IP from an instance

Bash
POST /servers/{server_id}/action

Request body

JSON
{
 "removeFloatingIp": {
   "address": "floating_ip_address"
 }
}

Release a floating IP

Bash
DELETE /os-floating-ips/{floating_ip_id}