Sha256: 3fbe2a73411a0ffcd13bad7a98548463c74fc160a09fe31d17d20c4be20cf1ae

Contents?: true

Size: 1.42 KB

Versions: 15

Compression:

Stored size: 1.42 KB

Contents

require 'netscaler/netscaler_service'

module Netscaler
  class LoadBalancing < NetscalerService
    def initialize(netscaler)
      @netscaler=netscaler
    end

    def get_lbvserver(args={})
      return @netscaler.adapter.get("config/lbvserver/#{args[:name]}", args)
    end

    def get_lbvservers()
      return @netscaler.adapter.get("config/lbvserver/")
    end

    def get_lbvserver_binding(payload)
      return @netscaler.adapter.get("config/lbvserver_binding/#{payload}")
    end

    def add_lbvserver(payload)
      raise ArgumentError, 'payload cannot be null' if payload.nil?
      validate_payload(payload, %w(name serviceType ipv46 port))
      return @netscaler.adapter.post_no_body('config/lbvserver/', {'lbvserver' => payload})
    end

    def add_lbvserver_servicegroup_binding(payload)
      raise ArgumentError, 'payload cannot be null' if payload.nil?
      validate_payload(payload, %w(name servicegroupname))
      return @netscaler.adapter.post_no_body("config/lbvserver_servicegroup_binding/#{payload['name']}?action=bind/", {'lbvserver_servicegroup_binding' => payload})
    end

    def add_lbvserver_service_binding(payload)
      raise ArgumentError, 'payload cannot be null' if payload.nil?
      validate_payload(payload, %w(name servicename))
      return @netscaler.adapter.post_no_body("config/lbvserver_service_binding/#{payload['name']}?action=bind/", {'lbvserver_service_binding' => payload})
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
netscaler-0.8.3 lib/netscaler/load_balancing.rb
netscaler-0.8.2 lib/netscaler/load_balancing.rb
netscaler-0.8.1 lib/netscaler/load_balancing.rb
netscaler-0.8.0 lib/netscaler/load_balancing.rb
netscaler-0.7.1 lib/netscaler/load_balancing.rb
netscaler-0.6.0 lib/netscaler/load_balancing.rb
netscaler-0.5.2 lib/netscaler/load_balancing.rb
netscaler-0.5.1 lib/netscaler/load_balancing.rb
netscaler-0.5.0 lib/netscaler/load_balancing.rb
netscaler-0.4.0 lib/netscaler/load_balancing.rb
netscaler-0.3.2 lib/netscaler/load_balancing.rb
netscaler-0.3.1 lib/netscaler/load_balancing.rb
netscaler-0.3.0 lib/netscaler/load_balancing.rb
netscaler-0.2.0 lib/netscaler/load_balancing.rb
netscaler-0.1.0 lib/netscaler/load_balancing.rb