action hetzner_post_primary_ips { label: "Create a Primary IP" description: "Creates a new Primary IP, optionally assigned to a Server.\n\nIf you want to create a Primary IP that is not assigned to a Server, you need to provide the `datacenter` key instead of `assignee_id`. This can be either the ID or the name of the Datacenter this Primary IP shall be created in.\n\nNote that a Primary IP can only be assigned to a Server in the same Datacenter later on.\n\n#### Call specific error codes\n\n| Code | Description |\n|------------------------------ |-------------------------------------------------------------- |\n| `server_not_stopped` | The specified server is running, but needs to be powered off |\n| `server_has_ipv4` | The server already has an ipv4 address |\n| `server_has_ipv6` | The server already has an ipv6 address |\n" provider: hetzner method: POST path: "/primary_ips" encoding: json input: { type: "object" required: ["assignee_type", "name", "type"] properties: { assignee_id: { type: "integer" description: "ID of the resource the Primary IP should be assigned to. Omitted if it should not be assigned." } assignee_type: { type: "string" description: "Resource type the Primary IP can be assigned to" enum: ["server"] } auto_delete: { type: "boolean" description: "Delete the Primary IP when the Server it is assigned to is deleted. If omitted defaults to `false`." } datacenter: { type: "string" description: "ID or name of Datacenter the Primary IP will be bound to. Needs to be omitted if `assignee_id` is passed." } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" } type: { type: "string" description: "Primary IP type" enum: ["ipv4", "ipv6"] } } } output: { type: "object" required: ["primary_ip"] properties: { action: { type: "object" required: ["command", "error", "finished", "id", "progress", "resources", "started", "status"] properties: { command: { type: "string" description: "Command executed in the Action" } error: { type: "object" description: "Error message for the Action if error occurred, otherwise null" required: ["code", "message"] properties: { code: { type: "string" description: "Fixed machine readable code" } message: { type: "string" description: "Humanized error message" } } } finished: { type: "string" description: "Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null." } id: { type: "integer" description: "ID of the Resource" } progress: { type: "number" description: "Progress of Action in percent" } resources: { type: "array" description: "Resources the Action relates to" items: { type: "object" required: ["id", "type"] properties: { id: { type: "integer" description: "ID of the Resource" } type: { type: "string" description: "Type of resource referenced" } } } } started: { type: "string" description: "Point in time when the Action was started (in ISO-8601 format)" } status: { type: "string" description: "Status of the Action" enum: ["success", "running", "error"] } } } primary_ip: { type: "object" required: ["assignee_id", "assignee_type", "auto_delete", "blocked", "created", "datacenter", "dns_ptr", "id", "ip", "labels", "name", "protection", "type"] properties: { assignee_id: { type: "integer" description: "ID of the resource the Primary IP is assigned to, null if it is not assigned at all" } assignee_type: { type: "string" description: "Resource type the Primary IP can be assigned to" enum: ["server"] } auto_delete: { type: "boolean" description: "Delete this Primary IP when the resource it is assigned to is deleted" } blocked: { type: "boolean" description: "Whether the IP is blocked" } created: { type: "string" description: "Point in time when the Resource was created (in ISO-8601 format)" } datacenter: { type: "object" description: "Datacenter this Primary IP is located at" required: ["description", "id", "location", "name", "server_types"] properties: { description: { type: "string" description: "Description of the Datacenter" } id: { type: "integer" description: "ID of the Resource" } location: { type: "object" required: ["city", "country", "description", "id", "latitude", "longitude", "name", "network_zone"] properties: { city: { type: "string" description: "City the Location is closest to" } country: { type: "string" description: "ISO 3166-1 alpha-2 code of the country the Location resides in" } description: { type: "string" description: "Description of the Location" } id: { type: "number" description: "ID of the Location" } latitude: { type: "number" description: "Latitude of the city closest to the Location" } longitude: { type: "number" description: "Longitude of the city closest to the Location" } name: { type: "string" description: "Unique identifier of the Location" } network_zone: { type: "string" description: "Name of network zone this Location resides in" } } } name: { type: "string" description: "Unique identifier of the Datacenter" } server_types: { type: "object" description: "The Server types the Datacenter can handle" required: ["available", "available_for_migration", "supported"] properties: { available: { type: "array" description: "IDs of Server types that are supported and for which the Datacenter has enough resources left" items: { type: "number" } } available_for_migration: { type: "array" description: "IDs of Server types that are supported and for which the Datacenter has enough resources left" items: { type: "number" } } supported: { type: "array" description: "IDs of Server types that are supported in the Datacenter" items: { type: "number" } } } } } } dns_ptr: { type: "array" description: "Array of reverse DNS entries" items: { type: "object" required: ["ip", "dns_ptr"] properties: { dns_ptr: { type: "string" description: "DNS pointer for the specific IP address" } ip: { type: "string" description: "Single IPv4 or IPv6 address" } } } } id: { type: "integer" description: "ID of the Resource" } ip: { type: "string" description: "IP address" } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" description: "Name of the Resource. Must be unique per Project." } protection: { type: "object" description: "Protection configuration for the Resource" required: ["delete"] properties: { delete: { type: "boolean" description: "If true, prevents the Resource from being deleted" } } } type: { type: "string" description: "Type of the Primary IP" enum: ["ipv4", "ipv6"] } } } } } }