Class: Netscaler::ServiceGroup::Request

Inherits:
BaseRequest show all
Defined in:
lib/netscaler/servicegroup/request.rb

Instance Attribute Summary

Attributes inherited from BaseRequest

#client

Instance Method Summary collapse

Methods inherited from BaseRequest

#initialize

Methods included from Logging

configure, log, #log

Constructor Details

This class inherits a constructor from Netscaler::BaseRequest

Instance Method Details

#bind(servicegroup, options) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/netscaler/servicegroup/request.rb', line 22

def bind(servicegroup, options)
  params = {
    :name => options[:vserver],
    :servicegroupname => servicegroup
  }
  send_request('bindlbvserver_servicegroup', params)
end

#disable(servicegroup, options) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/netscaler/servicegroup/request.rb', line 14

def disable(servicegroup, options)
  params = { :servicegroupname => servicegroup }
  [:servername, :port, :delay].each do |option|
    params[option] = options[option] if options[option]
  end
  send_request('disableservicegroup', params)
end

#enable(service, options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/netscaler/servicegroup/request.rb', line 6

def enable(service, options)
  params = { :servicegroupname => service }
  [:servername, :port].each do |option|
    params[option] = options[option] if options[option]
  end
  send_request('enableservicegroup', params)
end

#status(servicegroup, options) ⇒ Object



38
39
40
41
42
43
# File 'lib/netscaler/servicegroup/request.rb', line 38

def status(servicegroup, options)
  params = { :servicegroupname => servicegroup }
  send_request('getservicegroup', params) do |response|
    yield Response.new(response).to_hash if block_given?
  end
end

#unbind(servicegroup, options) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/netscaler/servicegroup/request.rb', line 30

def unbind(servicegroup, options)
  params = {
    :name => options[:vserver],
    :servicename => servicegroup
  }
  send_request('unbindlbvserver_servicegroup', params)
end