Class: Fog::Rackspace::AutoScale::LaunchConfig
- Defined in:
- lib/fog/rackspace/models/auto_scale/launch_config.rb
Instance Attribute Summary collapse
-
#args ⇒ Fog::Rackspace::AutoScale::Group
readonly
The arguments for the operation.
-
#group ⇒ Fog::Rackspace::AutoScale::Group
readonly
The parent group.
-
#type ⇒ Fog::Rackspace::AutoScale::Group
readonly
The type of operation (usually “launch_server”).
Attributes inherited from Model
Instance Method Summary collapse
-
#reload ⇒ Object
Reloads group launch configuration.
-
#save ⇒ Boolean
Saves group launch configuration.
-
#update ⇒ Boolean
Update this group’s launch 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
#args ⇒ Fog::Rackspace::AutoScale::Group (readonly)
Returns The arguments for the operation.
18 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 18 attribute :args |
#group ⇒ Fog::Rackspace::AutoScale::Group (readonly)
Returns The parent group.
10 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 10 attribute :group |
#type ⇒ Fog::Rackspace::AutoScale::Group (readonly)
Returns The type of operation (usually “launch_server”).
14 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 14 attribute :type |
Instance Method Details
#reload ⇒ Object
Reloads group launch configuration
54 55 56 57 58 59 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 54 def reload if group.id data = service.get_launch_config(group.id) merge_attributes data.body['launchConfiguration'] end end |
#save ⇒ Boolean
Saves group launch configuration. This method will only save existing group configurations. New group configurations are created when a scaling group is created
44 45 46 47 48 49 50 51 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 44 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 launch configuration
30 31 32 33 34 35 36 37 38 |
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 30 def update = {} ['type'] = type unless type.nil? ['args'] = args unless args.nil? service.update_launch_config(group.id, ) true end |