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



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

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

#get(id) ⇒ Object



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

def get(id)
  group = all(:id => id)

  if group.length > 1
    raise Fog::Errors::Error, "groups.get should return only one group, not #{group.length}!"
  end

  group.first
end

#get_by_name(str) ⇒ Object



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

def get_by_name(str)
  all(:name => str)
end