Class: Openstack::QuantumMessager::Firewall

Inherits:
L2l3
  • Object
show all
Defined in:
lib/openstack-quantum-messager/l2l3/firewall.rb

Instance Attribute Summary

Attributes inherited from L2l3

#quantum_extension_url, #quantum_url

Instance Method Summary collapse

Methods inherited from L2l3

#attachment_detail, #dhcp, #dhcp_entry, #filter_rule, #filtered_range, #firewall, #network, #port

Constructor Details

#initialize(quantum_url) ⇒ Firewall

Returns a new instance of Firewall.



5
6
7
# File 'lib/openstack-quantum-messager/l2l3/firewall.rb', line 5

def initialize(quantum_url)
  @quantum_url = "#{quantum_url}/firewalls.json"
end

Instance Method Details

#create(name, address) ⇒ Object



9
10
11
12
13
14
# File 'lib/openstack-quantum-messager/l2l3/firewall.rb', line 9

def create(name, address)
  post_to_quantum(
    @quantum_url,
    {"firewall" => {"name" => name, "address" => address}}
  )
end

#listObject



16
17
18
19
# File 'lib/openstack-quantum-messager/l2l3/firewall.rb', line 16

def list
  response = HTTParty.get(@quantum_url)
  JSON.parse(response.body)["firewalls"] if response
end