Class: Openstack::QuantumMessager::Dhcp
- Defined in:
- lib/openstack-quantum-messager/l2l3/dhcp.rb
Instance Attribute Summary
Attributes inherited from L2l3
#quantum_extension_url, #quantum_url
Instance Method Summary collapse
- #create(name, address) ⇒ Object
-
#initialize(quantum_url) ⇒ Dhcp
constructor
A new instance of Dhcp.
- #list ⇒ Object
Methods inherited from L2l3
#attachment_detail, #dhcp, #dhcp_entry, #filter_rule, #filtered_range, #firewall, #network, #port
Constructor Details
#initialize(quantum_url) ⇒ Dhcp
Returns a new instance of Dhcp.
5 6 7 |
# File 'lib/openstack-quantum-messager/l2l3/dhcp.rb', line 5 def initialize(quantum_url) @quantum_url = "#{quantum_url}/dhcps.json" end |
Instance Method Details
#create(name, address) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/openstack-quantum-messager/l2l3/dhcp.rb', line 9 def create(name, address) post_to_quantum( @quantum_url, {"dhcp" => {"name" => name, "address" => address}} ) end |
#list ⇒ Object
16 17 18 19 |
# File 'lib/openstack-quantum-messager/l2l3/dhcp.rb', line 16 def list response = HTTParty.get(@quantum_url) JSON.parse(response.body)["dhcps"] if response end |