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



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

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

#get(id) ⇒ Object



18
19
20
21
22
23
# File 'lib/fog/opennebula/models/compute/networks.rb', line 18

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

#get_by_filter(filter) ⇒ Object



32
33
34
# File 'lib/fog/opennebula/models/compute/networks.rb', line 32

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

#get_by_name(network) ⇒ Object



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

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