Class: Netscaler::Cs::Vserver::Unbind
- Inherits:
-
NetscalerService
- Object
- NetscalerService
- Netscaler::Cs::Vserver::Unbind
- Defined in:
- lib/netscaler/cs/vserver/unbind.rb
Instance Method Summary collapse
-
#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”,.
-
#initialize(netscaler) ⇒ Unbind
constructor
A new instance of Unbind.
Methods inherited from NetscalerService
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",
}
}
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 |