Child pages
  • Delete Firewall Rule
Skip to end of metadata
Go to start of metadata

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
  • Update own virtual server
  • Read own virtual server

To delete a firewall rule, use the following request:

DELETE /virtual_machines/:virtual_machine_id/firewall_rules/:id.xml
DELETE /virtual_machines/:virtual_machine_id/firewall_rules/:id.json

XML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.xml

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.json

To destroy several firewall rules:

DELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.xml
DELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.json

XML Request example

curl -X DELETE -u user:userpass http://onapp.test/virtual_machines/omxa18ecx5e5y1/firewall_rules/destroy_batch.xml?ids=24,25 -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X DELETE -u user:userpass http://onapp.test/virtual_machines/:id/firewall_rules/destroy_batch.json?ids=20,22 -H 'Accept: application/json' -H 'Content-type: application/json'

 

You will get a 204 status response on success, and 404 if there is no firewall rule with a requested ID or you entered incorrect URL.

  • No labels