Class: Aws::CloudWatch::Alarm::Collection

Inherits:
Resources::Collection show all
Defined in:
gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb

Batch Actions collapse

Methods inherited from Resources::Collection

#each, #first, #limit, #size

Instance Method Details

#batch_delete!(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb', line 600

def batch_delete!(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:alarm_names] ||= []
    batch.each do |item|
      params[:alarm_names] << item.name
    end
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.delete_alarms(params)
    end
  end
  nil
end

#batch_disable_actions(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb', line 616

def batch_disable_actions(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:alarm_names] ||= []
    batch.each do |item|
      params[:alarm_names] << item.name
    end
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.disable_alarm_actions(params)
    end
  end
  nil
end

#batch_enable_actions(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb', line 632

def batch_enable_actions(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:alarm_names] ||= []
    batch.each do |item|
      params[:alarm_names] << item.name
    end
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.enable_alarm_actions(params)
    end
  end
  nil
end