Module: Fog::Network

Defined in:
lib/fog/network.rb,
lib/fog/openstack/network.rb,
lib/fog/openstack/models/network/port.rb,
lib/fog/openstack/models/network/ports.rb,
lib/fog/openstack/models/network/subnet.rb,
lib/fog/openstack/models/network/network.rb,
lib/fog/openstack/models/network/subnets.rb,
lib/fog/openstack/models/network/networks.rb,
lib/fog/openstack/requests/network/get_port.rb,
lib/fog/openstack/requests/network/get_subnet.rb,
lib/fog/openstack/requests/network/list_ports.rb,
lib/fog/openstack/requests/network/set_tenant.rb,
lib/fog/openstack/requests/network/create_port.rb,
lib/fog/openstack/requests/network/delete_port.rb,
lib/fog/openstack/requests/network/get_network.rb,
lib/fog/openstack/requests/network/update_port.rb,
lib/fog/openstack/requests/network/list_subnets.rb,
lib/fog/openstack/requests/network/create_subnet.rb,
lib/fog/openstack/requests/network/delete_subnet.rb,
lib/fog/openstack/requests/network/list_networks.rb,
lib/fog/openstack/requests/network/update_subnet.rb,
lib/fog/openstack/requests/network/create_network.rb,
lib/fog/openstack/requests/network/delete_network.rb,
lib/fog/openstack/requests/network/update_network.rb

Defined Under Namespace

Classes: OpenStack

Class Method Summary collapse

Class Method Details

.[](provider) ⇒ Object



4
5
6
# File 'lib/fog/network.rb', line 4

def self.[](provider)
  self.new(:provider => provider)
end

.new(attributes) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fog/network.rb', line 8

def self.new(attributes)
  attributes = attributes.dup # Prevent delete from having side effects
  provider = attributes.delete(:provider).to_s.downcase.to_sym

  case provider
  when :openstack
    require 'fog/openstack/network'
    Fog::Network::OpenStack.new(attributes)
  else
    raise ArgumentError.new("#{provider} has no network service")
  end
end

.providersObject



21
22
23
# File 'lib/fog/network.rb', line 21

def self.providers
  Fog.services[:network]
end