Firewalls

Update a Firewall

Update a Firewall.

In case of a parallel running change on the Firewall a conflict error will be returned.

put/firewalls/{id}

Request

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

Path parameters

idinteger required

ID of the Firewall.

Example:42

ID of the Firewall.

Request body

namestring

Name of the Firewall.

Must be unique per Project.

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".

Example request

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

Response

Request succeeded.

Example response

{
  "firewall": {
    "id": 42,
    "name": "new-name",
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "created": "2016-01-30T23:55:00Z",
    "rules": [
      {
        "direction": "in",
        "source_ips": [
          "192.0.2.2/32",
          "192.0.2.0/24",
          "2001:0db8:9a3b:ee58:5ca:990c:8bc9:c03b/128"
        ],
        "destination_ips": [],
        "port": "80"
      }
    ],
    "applied_to": [
      {
        "type": "server",
        "server": {
          "id": 42
        },
        "label_selector": {
          "selector": "env=prod"
        },
        "applied_to_resources": [
          {
            "type": "server",
            "server": {
              "id": 42
            }
          }
        ]
      }
    ]
  }
}

Changes

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