Updating floating IPs

PUT /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: https://docs.openstack.org/api-ref/network/v2/index.html?expanded=update-floating-ip-detail#update-floating-ip

Request

Parameters

Name In Type Description
floatingip_id path string The ID of the floating IP address.
floatingip body object A 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.
description (Optional) body string A human-readable description for the resource. Default is an empty string.
fixed_ip_address (Optional) body string The 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_id body string

The 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.

Example

# curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '
{
  "floatingip": {
    "port_id": "fb0e8e3e-2a71-420a-885c-94f6d2c2f2b7"
  }
}' https://<node_IP_addr>:9696/v2.0/floatingips/88c1ba84-7acf-4d6f-9f6e-85db1cafa906

Response

Parameters

Name In Type Description
floatingip body object A 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.
id body string The ID of the floating IP address.
router_id body string The ID of the router for the floating IP.
status body string The status of the floating IP. Values are ACTIVE, DOWN and ERROR.
description body string A human-readable description for the resource.
dns_domain body string A valid DNS domain.
dns_name body string A valid DNS name.
port_details body string The 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_id body string The ID of the project.
created_at body string

The date and time when the resource was created.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

updated_at body string

The 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:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

revision_number body integer The revision number of the resource.
project_id body string The ID of the project.
floating_network_id body string The ID of the network associated with the floating IP.
fixed_ip_address body string The fixed IP address that is associated with the floating IP address.
floating_ip_address body string The floating IP address.
port_id body string

The ID of a port associated with the floating IP.

tags body array The list of tags on the resource.
port_forwardings body array The 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).

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
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.

Example

{
  "floatingip": {
    "router_id": "10349fb6-1104-4275-b571-e65e26301740",
    "status": "DOWN",
    "description": "",
    "tags": [],
    "tenant_id": "05341a23f649427baa2fd4039b7f378f",
    "created_at": "2020-03-19T10:39:01Z",
    "updated_at": "2020-03-20T13:17:07Z",
    "floating_network_id": "02ed0e3e-6272-4f50-9780-69c211b3a091",
    "port_details": {
      "status": "DOWN",
      "name": "octavia-lb-6a4e1daf-2277-43aa-bd03-1eca6dfe9df1",
      "admin_state_up": false,
      "network_id": "15f7dc0a-712c-422f-bfd3-31dc351d9026",
      "device_owner": "Octavia",
      "mac_address": "fa:16:3e:00:1d:f7",
      "device_id": "lb-6a4e1daf-2277-43aa-bd03-1eca6dfe9df1"
    },
    "fixed_ip_address": "192.168.10.5",
    "floating_ip_address": "10.94.129.67",
    "revision_number": 9,
    "project_id": "05341a23f649427baa2fd4039b7f378f",
    "port_id": "fb0e8e3e-2a71-420a-885c-94f6d2c2f2b7",
    "id": "88c1ba84-7acf-4d6f-9f6e-85db1cafa906"
  }
}