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