Sha256: 8ae627fa5df9f3fabc3402fe127cbce02d0e3e6ae2a05a448085eb834353a2c1

Contents?: true

Size: 1.48 KB

Versions: 90

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module AWS
    class ELB
      class Real

        require 'fog/aws/parsers/elb/empty'

        # Delete a Load Balancer Stickiness Policy
        #
        # ==== Parameters
        # * lb_name<~String> - Name of the ELB
        # * policy_name<~String> - The name of the policy to delete
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        def delete_load_balancer_policy(lb_name, policy_name)
          params = {'PolicyName' => policy_name}

          request({
            'Action'           => 'DeleteLoadBalancerPolicy',
            'LoadBalancerName' => lb_name,
            :parser            => Fog::Parsers::AWS::ELB::Empty.new
          }.merge!(params))
        end

      end

      class Mock
        def delete_load_balancer_policy(lb_name, policy_name)
          if load_balancer = self.data[:load_balancers][lb_name]
            response = Excon::Response.new
            response.status = 200

            load_balancer['Policies'].each do |name, policies|
              policies.delete_if { |policy| policy['PolicyName'] == policy_name }
            end

            response.body = {
              'ResponseMetadata' => {
                'RequestId' => Fog::AWS::Mock.request_id
              }
            }

            response
          else
            raise Fog::AWS::ELB::NotFound
          end
        end
      end
    end
  end
end

Version data entries

90 entries across 90 versions & 15 rubygems

Version Path
fog-maestrodev-1.15.0.20130927082724 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.15.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
gapinc-fog-1.14.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.14.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.13.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.12.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.12.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
hpfog-0.0.20 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-nirvanix-1.8.2 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.11.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.11.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb