2014-04-02 08:57:15 -04:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/opennebula/models/compute/network'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenNebula
|
|
|
|
class Networks < Fog::Collection
|
|
|
|
model Fog::Compute::OpenNebula::Network
|
|
|
|
|
|
|
|
def all(filter={})
|
2014-11-13 15:32:34 -05:00
|
|
|
self.get_by_filter(filter)
|
2014-04-02 08:57:15 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(id)
|
|
|
|
self.all({:id => id}).first
|
|
|
|
end
|
|
|
|
|
2014-11-07 13:50:11 -05:00
|
|
|
def get_by_filter(filter)
|
2014-11-13 15:32:34 -05:00
|
|
|
load(service.list_networks(filter))
|
2014-11-07 13:50:11 -05:00
|
|
|
end
|
|
|
|
|
2014-04-02 08:57:15 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|