Server Actions
Attach a Server to a Network
Attaches a Server to a network. This will complement the fixed public Server interface by adding an additional ethernet interface to the Server which is connected to the specified network.
The Server will get an IP auto assigned from a subnet of type server in the same network_zone.
Using the alias_ips attribute you can also define one or more additional IPs to the Servers. Please note that you will have to configure these IPs by hand on your Server since only the primary IP will be given out by DHCP.
Operation specific errors
| Status | Code | Description |
|---|---|---|
| 422 | server_already_attached | The server is already attached to the network |
| 422 | ip_not_available | The provided Network IP is not available |
| 422 | no_subnet_available | No Subnet or IP is available for the Server within the network |
| 422 | networks_overlap | The network IP range overlaps with one of the server networks |
post/servers/{id}/actions/attach_to_network
Request
- Base URL: https://api.hetzner.cloud/v1
- URL: https://api.hetzner.cloud/v1/servers/{id}/actions/attach_to_network
- Auth: HTTP bearer
Path parameters
idinteger required
ID of the Server.
Example:42
ID of the Server.
Request body
Example request
{
"network": 4711,
"ip": "10.0.1.1",
"alias_ips": [
"10.0.1.2"
],
"ip_range": "10.0.1.0/24"
}Response
Request succeeded.
Example response
{
"action": {
"id": 42,
"command": "start_resource",
"started": "2016-01-30T23:55:00Z",
"finished": "2016-01-30T23:55:00Z",
"progress": 100,
"resources": [
{
"id": 42,
"type": "server"
}
],
"error": {
"code": "action_failed",
"message": "Action failed"
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.