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-maestrodev-1.15.0.20130927082724 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.15.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
gapinc-fog-1.14.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.14.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.13.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/auto_scaling/delete_policy.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/auto_scaling/delete_policy.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.12.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.12.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
hpfog-0.0.20 lib/fog/aws/requests/auto_scaling/delete_policy.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/auto_scaling/delete_policy.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-nirvanix-1.8.2 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.11.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-1.11.0 lib/fog/aws/requests/auto_scaling/delete_policy.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/auto_scaling/delete_policy.rb