lib/as/right_as_interface.rb
# Create or update specified trigger.
# This call sets the parameters that governs when and how to scale an AutoScalingGroup.
# If the Trigger, within the scope of the caller's AWS account, specified already exists,
# it will be updated. If a trigger with a different name already exists, this call will fail.
#
# Returns +true+ or an exception.
#
# Options: +:measure_name+, +:statistic+, +:period+, +:lower_threshold+, +:lower_breach_scale_increment+,
# +:upper_threshold+, +:upper_breach_scale_increment+, +:dimensions+, +:breach_duration+, +:unit+, +:custom_unit+
#
#  as.create_or_update_scaling_trigger('kd.tr.1', 'CentOS.5.1-c-array',
#                                      :measure_name => 'CPUUtilization',
#                                      :statistic => :average,
#                                      :dimensions => {
#                                         'AutoScalingGroupName' => 'CentOS.5.1-c-array',
#                                         'Namespace' => 'AWS',
#                                         'Service' => 'EC2' },
#                                      :period => 60,
#                                      :lower_threshold => 5,
#                                      :lower_breach_scale_increment => -1,
#                                      :upper_threshold => 60,
#                                      :upper_breach_scale_increment => 1,
#                                      :breach_duration => 300 ) #=> true
#
Create or update specified trigger.
This call sets the parameters that governs when and how to scale an AutoScalingGroup.
If the Trigger, within the scope of the caller's AWS account, specified already exists,
it will be updated. If a trigger with a different name already exists, this call will fail.

Returns +true+ or an exception.




Create or update specified trigger . This call sets the parameters that governs when and how to scale an AutoScalingGroup . If the Trigger within the scope of the caller ' s AWS account specified already exists it will be updated . If a trigger with a different name already exists this call will fail . Returns + true + or an exception .
def create_or_update_scaling_trigger(trigger_name, auto_scaling_group_name, options={})
      request_hash = { 'TriggerName'               => trigger_name,
                       'AutoScalingGroupName'      => auto_scaling_group_name,
                       'MeasureName'               => options[:measure_name],
                       'Statistic'                 => options[:statistic].to_s.capitalize,
                       'Period'                    => options[:period],
                       'LowerThreshold'            => options[:lower_threshold],
                       'LowerBreachScaleIncrement' => options[:lower_breach_scale_increment],
                       'UpperThreshold'            => options[:upper_threshold],
                       'UpperBreachScaleIncrement' => options[:upper_breach_scale_increment],
                       'BreachDuration'            => options[:breach_duration] }
      request_hash['Unit']       = options[:unit]        if options[:unit]
      request_hash['CustomUnit'] = options[:custom_unit] if options[:custom_unit]
      dimensions = []
      (options[:dimensions] || {}).each do |key, values|
        Array(values).each { |value| dimensions << [key, value] }
      end
      request_hash.merge!(amazonize_list(['Dimensions.member.?.Name', 'Dimensions.member.?.Value'], dimensions))
      link = generate_request("CreateOrUpdateScalingTrigger", request_hash)
      request_info(link, RightHttp2xxParser.new(:logger => @logger))
    end
def create_or_update_scaling_trigger ( trigger_name , auto_scaling_group_name , options = { } ) request_hash = { 'TriggerName' => trigger_name , 'AutoScalingGroupName' => auto_scaling_group_name , 'MeasureName' => options [ :measure_name ] , 'Statistic' => options [ :statistic ] . to_s . capitalize , 'Period' => options [ :period ] , 'LowerThreshold' => options [ :lower_threshold ] , 'LowerBreachScaleIncrement' => options [ :lower_breach_scale_increment ] , 'UpperThreshold' => options [ :upper_threshold ] , 'UpperBreachScaleIncrement' => options [ :upper_breach_scale_increment ] , 'BreachDuration' => options [ :breach_duration ] } request_hash [ 'Unit' ] = options [ :unit ] if options [ :unit ] request_hash [ 'CustomUnit' ] = options [ :custom_unit ] if options [ :custom_unit ] dimensions = [ ] ( options [ :dimensions ] || { } ) . each do | key , values | Array ( values ) . each { | value | dimensions << [ key , value ] } end request_hash . merge! ( amazonize_list ( [ 'Dimensions.member.?.Name' , 'Dimensions.member.?.Value' ] , dimensions ) ) link = generate_request ( "CreateOrUpdateScalingTrigger" , request_hash ) request_info ( link , RightHttp2xxParser . new ( :logger => @logger ) ) end
Create or update specified trigger.
Create or update specified trigger .
trigger_name
<not_specific>
auto_scaling_group_name
<not_specific>
options
<not_specific>