rules
array to remove all rules.Code | Description |
---|---|
firewall_resource_not_found | The resource the Firewall should be attached to was not found |
curl --location --request POST 'https://api.hetzner.cloud/v1/firewalls//actions/set_rules' \
--header 'Content-Type: application/json' \
--data-raw '{
"rules": [
{
"description": "Allow port 80",
"direction": "in",
"port": "80",
"protocol": "tcp",
"source_ips": [
"28.239.13.1/32",
"28.239.14.0/24",
"ff21:1eac:9a3b:ee58:5ca:990c:8bc9:c03b/128"
]
}
]
}'
{
"actions": [
{
"command": "set_firewall_rules",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": "2016-01-30T23:56:00.000Z",
"id": 13,
"progress": 100,
"resources": [
{
"id": 38,
"type": "firewall"
}
],
"started": "2016-01-30T23:55:00.000Z",
"status": "success"
},
{
"command": "apply_firewall",
"error": {
"code": "action_failed",
"message": "Action failed"
},
"finished": "2016-01-30T23:56:00.000Z",
"id": 14,
"progress": 100,
"resources": [
{
"id": 38,
"type": "firewall"
},
{
"id": 42,
"type": "server"
}
],
"started": "2016-01-30T23:55:00.000Z",
"status": "success"
}
]
}