Class: Netscaler::LoadBalancing
- Inherits:
-
NetscalerService
- Object
- NetscalerService
- Netscaler::LoadBalancing
- Defined in:
- lib/netscaler/load_balancing.rb
Instance Method Summary collapse
- #add_lbvserver(payload) ⇒ Object
- #add_lbvserver_service_binding(payload) ⇒ Object
- #add_lbvserver_servicegroup_binding(payload) ⇒ Object
- #get_lbvserver(args = {}) ⇒ Object
- #get_lbvserver_binding(payload) ⇒ Object
- #get_lbvservers ⇒ Object
-
#initialize(netscaler) ⇒ LoadBalancing
constructor
A new instance of LoadBalancing.
Methods inherited from NetscalerService
Constructor Details
#initialize(netscaler) ⇒ LoadBalancing
Returns a new instance of LoadBalancing.
5 6 7 |
# File 'lib/netscaler/load_balancing.rb', line 5 def initialize(netscaler) @netscaler=netscaler end |
Instance Method Details
#add_lbvserver(payload) ⇒ Object
21 22 23 24 25 |
# File 'lib/netscaler/load_balancing.rb', line 21 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 |
#add_lbvserver_service_binding(payload) ⇒ Object
33 34 35 36 37 |
# File 'lib/netscaler/load_balancing.rb', line 33 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 |
#add_lbvserver_servicegroup_binding(payload) ⇒ Object
27 28 29 30 31 |
# File 'lib/netscaler/load_balancing.rb', line 27 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 |
#get_lbvserver(args = {}) ⇒ Object
9 10 11 |
# File 'lib/netscaler/load_balancing.rb', line 9 def get_lbvserver(args={}) return @netscaler.adapter.get("config/lbvserver/#{args[:name]}", args) end |
#get_lbvserver_binding(payload) ⇒ Object
17 18 19 |
# File 'lib/netscaler/load_balancing.rb', line 17 def get_lbvserver_binding(payload) return @netscaler.adapter.get("config/lbvserver_binding/#{payload}") end |
#get_lbvservers ⇒ Object
13 14 15 |
# File 'lib/netscaler/load_balancing.rb', line 13 def get_lbvservers() return @netscaler.adapter.get("config/lbvserver/") end |