Class: Netscaler::System::File

Inherits:
NetscalerService show all
Defined in:
lib/netscaler/system/file.rb

Instance Method Summary collapse

Methods inherited from NetscalerService

#validate_payload

Constructor Details

#initialize(netscaler) ⇒ File

Returns a new instance of File.



6
7
8
# File 'lib/netscaler/system/file.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/system/file.rb', line 10

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