Class: Fog::Compute::OpenNebula::Networks

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/opennebula/models/compute/networks.rb

Instance Method Summary collapse

Instance Method Details

#all(filter = {}) ⇒ Object



10
11
12
# File 'lib/fog/opennebula/models/compute/networks.rb', line 10

def all(filter={})
  self.get_by_filter(filter)
end

#get(id) ⇒ Object



14
15
16
17
18
19
# File 'lib/fog/opennebula/models/compute/networks.rb', line 14

def get(id)
  data = service.list_networks({:id => id})
  load(data).first
rescue Fog::Compute::OpenNebula::NotFound
  nil
end

#get_by_filter(filter) ⇒ Object



28
29
30
# File 'lib/fog/opennebula/models/compute/networks.rb', line 28

def get_by_filter(filter)
  load(service.list_networks(filter))
end

#get_by_name(network) ⇒ Object



21
22
23
24
25
26
# File 'lib/fog/opennebula/models/compute/networks.rb', line 21

def get_by_name(network)
  data = service.list_networks({:network => network})
  load(data).first
rescue Fog::Compute::OpenNebula::NotFound
  nil
end