doc-exports/docs/vpc/api-ref/vpc_floatingiP_0003.html
Qin Ying, Fan 7e6f07b803 VPC API 20240320 version
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com>
Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
2024-09-05 12:25:23 +00:00

21 KiB

Assigning a Floating IP Address

Function

When assigning a floating IP address, you need to obtain the external network ID floating_network_id of the floating IP address.

You can use GET /v2.0/networks?router:external=True or run the neutron net-external-list command to obtain the UUID of the external network required for assigning a floating IP address.

Note the following when you use EIPs of the Dedicated Load Balancer (5_gray) type:
  • In eu-de, no more new EIPs of this type can be assigned. You can assign EIPs of the BGP (5_bgp) type.
  • Existing EIPs of the Dedicated Load Balancer (5_gray) type can be bound to dedicated or shared load balancers.
    • The EIP console cannot be used to bind EIPs to or unbind them from dedicated load balancers.
    • You can use APIs to bind EIPs to or unbind them from dedicated load balancers. For details, see Binding an EIP and Unbinding an EIP.
    • EIPs of this type can be bound to or unbound from shared load balancers using the EIP console or APIs.
    • You are advised to bind or unbind BGP EIPs to or from dedicated load balancers.
  • 5_gray EIPs cannot be added to the same shared bandwidth as EIPs of other types. If they are in the same shared bandwidth, the bandwidth limit settings will not take effect.

URI

POST /v2.0/floatingips

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

floatingip

floatingip object

Yes

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

Table 2 floatingip objects

Parameter

Mandatory

Type

Description

floating_ip_address

No

String

Specifies the floating IP address.

floating_network_id

Yes

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 mode command to obtain information about the external network.

port_id

No

String

Specifies the port ID.

fixed_ip_address

No

String

Specifies the private IP address of the associated port.

Response Message

Table 3 Response parameter

Parameter

Type

Description

floatingip

floatingip object

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

Table 4 floatingip objects

Attribute

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.

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.

dns_domain

String

Specifies the DNS domain.

Example Request

Create a floating IP address whose network is 0a2228f2-7f8a-45f1-8e09-9039e1d09975.

POST https://{Endpoint}/v2.0/floatingips 

{
    "floatingip": {
           "floating_network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975"
    }
}

Example Response

Status code: 201

Normal response to POST requests

{
    "floatingip": {
        "id": "b997e0d4-3359-4c74-8f88-bc0af81cd5a2",
        "status": "DOWN",
        "router_id": null,
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "floating_network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
        "fixed_ip_address": null,
        "floating_ip_address": "88.88.215.205",
        "port_id": null,
        "dns_name": "ecs-80-158-78-239",
        "dns_domain": "reverse.domain-name.com"
    }
}

Status Code

See Status Codes.

Error Code

See Error Codes.