Sha256: f13688f57e736d01d975ab78e4aeec1f01464c99921a787befc6653acbcae5fe

Contents?: true

Size: 1.6 KB

Versions: 72

Compression:

Stored size: 1.6 KB

Contents

module Fog
  module AWS
    class AutoScaling

      class Real

        require 'fog/aws/parsers/auto_scaling/basic'

        # Deletes a policy created by put_scaling_policy
        #
        # ==== Parameters
        # * auto_scaling_group_name<~String> - The name of the Auto Scaling
        #   group.
        # * policy_name<~String> - The name or PolicyARN of the policy you want
        #   to delete.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DeletePolicy.html
        #
        def delete_policy(auto_scaling_group_name, policy_name)
          request({
            'Action'               => 'DeletePolicy',
            'AutoScalingGroupName' => auto_scaling_group_name,
            'PolicyName'           => policy_name,
            :parser                => Fog::Parsers::AWS::AutoScaling::Basic.new
          })
        end

      end

      class Mock

        def delete_policy(auto_scaling_group_name, policy_name)
          unless self.data[:scaling_policies].delete(policy_name)
            raise Fog::AWS::AutoScaling::NotFound, "The scaling policy '#{policy_name}' does not exist."
          end

          response = Excon::Response.new
          response.status = 200
          response.body = {
            'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
          }
          response
        end

      end

    end
  end
end

Version data entries

72 entries across 72 versions & 9 rubygems

Version Path
fog-1.10.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-test-me-1.10.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.10.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.9.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/aws/requests/auto_scaling/delete_policy.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-sgonyea-1.8.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.8.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.7.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb