Class: Netscaler::Cs::Vserver::Unbind

Inherits:
NetscalerService show all
Defined in:
lib/netscaler/cs/vserver/unbind.rb

Instance Method Summary collapse

Methods inherited from NetscalerService

#validate_payload

Constructor Details

#initialize(netscaler) ⇒ Unbind

Returns a new instance of Unbind.



5
6
7
# File 'lib/netscaler/cs/vserver/unbind.rb', line 5

def initialize(netscaler)
  @netscaler=netscaler
end

Instance Method Details

#cs_policy(payload) ⇒ Object

object=

    {
        'params': {'action':'bind'},
    "csvserver_cspolicy_binding":
    {
        "name":"cs_test_80",
    "targetvserver":"lb_thumby_80",
    "policyname": "cs_test_rule",
    "priority": "800",

}
}

Raises:

  • (ArgumentError)


25
26
27
28
29
30
# File 'lib/netscaler/cs/vserver/unbind.rb', line 25

def cs_policy(payload)
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:name])
  # Need to find a way to throw optional args as well, including :policyname and :priority
  return @netscaler.adapter.post_no_body("config/csvserver_cspolicy_binding/#{payload['name']}?action=unbind/", {'params' => {'action' => 'unbind'}, 'csvserver_cspolicy_binding' => payload})
end