Update Firewall rules of a Network Security Group
To update a firewall rule of a NSG, you need to use the following Cloud API PUT or PATCH request providing the datacenterId, securityGroupId and ruleId:
PUT /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules/{ruleId}
PATCH /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules/{ruleId}
Request
curl --location 'https://api.ionos.com/cloudapi/v6/datacenters/5a88aa8b-8aa1-51f6-XXd1-XXXXXe9f31/securitygroups/bxxxx-axXX-0008-8888-99k0444e5555/rules/0XX070155-XXaf-XXbb-XX20-088x8f0f8137' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YYXabCDeFmLMO0c2hyYUBpb25vcy5jb206I1Bha2lzdGFuXzE=' \
--data '{
"properties":{
"name": "My FWR",
"protocol": "TCP",
"sourceMac": "00:0a:95:9d:68:16",
"ipVersion": "IPv4",
"sourceIp": "22.231.113.12",
"targetIp": "22.231.113.64",
"portRangeStart": 8,
"portRangeEnd": 8,
"type": "INGRESS"
}
}'Response
202 Accepted
PreviousRetrieve Firewall rules by Network Security Group IDNextDelete Firewall rule from a Network Security Group
Last updated
Was this helpful?