Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Libvirt::Networks

Public Instance Methods

all(filter=nil) click to toggle source
# File lib/fog/libvirt/models/compute/networks.rb, line 12
def all(filter=nil)
  data=[]
  if filter.nil?
    connection.list_networks.each do |networkname|
      network=connection.lookup_network_by_name(networkname)
      data << { :raw => network }
    end
    connection.list_defined_networks.each do |networkname|
      network=connection.lookup_network_by_name(networkname)
      data << { :raw => network}
    end
  else
    network=nil
    begin
      network=get_by_uuid(filter[:uuid]) if filter.has_key?(:uuid)
      network=get_by_name(filter[:name]) if filter.has_key?(:name)
    rescue ::Libvirt::RetrieveError
      return nil
    end
    data << { :raw => network}
  end

  load(data)
end
get(uuid) click to toggle source
# File lib/fog/libvirt/models/compute/networks.rb, line 37
def get(uuid)
  self.all(:uuid => uuid).first
end
get_by_name(name) click to toggle source

Retrieve the network by name

# File lib/fog/libvirt/models/compute/networks.rb, line 50
def get_by_name(name)
  network=connection.lookup_network_by_name(name)
  return network
  #          new(:raw => network)
end
get_by_uuid(uuid) click to toggle source

private # Making these private, screws up realod

Retrieve the network by uuid
# File lib/fog/libvirt/models/compute/networks.rb, line 43
def get_by_uuid(uuid)
  network=connection.lookup_network_by_uuid(uuid)
  return network
  #          new(:raw => network)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.