Sha256: d0b3f0d26640305daa2a2e28789a729ce8a9b6e8568f78f9b3caea308a78b878

Contents?: true

Size: 1.47 KB

Versions: 17

Compression:

Stored size: 1.47 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 { |p| p['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

17 entries across 17 versions & 4 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.1.2 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog_tractical-1.1.4 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog_tractical-1.1.3 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.1.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.1.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
tag-fog-1.0.1 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-1.0.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-0.11.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb
fog-0.10.0 lib/fog/aws/requests/elb/delete_load_balancer_policy.rb