For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Replace all firewall rules in group

put

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.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
firewallIdintegerRequired

Firewall ID

Example: 9449049
Body
syncbooleanOptional

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

Responses
200

Success response

application/json
idintegerOptional

Firewall ID

Example: 65224
namestringOptional

Firewall name

Example: HTTP and SSH only
is_syncedbooleanOptional

Is current firewall synced with VPS

Example: false
created_atstring · date-timeOptionalExample: 2021-09-01T12:00:00Z
updated_atstring · date-timeOptionalExample: 2021-09-01T12:00:00Z
put/api/vps/v1/firewall/{firewallId}/rules
PUT /api/vps/v1/firewall/{firewallId}/rules HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 103

{
  "rules": [
    {
      "protocol": "TCP",
      "port": "443",
      "source": "any",
      "source_detail": "351.15.24.0/24"
    }
  ],
  "sync": true
}
{
  "id": 65224,
  "name": "HTTP and SSH only",
  "is_synced": false,
  "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"
}

Last updated

Was this helpful?