POST /primary_ips/{id}/actions/assign
Assign a Primary IP to a resource.
A Server can only have one Primary IP of type ipv4
and one of type ipv6
assigned. If you need more IPs use Floating IPs.
A Server must be powered off (status off
) in order for this operation to succeed.
Error Codes specific to this Call
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 |
Servers
- https://api.hetzner.cloud/v1
Path parameters
Name | Type | Required | Description |
---|---|---|---|
id |
Integer | Yes |
ID of the Primary IP. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
assignee_id |
Integer | Yes |
ID of a resource of type |
assignee_type |
String | Yes |
Type of resource assigning the Primary IP to Possible values:
|
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.