Floating IPs

Create a Floating IP

Create a Floating IP.

Provide the server attribute to assign the Floating IP to that server or provide a home_location to locate the Floating IP at. Note that the Floating IP can be assigned to a Server in any Location later on. For optimal routing it is advised to use the Floating IP in the same Location it was created in.

post/floating_ips

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/floating_ips
  • Auth: HTTP bearer

Request body

type'ipv4' | 'ipv6' required

The Floating IP type.

serverinteger nullable

Server the Floating IP is assigned to.

null if not assigned.

descriptionstring nullable

Description of the Resource.

namestring

Name of the Resource. Must be unique per Project.

A name will be generated if none is given.

labelsobject

User-defined labels (key/value pairs) for the Resource. For more information, see "Labels".

Example request

{
  "type": "ipv6",
  "server": 42,
  "home_location": "fsn1",
  "description": "This describes my resource",
  "name": "my-resource",
  "labels": {
    "environment": "prod",
    "example.com/my": "label",
    "just-a-key": ""
  }
}

Response

Request succeeded.

Example response

{
  "floating_ip": {
    "id": 42,
    "name": "my-resource",
    "description": "This describes my resource",
    "ip": "2001:db8::/64",
    "type": "ipv6",
    "server": 42,
    "dns_ptr": [
      {
        "ip": "2001:db8::1",
        "dns_ptr": "server.example.com"
      }
    ],
    "home_location": {
      "id": 42,
      "name": "fsn1",
      "description": "Falkenstein DC Park 1",
      "country": "DE",
      "city": "Falkenstein",
      "latitude": 50.47612,
      "longitude": 12.370071,
      "network_zone": "eu-central"
    },
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "created": "2016-01-30T23:55:00Z"
  },
  "action": {
    "id": 42,
    "command": "start_resource",
    "started": "2016-01-30T23:55:00Z",
    "finished": "2016-01-30T23:55:00Z",
    "progress": 100,
    "resources": [
      {
        "id": 42,
        "type": "server"
      }
    ],
    "error": {
      "code": "action_failed",
      "message": "Action failed"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.