Sha256: dae5bbb0d1c7c901a61df1bb25772fe0a7f1372e295da3a27f6d998d63e60c01

Contents?: true

Size: 1.71 KB

Versions: 40

Compression:

Stored size: 1.71 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}}}
            response
         end
      end

    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.21.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.20.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-1.19.0 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/rackspace/requests/load_balancers/get_load_balancer.rb