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

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

Instance Attribute Summary

Attributes inherited from Collection

#service

Instance Method Summary collapse

Methods inherited from Collection

#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Collection

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:



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

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:



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

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