• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Floating IPs
  6. Creating a Floating IP Address

Creating a Floating IP Address

Function Description

This interface is used to create a floating IP address.

URI

  • URI format

    POST /v2/{tenant_id}/os-floating-ips

    POST /v2.1/{tenant_id}/os-floating-ips

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Restrictions

Users need to obtain a network resource pool that provides floating IP addresses. You can run GET /v2.0/networks?router:external=True or neutron net-external-list to obtain a network resource pool.

This interface will become invalid from micro version 2.36. Since this version, the system will return error 404 when you invoke this interface. Using the corresponding network service interface is recommended.

Request

Parameter

Type

Mandatory

Description

tenant_id

String

Yes

Specifies the tenant ID specified in the URI.

The value is in UUID format.

pool

String

No

Specifies the network resource pool that provides floating IP addresses. If it is not specified, the default resource pool is used.

Response

Parameter

Type

Mandatory

Description

floating_ip

Dict

Yes

Specifies the floating IP address. For details, see Table 1.

Table 1 floating_ip objects

Parameter

Type

Mandatory

Description

fixed_ip

String

Yes

Specifies a private IP address.

id

String

Yes

Specifies the floating IP address ID in UUID format.

instance_id

String

Yes

Specifies the ID of the bound ECS in UUID format.

ip

String

Yes

Specifies the floating IP address.

pool

String

Yes

Specifies the name of the network resource pool that provides floating IP addresses.

Request Example

POST /v2/e73621affb8f44e1bc01898747ca09d4/os-floating-ips
POST /v2.1/e73621affb8f44e1bc01898747ca09d4/os-floating-ips
{
"pool": "external"
}

Response Example

{
  "floating_ip": {
    "id": "7aa2aa63-3097-4cfe-a2e4-596c301d3b1b",
    "pool": "external",
    "ip": "10.154.53.184",
    "fixed_ip": null,
    "instance_id": null
  }
}

Returned Values

See General Request Returned Values.