1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/compute/models/libvirt/networks.rb

32 lines
710 B
Ruby
Raw Normal View History

require 'fog/core/collection'
require 'fog/compute/models/libvirt/network'
module Fog
module Compute
class Libvirt
class Networks < Fog::Collection
model Fog::Compute::Libvirt::Network
def all
data=[]
connection.list_networks.each do |networkname|
network=connection.lookup_network_by_name(networkname)
data << { :raw => network }
end
load(data)
end
# Retrieve the network by uuid
def get(uuid)
network=connection.lookup_network_by_uuid(uuid)
new(:raw => network)
end
end #class
end #Class
end #module
end #module