Create Floating IP
/v2.0/floatingipsCreates a floating IP.
You can obtain the required floating_network_id and subnet_id from a request to GET /v2.0/networks?provider:physical_network=Public.
The status will change to ACTIVE after a while.
Source: create-floating-ip
Request
Parameters
floatingipobjectrequiredA floatingip object. When you associate a floating IP address with a VM, the instance has the same public IP address each time that it boots, basically to maintain a consistent IP address for maintaining DNS assignment.
descriptionstringA human-readable description for the resource. Default is an empty string.
dns_domainstringA valid DNS domain.
dns_namestringA valid DNS name.
tenant_idstringrequiredThe ID of the project.
project_idstringrequiredThe ID of the project.
floating_network_idstringrequiredThe ID of the network associated with the floating IP.
fixed_ip_addressstringThe fixed IP address that is associated with the floating IP. If an internal port has multiple associated IP addresses, the service chooses the first IP address unless you explicitly define a fixed IP address in the fixed_ip_address parameter.
floating_ip_addressstringThe floating IP address.
port_idstringThe ID of a port associated with the floating IP. To associate the floating IP with a fixed IP at creation time, you must specify the identifier of the internal port.
subnet_idstringThe subnet ID on which you want to create the floating IP.
Sample Request
- cURL
- HTTP
curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '{
"floatingip": {
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413"
}
}' https://api.vietnix.cloud:9696/v2.0/floatingips
POST https://api.vietnix.cloud:9696/v2.0/floatingips
Content-Type: application/json
X-Auth-Token: gAAAAA<...>
{
"floatingip": {
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413"
}
}
Response
Response Parameters
floatingipobjectrequiredA floatingip object. When you associate a floating IP address with a VM, the instance has the same public IP address each time that it boots, basically to maintain a consistent IP address for maintaining DNS assignment.
idstringrequiredThe ID of the floating IP address.
router_idstringrequiredThe ID of the router for the floating IP.
statusstringrequiredThe status of the floating IP. Values are ACTIVE, DOWN and ERROR.
descriptionstringrequiredA human-readable description for the resource.
dns_domainstringrequiredA valid DNS domain.
dns_namestringrequiredA valid DNS name.
port_detailsstringrequiredThe information of the port that this floating IP associates with. In particular, if the floating IP is associated with a port, this field contains some attributes of the associated port, including name, network_id, mac_address, admin_state_up, status, device_id and device_owner. If the floating IP is not associated with a port, this field is null.
tenant_idstringrequiredThe ID of the project.
created_atstringrequiredThe date and time when the resource was created. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm±hh. For example, 2015-08-27T09:49:58-05:00. The ±hh value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.
updated_atstringrequiredThe date and time when the resource was updated. If the resource has not been updated, this field will be null. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm±hh. For example, 2015-08-27T09:49:58-05:00. The ±hh value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.
revision_numberintegerrequiredThe revision number of the resource.
project_idstringrequiredThe ID of the project.
floating_network_idstringrequiredThe ID of the network associated with the floating IP.
fixed_ip_addressstringrequiredThe fixed IP address that is associated with the floating IP address.
floating_ip_addressstringrequiredThe floating IP address.
port_idstringrequiredThe ID of a port associated with the floating IP.
tagsarrayrequiredThe list of tags on the resource.
port_forwardingsarrayrequiredThe associated port forwarding resources for the floating IP. If the floating IP has multiple port forwarding resources, this field has multiple entries. Each entry consists of network IP protocol (protocol), the fixed IP address of internal neutron port (internal_ip_address), the TCP or UDP port used by internal neutron port (internal_port) and the TCP or UDP port used by floating IP (external_port).
Sample Response
Response body
{
"floatingip": {
"id": "4f2038c2-bd8d-4c78-b65d-7d19eb96e3b1",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"floating_ip_address": "45.115.16.162",
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413",
"router_id": null,
"port_id": null,
"fixed_ip_address": null,
"status": "DOWN",
"project_id": "f33507157a634f1cac71e06a70fb558e",
"description": "",
"qos_policy_id": null,
"port_details": null,
"tags": [],
"created_at": "2025-09-25T02:02:29Z",
"updated_at": "2025-09-25T02:02:29Z",
"revision_number": 0
}
}
Status Codes
Success
| Status Code | Description |
|---|---|
| 201 - Created | Resource was created and is ready to use. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 404 - Not Found | The requested resource could not be found. |
| 409 - Conflict | This operation conflicted with another operation on this resource. |
Error Details
- 400 - Bad Request may occur if:
- The network is not external (router:external is false).
- The internal networking port is not associated with the floating IP address.
- The requested floating IP address does not fall in the subnet range for the external network.
- The fixed IP address is not valid.
- 404 - Not Found occurs if the
port_idis not valid. - 409 - Conflict may occur if:
- The requested floating IP address is already in use.
- The internal networking port and fixed IP address are already associated with another floating IP.