Class: Fog::Compute::OpenNebula::Groups

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

Instance Method Summary collapse

Instance Method Details

#all(filter = {}) ⇒ Object



12
13
14
# File 'lib/fog/opennebula/models/compute/groups.rb', line 12

def all(filter={})
  load(service.list_groups(filter))
end

#get(id) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/fog/opennebula/models/compute/groups.rb', line 16

def get(id)
  group = self.all({:id => id})
  
  if group.length > 1
    raise Fog::Errors::Error.new("groups.get should return only one group, not #{group.length}!")
  end

  group.first
end

#get_by_name(str) ⇒ Object



26
27
28
# File 'lib/fog/opennebula/models/compute/groups.rb', line 26

def get_by_name(str)
  self.all({:name => str})
end