Sha256: ecc0536e52718a0aa9fd08462a67da98551423d249f5469fdcc7116e0a817943

Contents?: true

Size: 1.54 KB

Versions: 107

Compression:

Stored size: 1.54 KB

Contents

module Fog
  module AWS
    class ELB
      class Real

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

        # Delet Elastic Load Balancer Listeners
        #
        # ==== Parameters
        # * lb_name<~String> - Name for the new ELB -- must be unique
        # * load_balancer_ports<~Array> - Array of client port numbers of the LoadBalancerListeners to remove
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        def delete_load_balancer_listeners(lb_name, load_balancer_ports)
          params = Fog::AWS.indexed_param('LoadBalancerPorts.member.%d', load_balancer_ports)

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

      end

      class Mock
        def delete_load_balancer_listeners(lb_name, load_balancer_ports)
          raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]

          response = Excon::Response.new
          response.status = 200

          load_balancer['ListenerDescriptions'].delete_if { |listener| load_balancer_ports.include? listener['Listener']['LoadBalancerPort'] }

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

          response
        end
      end
    end
  end
end

Version data entries

107 entries across 107 versions & 17 rubygems

Version Path
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
gapinc-fog-1.12.1.2.1 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-1.18.0 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-1.17.0 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb
fog-1.16.0 lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb