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.31 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.10 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.30 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.29 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.9 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.1.28 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.8 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.7 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.6 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.5 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.4 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.3 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.2 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.3.0 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.2.4 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.2.3 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.2.2 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.2.1 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-openstack-0.2.0 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb
fog-zj-0.1.28 lib/fog/network/openstack/requests/update_lbaas_l7rule.rb