Sha256: 903187ced8abdb7f06aae871bee8bb7fd7c4cf9a0a9a2e8b3e695a36eaec830d

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

module Fog
  module Compute
    class OneAndOne

      class Real

        ##
        # Returns a list of IPs assigned to a load balancer
        # URL: [https://cloudpanel-api.1and1.com/documentation/1and1/v1/en/documentation.html#load_balancers__load_balancer_id__server_ips_get]
        ##
        def list_load_balancer_ips(load_balancer_id)
          
          params = {
            'method' => :get,
            'endpoint' => "/load_balancers/#{load_balancer_id}/server_ips"
          }

          request(params)

        end

      end # Real

      
      class Mock

        def list_load_balancer_ips(load_balancer_id)
          
          # Search for load balancer to return
          if load_balancer = self.data[:load_balancers].find {
            |hash| hash['id'] == load_balancer_id
          }
          else
            raise Fog::Errors::NotFound.new('The requested resource could
              not be found.')
          end

          # Return Response Object to User
          response = Excon::Response.new
          response.status = 202
          response.body = load_balancer['server_ips']
          response

        end

      end # Mock

    end # OneAndOne
  end # Compute
end # Fog

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-oneandone-1.2 lib/oneandone/requests/compute/list_load_balancer_ips.rb
fog-oneandone-1.0 lib/oneandone/requests/compute/list_load_balancer_ips.rb