Networks

Update a Network

Update a Network.

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

put/networks/{id}

Request

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

Path parameters

idinteger required

ID of the Network.

Example:42

ID of the Network.

Request body

namestring

New Network name.

labelsobject

User-defined labels (key/value pairs) for the Resource.

Note that the set of Labels provided in the request will overwrite the existing one.

For more information, see "Labels".

expose_routes_to_vswitchboolean

Toggle to expose routes to the Networks vSwitch.

Indicates if the routes from this Network should be exposed to the vSwitch in this Network. Only takes effect if a vSwitch is setup in this Network.

Example request

{
  "name": "new-name",
  "labels": {
    "environment": "prod",
    "example.com/my": "label",
    "just-a-key": ""
  }
}

Response

Request succeeded.

Example response

{
  "network": {
    "id": 4711,
    "name": "mynet",
    "ip_range": "10.0.0.0/16",
    "subnets": [
      {
        "ip_range": "10.0.1.0/24",
        "network_zone": "eu-central",
        "gateway": "10.0.0.1",
        "vswitch_id": 1000
      }
    ],
    "routes": [
      {
        "destination": "10.100.1.0/24",
        "gateway": "10.0.1.1"
      }
    ],
    "servers": [
      42
    ],
    "load_balancers": [
      42
    ],
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "created": "2016-01-30T23:55:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.