ServerMania logo

Apply Firewall Rule

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

  • Create own firewall rules
  • Destroy own firewall rules
  • Read own firewall rules
  • Update own firewall rules

To apply firewall rules for a virtual server, use the following request:

POST /virtual_machines/:virtual_machine_id/update_firewall_rules.xml
POST /virtual_machines/:virtual_machine_id/update_firewall_rules.json

XML Request Example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' --url http://test/virtual_machines/21/update_firewall_rules.xml

JSON Request Example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' --url http://test/virtual_machines/21/update_firewall_rules.json