VPS: Firewall

Replace all firewall rules in group

Replaces all firewall rules within a specified firewall group with the provided set of rules in a single atomic operation, instead of creating or deleting rules one by one.

Any virtual machine using this firewall group will need to be synchronized after replacing rules; pass the "sync" parameter to trigger synchronization immediately.

put/api/vps/v1/firewall/{firewallId}/rules

Path parameters

firewallIdinteger required
Example:9449049

Firewall ID

Request body

syncboolean

Synchronize the firewall group to all its virtual machines after replacing the rules

Example request

{
  "rules": [
    {
      "protocol": "TCP",
      "port": "443",
      "source": "any",
      "source_detail": "351.15.24.0/24"
    }
  ]
}

Response

Success response

idinteger

Firewall ID

namestring

Firewall name

is_syncedboolean

Is current firewall synced with VPS

created_atstring date-time
updated_atstring date-time

Example response

{
  "id": 65224,
  "name": "HTTP and SSH only",
  "rules": [
    {
      "id": 24541,
      "action": "accept",
      "protocol": "TCP",
      "port": "1024:2048",
      "source": "any",
      "source_detail": "any"
    }
  ],
  "created_at": "2021-09-01T12:00:00Z",
  "updated_at": "2021-09-01T12:00:00Z"
}

Changes