Class: Fog::OpenStack::Compute::ServerGroups

Inherits:
Fog::OpenStack::Collection show all
Defined in:
lib/fog/openstack/compute/models/server_groups.rb

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/fog/openstack/compute/models/server_groups.rb', line 10

def all(options = {})
  load_response(service.list_server_groups(options), 'server_groups')
end

#create(*args) ⇒ Object



22
23
24
# File 'lib/fog/openstack/compute/models/server_groups.rb', line 22

def create(*args)
  new(service.create_server_group(*args).body['server_group'])
end

#get(server_group_id) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/fog/openstack/compute/models/server_groups.rb', line 14

def get(server_group_id)
  if server_group_id
    new(service.get_server_group(server_group_id).body['server_group'])
  end
rescue Fog::OpenStack::Compute::NotFound
  nil
end