Method: Interface#initialize

Defined in:
lib/zapix/zabbix_classes/interface.rb

#initialize(attributes) ⇒ Interface

for more info see

https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions#host_interface

we assume ip and dns shall always be set



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/zapix/zabbix_classes/interface.rb', line 8

def initialize(attributes)
  @type = attributes['type'] ||= 1
  @main = attributes['main'] ||= 1
  @useip = attributes['useip'] ||= 1
  @ip = attributes['ip'] = attributes['ip']
  @dns = attributes['dns'] = attributes['dns']
  @port = attributes['port'] = attributes['port'] ||= 10_050
  @result = {
    'type' => type,
    'main' => main,
    'useip' => useip,
    'ip' => ip,
    'dns' => dns,
    'port' => port
  }
end