POST /primary_ips
Create a new Primary IP.
Can optionally be assigned to a resource by providing an assignee_id
and assignee_type
.
If not assigned to a resource the datacenter
key needs to be provided. This can be either the ID or the name of the Datacenter this Primary IP shall be created in.
A Primary IP can only be assigned to resource in the same Datacenter later on.
Call specific error codes
Code | Description |
---|---|
server_not_stopped | The specified Server is running, but needs to be powered off |
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
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 |
---|---|---|---|
datacenter |
String | No |
Datacenter ID or name. The Primary IP will be bound to this Datacenter. Omit if |
name |
String | Yes |
Name of the Resource. Must be unique per Project. |
auto_delete |
Boolean | No |
Auto deletion state. If enabled the Primary IP will be deleted once the assigned resource gets deleted. Default value: false |
labels |
Object | No |
User-defined labels ( |
assignee_id |
Integer | No |
ID of resource to assign the Primary IP to. Omitted if the Primary IP should not get assigned. |
assignee_type |
String | Yes |
Type of resource the Primary IP can get assigned to. Currently Primary IPs can only be assigned to Servers,
therefore this field must be set to Possible values:
|
type |
String | Yes |
Primary IP type. 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.