Class: Squall::FirewallRule
Overview
OnApp FirewallRule
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) create(vm_id, options = {})
Create a firewall rule for a virtual machine.
-
- (Object) delete(vm_id, id)
Delete a firewall rule.
-
- (Object) edit(vm_id, id, options = {})
Edit a firewall rule.
-
- (Object) list(vm_id)
Lists all firewall rules for a virtual machine.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) create(vm_id, options = {})
Create a firewall rule for a virtual machine.
34 35 36 |
# File 'lib/squall/firewall_rule.rb', line 34 def create(vm_id, = {}) request(:post, "/virtual_machines/#{vm_id}/firewall_rules.json", default_params()) end |
- (Object) delete(vm_id, id)
Delete a firewall rule.
55 56 57 |
# File 'lib/squall/firewall_rule.rb', line 55 def delete(vm_id, id) request(:delete, "/virtual_machines/#{vm_id}/firewall_rules/#{id}.json") end |
- (Object) edit(vm_id, id, options = {})
Edit a firewall rule.
45 46 47 |
# File 'lib/squall/firewall_rule.rb', line 45 def edit(vm_id, id, = {}) request(:put, "/virtual_machines/#{vm_id}/firewall_rules/#{id}.json", default_params()) end |
- (Object) list(vm_id)
Lists all firewall rules for a virtual machine.
9 10 11 12 |
# File 'lib/squall/firewall_rule.rb', line 9 def list(vm_id) response = request(:get, "/virtual_machines/#{vm_id}/firewall_rules.json") response.collect { |firewall_rule| user['firewall_rule'] } end |