Sha256: f81861581b1cdc365c456fff827152b0ab0801f8548d40edb965c25d79b703a3

Contents?: true

Size: 1.79 KB

Versions: 98

Compression:

Stored size: 1.79 KB

Contents

module Fog
  module AWS
    class AutoScaling
      class Real
        require 'fog/aws/parsers/auto_scaling/basic'

        # Disables monitoring of group metrics for the Auto Scaling group
        # specified in AutoScalingGroupName. You can specify the list of
        # affected metrics with the Metrics parameter.
        #
        # ==== Parameters
        # * 'AutoScalingGroupName'<~String> - The name or ARN of the Auto
        #   Scaling group.
        # * options<~Hash>:
        #   * Metrics<~Array> - The list of metrics to disable. If no metrics
        #     are specified, all metrics are disabled.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DisableMetricsCollection.html
        #
        def disable_metrics_collection(auto_scaling_group_name, options = {})
          if metrics = options.delete('Metrics')
            options.merge!(AWS.indexed_param('Metrics.member.%d', [*metrics]))
          end
          request({
            'Action'               => 'DisableMetricsCollection',
            'AutoScalingGroupName' => auto_scaling_group_name,
            :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
          }.merge!(options))
        end
      end

      class Mock
        def disable_metrics_collection(auto_scaling_group_name, options = {})
          unless self.data[:auto_scaling_groups].key?(auto_scaling_group_name)
            Fog::AWS::AutoScaling::ValidationError.new("Group #{auto_scaling_group_name} not found")
          end

          Fog::Mock.not_implemented
        end
      end
    end
  end
end

Version data entries

98 entries across 96 versions & 6 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.29.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.28.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.27.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.26.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.25.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.24.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.23.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.22.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.21.1 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.21.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.20.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.19.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.18.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.17.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.16.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.15.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.14.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.13.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
fog-aws-3.12.0 lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb