Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Libvirt::Pools

Public Instance Methods

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

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

Retrieve the pool by name

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

private # Making these private, screws up realod

Retrieve the pool by uuid
# File lib/fog/libvirt/models/compute/pools.rb, line 44
def get_by_uuid(uuid)
  pool=connection.raw.lookup_storage_pool_by_uuid(uuid)
  return pool
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.