Sha256: fdd094d7559fc3d37be0fa09ed9e2195344ad528aff2aabde30584c6ecfc9ed2

Contents?: true

Size: 1.3 KB

Versions: 30

Compression:

Stored size: 1.3 KB

Contents

module Fog
  module Network
    class OpenStack
      class Real
        def update_lbaas_l7rule(l7policy_id, l7rule_id, options = {})

          data = { 'rule' => {} }

          vanilla_options = [:type, :compare_type, :key, :value, :invert]
          vanilla_options.select { |o| options.key?(o) }.each do |key|
            data['rule'][key] = options[key]
          end

          request(
            :body    => Fog::JSON.encode(data),
            :expects => [200],
            :method  => 'PUT',
            :path    => "lbaas/l7policies/#{l7policy_id}/rules/#{l7rule_id}"
          )
        end
      end

      class Mock
        def update_lbaas_l7rule(l7policy_id, l7rule_id, options = {})
          response = Excon::Response.new
          if l7rule = list_l7rules.body['l7rules'].find { |_| _['id'] == l7rule_id }
            l7rule['type']           = options[:type]
            l7rule['compare_type']   = options[:compare_type]
            l7rule['key']            = options[:key]
            l7rule['value']          = options[:value]
            l7rule['invert']         = options[:invert]
            response.body = {'rule' => l7rule}
            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.27 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-openstack-0.1.26/lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-openstack-0.1.26/lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-openstack-0.1.26/lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.26 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.25 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.24 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.23 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.22 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.21 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb