Class: Fog::Rackspace::AutoScale::GroupConfig

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

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

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::Model

Instance Attribute Details

#cooldownString (readonly)

Returns The group’s cooldown.

Returns:

  • (String)

    The group’s cooldown



18
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 18

attribute :cooldown

#groupFog::Rackspace::AutoScale::Group (readonly)

Returns The parent group.

Returns:



10
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 10

attribute :group

#max_entitiesFixnum (readonly)

Returns The maximum amount of units which should exist in the group.

Returns:

  • (Fixnum)

    The maximum amount of units which should exist in the group



26
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 26

attribute :max_entities, :aliases => 'maxEntities'

#metadataHash (readonly)

Returns The group’s metadata.

Returns:

  • (Hash)

    The group’s metadata



30
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 30

attribute :metadata

#min_entitiesFixnum (readonly)

Returns The minimum amount of units which should exist in the group.

Returns:

  • (Fixnum)

    The minimum amount of units which should exist in the group



22
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 22

attribute :min_entities, :aliases => 'minEntities'

#nameString (readonly)

Returns The name of the group.

Returns:

  • (String)

    The name of the group



14
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 14

attribute :name

Instance Method Details

#updateBoolean

Update this group’s configuration

Returns:

  • (Boolean)

    returns true if group config has been updated

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:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 42

def update
  
  options = {}

  options['name'] = name unless name.nil?
  options['cooldown'] = cooldown unless cooldown.nil?
  options['minEntities'] = min_entities
  options['maxEntities'] = max_entities
  options['metadata'] =  unless .nil?

  data = service.update_group_config(group.id, options)
  merge_attributes(data.body)
  true
end