Class: Fog::Rackspace::AutoScale::GroupConfig
- Inherits:
-
Model
- Object
- Model
- 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.
Instance Method Summary collapse
-
#reload ⇒ Object
Reloads group configuration.
-
#save ⇒ Boolean
Saves group configuration.
-
#update ⇒ Boolean
Update this group’s configuration.
Instance Attribute Details
#cooldown ⇒ String (readonly)
Returns The group’s cooldown.
17 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 17 attribute :cooldown |
#group ⇒ Fog::Rackspace::AutoScale::Group (readonly)
Returns The parent group.
9 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 9 attribute :group |
#max_entities ⇒ Fixnum (readonly)
Returns The maximum amount of units which should exist in the group.
25 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 25 attribute :max_entities, :aliases => 'maxEntities' |
#metadata ⇒ Hash (readonly)
Returns The group’s metadata.
29 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 29 attribute :metadata |
#min_entities ⇒ Fixnum (readonly)
Returns The minimum amount of units which should exist in the group.
21 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 21 attribute :min_entities, :aliases => 'minEntities' |
#name ⇒ String (readonly)
Returns The name of the group.
13 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 13 attribute :name |
Instance Method Details
#reload ⇒ Object
Reloads group configuration
67 68 69 70 71 72 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 67 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
57 58 59 60 61 62 63 64 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 57 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
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fog/rackspace/models/auto_scale/group_config.rb', line 41 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 |