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:
parent
d0e0ebfa4d
commit
3fa1f6a9c1
1 changed files with 11 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue