VPS: Firewall
Replace all firewall rules in group
Changed onReplaces 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
Request
- Base URL: https://developers.hostinger.com
- URL: https://developers.hostinger.com/api/vps/v1/firewall/{firewallId}/rules
- Auth: HTTP bearer
Path parameters
firewallIdinteger required
Example:9449049
Firewall ID
Request body
Example request
{
"rules": [
{
"protocol": "TCP",
"port": "443",
"source": "any",
"source_detail": "351.15.24.0/24"
}
]
}Response
Success response
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
- warning
deleted the
queryrequest parametersync - info
added the new optional request property
- warning
- info
endpoint added
- info