class Openstack::QuantumClient::L2l3

Attributes

quantum_extension_url[R]
quantum_url[R]

Public Class Methods

new(config) click to toggle source

The initialize l2l3 class should be initialized passing a hash with url and tenant: Example:

{:url => "http://localhost:9696", :tenant => "XYZ"}
# File lib/openstack-quantum-client/l2l3.rb, line 12
def initialize(config)
  @quantum_extension_url = "#{config[:url]}/v1.0/extensions/l2l3/tenants/#{config[:tenant]}"
  @quantum_url = "#{config[:url]}/v1.0/tenants/#{config[:tenant]}"
end

Public Instance Methods

attachment_detail() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 17
def attachment_detail
  @attachment_detail ||= AttachmentDetail.new(@quantum_extension_url)
end
dhcp() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 33
def dhcp
  @dhcp ||= Dhcp.new(@quantum_extension_url)
end
dhcp_entry() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 37
def dhcp_entry
  @dhcp_entry ||= DhcpEntry.new(@quantum_extension_url)
end
filter_rule() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 29
def filter_rule
  @filter_rule ||= FilterRule.new(@quantum_extension_url)
end
filtered_range() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 25
def filtered_range
  @filtered_range ||= FilteredRange.new(@quantum_extension_url)
end
firewall() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 21
def firewall
  @firewall ||= Firewall.new(@quantum_extension_url)
end
network() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 45
def network
  @network ||= Network.new(@quantum_url)
end
port() click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 41
def port
  @port ||= Port.new(@quantum_url)
end

Protected Instance Methods

post_to_quantum(post_url, info) click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 50
def post_to_quantum(post_url, info)
  send_to_quantum("post", post_url, info)
end
put_to_quantum(post_url, info) click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 54
def put_to_quantum(post_url, info)
  send_to_quantum("put", post_url, info)
end
send_to_quantum(http_method, post_url, info) click to toggle source
# File lib/openstack-quantum-client/l2l3.rb, line 58
def send_to_quantum(http_method, post_url, info)
  response = HTTParty.send(
    http_method,
    post_url,
    :body => info.to_json,
    :headers => {"Content-Type" => "application/json"}
  )
  response
end