Skip to main content

Floating IPs

Floating IP Schema

  • id String - A unique identifier for each floating IP. This is automatically generated.
  • name String - The human-readable name for the floating Ip.
  • description String - The human-readable description for the floating IP.
  • ip_address String - The IP address of the floating IP.
  • is_public Boolean - A boolean value indicating whether the floating IP is public or private. Currently, all floating IPs are public.
  • version String - The IP version of the floating IP. Possible values are ipv4 and ipv6.
  • region String - The identifier for the region this floating IP exists in (eg. ARC-IS-HAF-1).
  • status String - The floating ip status. Possible values are creating, created, deleting.
  • instance Object - The attached instance.
  • created_at String - A time value given in ISO8601 combined date and time format that represents when the floating IP was created.
  • updated_at String - A time value given in ISO8601 combined date and time format that represents when the floating IP was updated.

This resource does not exist for legacy projects and accounts.

Create a floating IP

To create a new floating IP, send a request to:

POST /compute/v1/floating-ips (HTTP 201 - Created)

The attribute values that must be set to successfully create a floating IP are:

Body parameters

  • name String Required - The human-readable name set for the floating IP.
  • description String Optional - The human-readable description set for the floating IP.
  • region String Required - The identifier for the region in which this floating IP should be created in, see Regions.
  • version String Optional - The IP version of the floating IP. Currently only ipv4 is supported. Defaults to ipv4.
{
"name": "<floating IP name>",
"description": "<floating IP description>",
"region": "ARC-IS-HAF-1",
"version": "ipv4"
}

Response body

The floating IP will be created using the provided information. The response body will contain a JSON object with standard attributes for your new floating IP, see Floating IP Schema:

{
"floating_ip": {
"id": "559d84e6-01f8-46bb-90ad-df68221c72c1",
"name": "<floating IP name>",
"description": "<floating IP description>",
"ip_address": null,
"is_public": true,
"region": "ARC-IS-HAF-1",
"status": "creating",
"version": "ipv4",
"created_at": "2023-12-18T12:06:40.334Z",
"updated_at": "2023-12-18T12:06:40.334Z",
"instance": null
}
}

List Floating IPs

Lists all floating IPs of an account.

GET /compute/v1/floating-ips (HTTP 200 - OK)

Query parameters

  • per_page Integer Optional - A positive integer lower than or equal to 100 to select the number of items to return (default: 50).
  • page Integer Optional - A positive integer to choose the page to return.

Response body

The response will be a JSON object with pagination details and a key called floating_ips. This will be set to an array of floating IP objects, each of which will contain the floating IP object, see Floating IP Schema:

{
"floating_ips": [
{
"id": "559d84e6-01f8-46bb-90ad-df68221c72c1",
"name": "<floating IP name>",
"description": "<floating IP description>",
"ip_address": "192.0.2.0",
"is_public": true,
"region": "ARC-IS-HAF-1",
"status": "created",
"version": "ipv4",
"created_at": "2023-12-18T12:06:40.334Z",
"updated_at": "2023-12-18T12:06:41.077Z",
"instance": null
}
],
"total_count": 1,
"page": 1,
"per_page": 50
}

Get Floating IP

Get details of one floating IP with a given ID.

GET /compute/v1/floating-ips/<floating_ip_id> (HTTP 200 - OK)

Path parameters:

  • floating_ip_id String - floating IP id

Response body

The response will be a JSON object that contains the floating_ip attributes, see Floating IP Schema:

{
"floating_ip": {
"id": "559d84e6-01f8-46bb-90ad-df68221c72c1",
"name": "<floating IP name>",
"description": "<floating IP description>",
"ip_address": "192.0.2.0",
"is_public": true,
"region": "ARC-IS-HAF-1",
"status": "created",
"version": "ipv4",
"created_at": "2023-12-18T12:06:40.334Z",
"updated_at": "2023-12-18T12:06:41.077Z",
"instance": null
}
}

Update Floating IP

Update details of one floating IP with a given ID.

PATCH /compute/v1/floating-ips/<floating_ip_id> (HTTP 200 - OK)

Path parameters:

  • floating_ip_id String - floating IP id

Body parameters

  • name String Optional - The human-readable name set for the floating IP.
  • description String Optional - The human-readable description set for the floating IP.

At least one body parameter must be specified for this request.

Response body

The response will be a JSON object that contains the updated floating_ip attributes, see Floating IP Schema:

{
"floating_ip": {
"id": "559d84e6-01f8-46bb-90ad-df68221c72c1",
"name": "<floating IP name>",
"description": "<floating IP description>",
"ip_address": "192.0.2.0",
"is_public": true,
"region": "ARC-IS-HAF-1",
"status": "created",
"version": "ipv4",
"created_at": "2023-12-18T12:06:40.334Z",
"updated_at": "2023-12-18T12:06:41.077Z",
"instance": null
}
}

Delete a Floating IP

Delete a floating IP with the given ID

DELETE /compute/v1/floating-ips/<floating_ip_id>  (HTTP 204 - No content)

Path parameters:

  • floating_ip_id String - floating IP id

Examples (cURL)

# Create a new floating IP
curl -H "Authorization: Bearer $TOKEN" \
-X POST "https://api-staging-gws.genesiscloud.dev/compute/v1/floating-ips" \
-H "Content-Type: application/json" \
--data-raw '{
"name": "test floating IP",
"description": "test floating IP",
"isPublic": true,
"region": "ARC-IS-HAF-1",
"version": "ipv4"
}'
# List all floating IPs
curl -H "Authorization: Bearer $TOKEN" \
"https://api-staging-gws.genesiscloud.dev/compute/v1/floating-ips"
# Get a floating IP by id
curl -H "Authorization: Bearer $TOKEN" \
"https://api-staging-gws.genesiscloud.dev/compute/v1/floating-ips/<floating-ip-id>"
# Delete a floating IP by id
curl -H "Authorization: Bearer $TOKEN" \
-X DELETE "https://api-staging-gws.genesiscloud.dev/compute/v1/floating-ips/<floating-ip-id>"