Class: Fog::Rackspace::AutoScale::Groups

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/auto_scale/groups.rb

Instance Method Summary collapse

Instance Method Details

#allFog::Rackspace::AutoScale::Groups

Returns list of autoscale groups

Returns:

Raises:

  • (Fog::Rackspace::AutoScale:::NotFound)
    • HTTP 404

  • (Fog::Rackspace::AutoScale:::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::AutoScale:::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::AutoScale:::ServiceError)

See Also:


20
21
22
23
# File 'lib/fog/rackspace/models/auto_scale/groups.rb', line 20

def all
  data = service.list_groups.body['groups']
  load(data)
end

#get(group_id) ⇒ Fog::Rackspace::AutoScale::Group

Returns an individual autoscale group

Returns:

Raises:

  • (Fog::Rackspace::AutoScale:::NotFound)
    • HTTP 404

  • (Fog::Rackspace::AutoScale:::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::AutoScale:::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::AutoScale:::ServiceError)

See Also:


36
37
38
39
40
41
# File 'lib/fog/rackspace/models/auto_scale/groups.rb', line 36

def get(group_id)
  data = service.get_group(group_id).body['group']
  new(data)
rescue Fog::Rackspace::AutoScale::NotFound
  nil
end