ServerMania logo

Get List of Firewall Rules

To get the list of firewall rules assigned to a VS, use the following request:

GET /virtual_machines/:virtual_machine_id/firewall_rules.xml
GET /virtual_machines/:virtual_machine_id/firewall_rules.json

XML Request Example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://test/virtual_machines/1/firewall_rules.xml

JSON Request Example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://test/virtual_machines/1/firewall_rules.json 

XML Output Example

<firewall_rules>
<firewall_rule>
<position>1</position>
<address> </address>
<created_at>2011-04-20T12:52:10+03:00</created_at>
<command>ACCEPT</command>
<updated_at>2011-04-20T12:52:10+03:00</updated_at>
<port>21</port>
<protocol>TCP</protocol>
<id>1</id>
<network_interface_id>5</network_interface_id>
<comment>This is a comment</comment>
</firewall_rule>
</firewall_rules> 

Where:

position – the rule priority

address* – the IP address for which this rule is active. If none is specified, all IPs will be subject to this rule.

created_at – the date when the record in DB was created

command – the action which will be performed with the IP specified by the address parameter

updated_at – the date when the record was updated in DB

port – the port for which this rule is active. If the field is empty, the rule will apply to all ports

protocol – the IP protocol (TCP or UDP)for which this rule is active

id – the ID of this record

network_interface_id – the ID of a network interface for which this rule is active

(lightbulb) comment - the comment added to the firewall rule


Page History

v. 6.1 

  • added the comment parameter