1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[opennebula] added get_by_name for network model

This commit is contained in:
Achim Ledermüller 2014-06-16 22:09:46 +02:00
parent d0e0ebfa4d
commit 3fa1f6a9c1

View file

@ -12,7 +12,17 @@ module Fog
end
def get(id)
self.all({:id => id}).first
data = service.list_networks({:id => id})
load(data).first
rescue Fog::Compute::OpenNebula::NotFound
nil
end
def get_by_name(name)
data = service.list_networks({:name => name})
load(data)
rescue Fog::Compute::OpenNebula::NotFound
nil
end
def get_by_filter(filter)