Class: Fog::Rackspace::AutoScale::GroupConfig
- Defined in:
- lib/fog/rackspace/models/auto_scale/group_config.rb
Instance Attribute Summary collapse
-
#cooldown ⇒ String
readonly
The group’s cooldown.
-
#group ⇒ Fog::Rackspace::AutoScale::Group
readonly
The parent group.
-
#max_entities ⇒ Fixnum
readonly
The maximum amount of units which should exist in the group.
-
#metadata ⇒ Hash
readonly
The group’s metadata.
-
#min_entities ⇒ Fixnum
readonly
The minimum amount of units which should exist in the group.
-
#name ⇒ String
readonly
The name of the group.
Attributes inherited from Model
Instance Method Summary collapse
-
#reload ⇒ Object
Reloads group configuration.
-
#save ⇒ Boolean
Saves group configuration.
-
#update ⇒ Boolean
Update this group’s configuration.
Methods inherited from Model
#initialize, #inspect, #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
#cooldown ⇒ String (readonly)
Returns The group’s cooldown.
18 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 18 attribute :cooldown |
#group ⇒ Fog::Rackspace::AutoScale::Group (readonly)
Returns The parent group.
10 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 10 attribute :group |
#max_entities ⇒ Fixnum (readonly)
Returns 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' |
#metadata ⇒ Hash (readonly)
Returns The group’s metadata.
30 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 30 attribute :metadata |
#min_entities ⇒ Fixnum (readonly)
Returns 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' |
#name ⇒ String (readonly)
Returns The name of the group.
14 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 14 attribute :name |
Instance Method Details
#reload ⇒ Object
Reloads group configuration
69 70 71 72 73 74 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 69 def reload if group.id data = service.get_group_config(group.id) merge_attributes data.body['groupConfiguration'] end end |
#save ⇒ Boolean
Saves group configuration. This method will only save existing group configurations. New group configurations are created when a scaling group is created
59 60 61 62 63 64 65 66 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 59 def save if group.id update true else raise "New #{self.class} are created when a new Fog::Rackspace::AutoScale::Group is created" end end |
#update ⇒ Boolean
Update this group’s configuration
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 42 def update = {} ['name'] = name unless name.nil? ['cooldown'] = cooldown unless cooldown.nil? ['minEntities'] = min_entities ['maxEntities'] = max_entities ['metadata'] = unless .nil? service.update_group_config(group.id, ) true end |