Sha256: 8ccc7c4bc9b94b9eec35c3fd4b10b869ee5dd763e6b2358ea086fc1e10b4f1b9

Contents?: true

Size: 1.53 KB

Versions: 30

Compression:

Stored size: 1.53 KB

Contents

module Fog
  module Network
    class OpenStack
      class Real
        def update_lbaas_listener(listener_id, options = {})

          data = { 'listener' => {} }

          vanilla_options = [:name, :description, :connection_limit, :default_tls_container_ref, :sni_container_refs,
                             :admin_state_up]
          vanilla_options.select { |o| options.key?(o) }.each do |key|
            data['listener'][key] = options[key]
          end

          request(
            :body    => Fog::JSON.encode(data),
            :expects => 200,
            :method  => 'PUT',
            :path    => "lbaas/listeners/#{listener_id}"
          )
        end
      end

      class Mock
        def update_lbaas_listener(listener_id, options = {})
          response = Excon::Response.new
          if listener = list_lbaas_listeners.body['listeners'].find { |_| _['id'] == listener_id }
            listener['name']                = options[:name]
            listener['description']         = options[:description]
            listener['connection_limit']    = options[:connection_limit]
            listener['default_tls_container_ref']    = options[:default_tls_container_ref]
            listener['sni_container_refs']  = options[:sni_container_refs]
            listener['admin_state_up']      = options[:admin_state_up]
            response.body = {'listener' => listener}
            response.status = 200
            response
          else
            raise Fog::Network::OpenStack::NotFound
          end
        end
      end
    end
  end
end

Version data entries

30 entries across 28 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.10 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.1.30 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.1.29 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.9 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.1.28 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.8 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.7 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.6 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.5 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.4 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.3 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.2 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.3.0 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.2.4 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.2.3 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.2.2 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.2.1 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-openstack-0.2.0 lib/fog/network/openstack/requests/update_lbaas_listener.rb
fog-zj-0.1.28 lib/fog/network/openstack/requests/update_lbaas_listener.rb