POST
/
cloud
/
v1
/
floatingips
/
{project_id}
/
{region_id}
/
{floating_ip_id}
/
assign
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
floating_ip = client.cloud.floating_ips.assign(
    floating_ip_id="floating_ip_id",
    project_id=0,
    region_id=0,
    port_id="ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
)
print(floating_ip.id)
{
  "created_at": "2019-06-13T13:58:12+0000",
  "creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
  "dns_domain": "string",
  "dns_name": "string",
  "fixed_ip_address": "192.168.10.15",
  "floating_ip_address": "172.24.4.34",
  "id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
  "port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
  "project_id": 1337,
  "region": "Luxembourg 1",
  "region_id": 7,
  "router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
  "status": "ACTIVE",
  "subnet_id": null,
  "tags": [
    {
      "key": "my-tag",
      "read_only": false,
      "value": "my-tag-value"
    }
  ],
  "task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
  "updated_at": "2019-06-13T13:58:12+0000"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

floating_ip_id
string
required

Floating IP ID

Body

application/json
port_id
string<uuid4>
required

Port ID

Examples:

"ee2402d0-f0cd-4503-9b75-69be1d11c5f1"

fixed_ip_address
string<ipvanyaddress> | null

Fixed IP address

Examples:

"192.168.10.15"

Response

Updated floating IP details

created_at
string<date-time>
required

Datetime when the floating IP was created

Examples:

"2019-06-13T13:58:12+0000"

creator_task_id
string<uuid4> | null
required

Task that created this entity

Examples:

"d1e1500b-e2be-40aa-9a4b-cc493fa1af30"

dns_domain
string | null
required
deprecated

This field is deprecated and can be ignored

Examples:

"string"

dns_name
string | null
required
deprecated

This field is deprecated and can be ignored

Examples:

"string"

fixed_ip_address
string<ipvanyaddress> | null
required

IP address of the port the floating IP is attached to

Examples:

"192.168.10.15"

floating_ip_address
string<ipvanyaddress> | null
required

IP Address of the floating IP

Examples:

"172.24.4.34"

id
string<uuid4> | null
required

Floating IP ID

Examples:

"c64e5db1-5f1f-43ec-a8d9-5090df85b82d"

port_id
string<uuid4> | null
required

Port ID the floating IP is attached to. The fixed_ip_address is the IP address of the port.

Examples:

"ee2402d0-f0cd-4503-9b75-69be1d11c5f1"

project_id
integer
required

Project ID

Examples:

1337

region
string
required

Region name

Examples:

"Luxembourg 1"

region_id
integer
required

Region ID

Examples:

7

router_id
string<uuid4> | null
required

Router ID

Examples:

"11005a33-c5ac-4c96-ab6f-8f2827cc7da6"

status
enum<string> | null
required

Floating IP status

Available options:
ACTIVE,
DOWN,
ERROR
Examples:

"ACTIVE"

"DOWN"

"ERROR"

subnet_id
string<uuid4> | null
required
deprecated

This field is deprecated and can be ignored

Examples:

null

tags
TagSerializer · object[]
required

List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.

Examples:
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
task_id
string<uuid4> | null
required

The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.

Examples:

"a4eb4b29-048e-42f6-a5e1-2c18bc001c45"

updated_at
string<date-time>
required

Datetime when the floating IP was last updated

Examples:

"2019-06-13T13:58:12+0000"