ipv4
and one of type ipv6
assigned. If you need more IPs use Floating IPs.off
) in order for this operation to succeed.Code | Description |
---|---|
server_not_stopped | The server is running, but needs to be powered off |
primary_ip_already_assigned | Primary ip is already assigned to a different server |
server_has_ipv4 | The server already has an ipv4 address |
server_has_ipv6 | The server already has an ipv6 address |
curl --location --request POST 'https://api.hetzner.cloud/v1/primary_ips//actions/assign' \
--header 'Content-Type: application/json' \
--data-raw '{
"assignee_id": 4711,
"assignee_type": "server"
}'
{
"action": {
"command": "assign_primary_ip",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": null,
"id": 13,
"progress": 0,
"resources": [
{
"id": 42,
"type": "server"
},
{
"id": 4711,
"type": "primary_ip"
}
],
"started": "2016-01-30T23:50:00.000Z",
"status": "running"
}
}