Class: Netscaler::Ssl::Vserver

Inherits:
NetscalerService show all
Defined in:
lib/netscaler/ssl/vserver.rb,
lib/netscaler/ssl/vserver/bind.rb,
lib/netscaler/ssl/vserver/unbind.rb

Defined Under Namespace

Classes: Bind, Unbind

Instance Method Summary collapse

Methods inherited from NetscalerService

#validate_payload

Constructor Details

#initialize(netscaler) ⇒ Vserver

Returns a new instance of Vserver.



6
7
8
# File 'lib/netscaler/ssl/vserver.rb', line 6

def initialize(netscaler)
  @netscaler=netscaler
end

Instance Method Details

#add(payload) ⇒ Object

Raises:

  • (ArgumentError)


33
34
35
36
37
# File 'lib/netscaler/ssl/vserver.rb', line 33

def add(payload)
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:name, :serviceType, :ipv46, :port])
  return @netscaler.adapter.post_no_body('config/sslvserver/', {'sslvserver' => payload})
end

#bindObject



51
52
53
# File 'lib/netscaler/ssl/vserver.rb', line 51

def bind
  Bind.new @netscaler
end

#remove(payload) ⇒ Object

:args: :name

Raises:

  • (ArgumentError)


27
28
29
30
31
# File 'lib/netscaler/ssl/vserver.rb', line 27

def remove(payload) # :args: :name
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:name])
  return @netscaler.adapter.delete("config/sslvserver/#{payload[:name]}")
end

#show(payload = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/netscaler/ssl/vserver.rb', line 10

def show(payload={})
  if payload[:name] != nil then
    validate_payload(payload, [:name])
    return @netscaler.adapter.get("config/sslvserver/#{payload[:name]}")
  elsif payload == {} then
    return @netscaler.adapter.get('config/sslvserver/')
  else
    raise ArgumentError, 'payload supplied must have been missing :name'
  end
end

#show_binding(payload) ⇒ Object

Raises:

  • (ArgumentError)


21
22
23
24
25
# File 'lib/netscaler/ssl/vserver.rb', line 21

def show_binding(payload)
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:name])
  return @netscaler.adapter.get("config/sslvserver_binding/#{payload[:name]}")
end

#stat(payload) ⇒ Object

Raises:

  • (ArgumentError)


45
46
47
48
49
# File 'lib/netscaler/ssl/vserver.rb', line 45

def stat(payload)
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:name])
  return @netscaler.adapter.get("stat/sslvserver/#{payload[:name]}")
end

#unbindObject



55
56
57
# File 'lib/netscaler/ssl/vserver.rb', line 55

def unbind
  Unbind.new @netscaler
end

#update(payload) ⇒ Object

Raises:

  • (ArgumentError)


39
40
41
42
43
# File 'lib/netscaler/ssl/vserver.rb', line 39

def update(payload)
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:vservername])
  return @netscaler.adapter.put('config/sslvserver/', {'sslvserver' => payload}, {no_wrapper: true})
end