Class: Netscaler::Ssl::Certkey

Inherits:
NetscalerService show all
Defined in:
lib/netscaler/ssl/certkey.rb

Instance Method Summary collapse

Methods inherited from NetscalerService

#validate_payload

Constructor Details

#initialize(netscaler) ⇒ Certkey

Returns a new instance of Certkey.



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

def initialize(netscaler)
  @netscaler = netscaler
end

Instance Method Details

#add(payload = {}) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/netscaler/ssl/certkey.rb', line 10

def add(payload={})
  raise ArgumentError, 'payload cannot be null' if payload.nil?
  validate_payload(payload, [:certkey, :cert, :key])
  return @netscaler.adapter.post('config/sslcertkey', { 'sslcertkey' => payload })
end

#remove(payload = {}) ⇒ Object

Raises:

  • (ArgumentError)


16
17
18
19
20
# File 'lib/netscaler/ssl/certkey.rb', line 16

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