Updated on 2024-01-12 GMT+08:00

Querying Floating IP Addresses

Function

This API is used to query all floating IP addresses accessible to the tenant submitting the request. A maximum of 2000 records can be returned for each query operation. If the number of records exceeds 2000, the pagination marker will be returned. For details, see section Pagination.

You can query the detailed information about a specified floating IP address using the API for Querying a Floating IP Address.

URI

GET /v2.0/floatingips

Table 1 describes the parameters.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

id

No

String

Specifies the floating IP address ID.

floating_ip_address

No

String

Specifies the floating IPv4 address.

floating_network_id

No

String

Specifies the external network ID.

You can only use fixed external network.

You can use GET /v2.0/networks?router:external=True or

GET /v2.0/networks?name={floating_network} or run the neutron net-external-list command to obtain information about the external network.

router_id

No

String

Specifies the ID of the belonged router.

port_id

No

String

Specifies the port ID.

fixed_ip_address

No

String

Specifies the private IP address of the associated port.

tenant_id

No

String

Specifies the project ID.

limit

No

Integer

Specifies the number of records that will be returned on each page. The value is from 0 to intmax (2^31-1). The default value is 2000.

limit can be used together with marker. For details, see the parameter description of marker.

marker

No

String

Specifies a resource ID for pagination query, indicating that the query starts from the next record of the specified resource ID.

This parameter can work together with the parameter limit.

  • If parameters marker and limit are not passed, resource records on the first page will be returned.
  • If the parameter marker is not passed and the value of parameter limit is set to 10, the first 10 resource records will be returned.
  • If the value of the parameter marker is set to the resource ID of the 10th record and the value of parameter limit is set to 10, the 11th to 20th resource records will be returned.
  • If the value of the parameter marker is set to the resource ID of the 10th record and the parameter limit is not passed, resource records starting from the 11th records (including 11th) will be returned.

page_reverse

No

Boolean

Specifies the page direction. The value can be True or False.

Example:

GET https://{Endpoint}/v2.0/floatingips?id={fip_id}&router_id={router_id}&floating_network_id={net_id}&floating_ip_address={floating_ip}&port_id={port_id}&fixed_ip_address={fixed_ip}&tenant_id={tenant_id}

Request Message

None

Response Message

Table 2 Response parameter

Parameter

Type

Description

floatingips

Array of floatingip objects

Specifies the floating IP address list. For details, see Table 3.

floatingips_links

Array of floatingips_link objects

Specifies the floating IP address object list. For details, see Table 4.

Only when limit is used for filtering and the number of resources exceeds the value of limit or 2000 (default value of limit), value next will be returned for rel and a link for href.

Table 3 floatingip objects

Parameter

Type

Description

status

String

Specifies the floating IP address status. The value can be ACTIVE, DOWN, or ERROR.

  • DOWN indicates that the floating IP address has not been bound.
  • ACTIVE indicates that the floating IP address has been bound.
  • ERROR indicates that the floating IP address is abnormal.

id

String

Specifies the floating IP address ID.

project_id

String

Specifies the project ID.

floating_ip_address

String

Specifies the floating IP address.

floating_network_id

String

Specifies the external network ID.

router_id

String

Specifies the ID of the belonged router.

port_id

String

Specifies the port ID.

fixed_ip_address

String

Specifies the private IP address of the associated port.

tenant_id

String

Specifies the project ID.

dns_name

String

Specifies the DNS name.

This parameter is available only in the CN South-Guangzhou region.

dns_domain

String

Specifies the DNS domain.

This parameter is available only in the CN South-Guangzhou region.

created_at

String

Specifies the time when the floating IP address was created.

UTC time is used.

Format: yyyy-MM-ddTHH:mm:ss

updated_at

String

Specifies the time when the floating IP address was updated.

UTC time is used.

Format: yyyy-MM-ddTHH:mm:ss

Table 4 floatingips_link object

Parameter

Type

Description

href

String

Specifies the API link.

rel

String

Specifies the relationship between the API link and the API version.

Example Request

GET https://{Endpoint}/v2.0/floatingips?limit=1

Example Response

Status code: 200

Normal response to the GET operation

{
  "floatingips" : [ {
    "id" : "1a3a2818-d9b4-4a9c-8a19-5252c499d1cd",
    "status" : "DOWN",
    "router_id" : null,
    "tenant_id" : "bbfe8c41dd034a07bebd592bf03b4b0c",
    "project_id" : "bbfe8c41dd034a07bebd592bf03b4b0c",
    "floating_network_id" : "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
    "fixed_ip_address" : null,
    "floating_ip_address" : "99.99.99.84",
    "port_id" : null,
    
    
    "created_at" : "2017-10-19T12:21:28",
    "updated_at" : "2018-07-30T12:52:13"
  } ],
  "floatingips_links" : [ {
    "href" : "https://network.region.cn-test-2.clouds.com/v2.0/floatingips.json?limit=2000&marker=000a6144-5010-46f2-bf06-6a1c94477ea3&page_reverse=true",
    "rel" : "previous"
  }, {
    "href" : "https://network.region.cn-test-2.clouds.com/v2.0/floatingips.json?limit=2000&marker=d445e537-bc81-4039-9c7b-f9c1f5c73c78",
    "rel" : "next"
  } ]
}

Status Code

See Status Codes.

Error Code

See Error Codes.