Class: Fog::Rackspace::AutoScale::LaunchConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

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

Returns The arguments for the operation.

Returns:



17
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 17

attribute :args

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

Returns The parent group.

Returns:



9
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 9

attribute :group

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

Returns The type of operation (usually “launch_server”).

Returns:



13
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 13

attribute :type

Instance Method Details

#reloadObject

Reloads group launch configuration



52
53
54
55
56
57
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 52

def reload
  if group.id
    data = service.get_launch_config(group.id)
    merge_attributes data.body['launchConfiguration']
  end
end

#saveBoolean

Saves group launch configuration. This method will only save existing group configurations. New group configurations are created when a scaling group is created

Returns:

  • (Boolean)

    true if launch group was saved



42
43
44
45
46
47
48
49
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 42

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

#updateBoolean

Update this group’s launch configuration

Returns:

  • (Boolean)

    returns true if launch 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:



29
30
31
32
33
34
35
36
# File 'lib/fog/rackspace/models/auto_scale/launch_config.rb', line 29

def update
  options = {}
  options['type'] = type unless type.nil?
  options['args'] = args unless args.nil?

  service.update_launch_config(group.id, options)
  true
end