Network Actions

Add a subnet to a Network

Adds a new subnet to the Network.

If the subnet ip_range is not provided, the first available /24 IP range will be used.

If a change is currently being performed on this Network, a error response with code conflict will be returned.

post/networks/{id}/actions/add_subnet

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/networks/{id}/actions/add_subnet
  • Auth: HTTP bearer

Path parameters

idinteger required

ID of the Network.

Example:42

ID of the Network.

Request body

type'cloud' | 'server' | 'vswitch' required

Type of subnet.

ip_rangestring

IP range of the subnet.

Uses CIDR notation.

Must be a subnet of the parent Networks ip_range.

Must not overlap with any other subnets or with any destinations in routes.

Minimum network size is /30. We highly recommend that you pick a larger subnet with a /24 netmask.

network_zonestring required

Name of the Network Zone.

The Location contains the network_zone it belongs to.

vswitch_idinteger

ID of the robot vSwitch.

Must be supplied if the subnet is of type vswitch.

Example request

{
  "ip_range": "10.0.1.0/24",
  "network_zone": "eu-central",
  "vswitch_id": 1000
}

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.