Update Floating IP
/v2.0/floatingips/{floatingip_id}Assign a port in a private network to an existing floating IP.
To disassociate a floating IP from a port, set the port_id attribute to null or omit it from the request body.
Source: update-floating-ip
Request
Parameters
floatingip_idstringrequiredpathThe ID of the floating IP address.
floatingipobjectrequiredbodyA 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.
descriptionstringbodyA human-readable description for the resource. Default is an empty string.
fixed_ip_addressstringbodyThe 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.
port_idstringrequiredbodyThe ID of a port associated with the floating IP. To associate the floating IP with a fixed IP, you must specify the ID of the internal port. To disassociate the floating IP, null should be specified.
Sample Request
- cURL
- HTTP
curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '{
"floatingip": {
"port_id": "67f24e5f-5a80-4ffd-a841-6c413358be05"
}
}' https://api.vietnix.cloud:9696/v2.0/floatingips/15adb7f5-05ce-4ec0-a146-b4921dcc5b4c
PUT https://api.vietnix.cloud:9696/v2.0/floatingips/15adb7f5-05ce-4ec0-a146-b4921dcc5b4c
Content-Type: application/json
X-Auth-Token: gAAAAA<...>
{
"floatingip": {
"port_id": "67f24e5f-5a80-4ffd-a841-6c413358be05"
}
}
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": "15adb7f5-05ce-4ec0-a146-b4921dcc5b4c",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"floating_ip_address": "45.115.16.163",
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413",
"router_id": "6fea0caa-4922-4f17-a85e-d075c4f678f0",
"port_id": "67f24e5f-5a80-4ffd-a841-6c413358be05",
"fixed_ip_address": "192.168.1.1",
"status": "DOWN",
"description": "",
"qos_policy_id": null,
"port_details": {
"name": "",
"network_id": "42274a58-f901-42d5-bbfa-49535e550270",
"mac_address": "fa:16:3e:9e:6c:37",
"admin_state_up": true,
"status": "ACTIVE",
"device_id": "6fea0caa-4922-4f17-a85e-d075c4f678f0",
"device_owner": "network:router_interface_distributed"
},
"tags": [],
"created_at": "2025-09-25T01:33:46Z",
"updated_at": "2025-09-25T02:15:19Z",
"revision_number": 7,
"project_id": "f33507157a634f1cac71e06a70fb558e"
}
}
Status Codes
Success
| Status Code | Description |
|---|---|
| 200 - OK | Request was successful. |
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. |
| 412 - Precondition Failed | The server does not meet one of the preconditions that the requester put on the request header fields. |
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.