Sha256: e38a055235218a851c37e8c2c1aa88e8082a3be435a309d6f8f19700193f1d17

Contents?: true

Size: 1.74 KB

Versions: 27

Compression:

Stored size: 1.74 KB

Contents

module Fog
  module Rackspace
    class LoadBalancers
      class Real
        def get_load_balancer(load_balancer_id)
          request(
            :expects => 200,
            :path => "loadbalancers/#{load_balancer_id}.json",
            :method => 'GET'
          )
         end
      end

      class Mock
        def get_load_balancer(load_balancer_id)
          response = Excon::Response.new
          response.status = 200
          response.body =  {
            "loadBalancer"=> {
              "name"=>"load_balancer_#{load_balancer_id}",
              "id"=> load_balancer_id,
              "protocol"=>"HTTP",
              "port"=>80,
              "algorithm"=>"RANDOM",
              "status"=>"ACTIVE",
              "cluster"=>{"name"=>"my-cluster.rackspace.net"},
              "nodes"=>[{"address"=> MockData.ipv4_address, "id"=> Fog::Mock.random_numbers(6), "type"=>"PRIMARY", "port"=>80, "status"=>"ONLINE", "condition"=>"ENABLED"}],
              "timeout"=>30,
              "created"=>{"time"=>MockData.zulu_time},
              "virtualIps"=>[
                {"address"=> MockData.ipv4_address, "id"=>Fog::Mock.random_numbers(4), "type"=>"PUBLIC", "ipVersion"=>"IPV4"},
                {"address"=> MockData.ipv6_address, "id"=>Fog::Mock.random_numbers(4), "type"=>"PUBLIC", "ipVersion"=>"IPV6"}],
              "sourceAddresses"=>{"ipv6Public"=> MockData.ipv6_address, "ipv4Servicenet"=> MockData.ipv4_address, "ipv4Public"=> MockData.ipv4_address},
              "updated"=>{"time"=>"2013-09-04T06:29:09Z"},
              "halfClosed"=>false,
              "connectionLogging"=>{"enabled"=>false},
              "contentCaching"=>{"enabled"=>false},
              "httpsRedirect"=>false}}
            response
         end
      end
    end
  end
end

Version data entries

27 entries across 25 versions & 5 rubygems

Version Path
fog-rackspace-0.1.6 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-rackspace-0.1.5/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.5 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.4 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.3 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.2 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.1 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-rackspace-0.1.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.37.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.36.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.35.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-2.0.0.pre.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.34.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.33.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.32.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.31.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.30.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb