home_location
key instead of server
. This can be either the ID or the name of the Location this IP shall be created in. Note that a 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.curl --location --request POST 'https://api.hetzner.cloud/v1/floating_ips' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Web Frontend",
"home_location": "fsn1",
"labels": {
"labelkey": "value"
},
"name": "Web Frontend",
"server": 42,
"type": "ipv4"
}'
{
"action": {
"command": "create_floating_ip",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": null,
"id": 13,
"progress": 0,
"resources": [
{
"id": 42,
"type": "server"
}
],
"started": "2016-01-30T23:50:00.000Z",
"status": "running"
},
"floating_ip": {
"blocked": false,
"created": "2016-01-30T23:50:00.000Z",
"description": "Web Frontend",
"dns_ptr": [
{
"dns_ptr": "server.example.com",
"ip": "2001:db8::1"
}
],
"home_location": {
"city": "Falkenstein",
"country": "DE",
"description": "Falkenstein DC Park 1",
"id": 1,
"latitude": 50.47612,
"longitude": 12.370071,
"name": "fsn1",
"network_zone": "eu-central"
},
"id": 4711,
"ip": "131.232.99.1",
"labels": {
"env": "dev"
},
"name": "Web Frontend",
"protection": {
"delete": false
},
"server": 42,
"type": "ipv4"
}
}