Class: MistApi::VpnPeerStat

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/vpn_peer_stat.rb

Overview

VpnPeerStat Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(is_active = SKIP, jitter = SKIP, last_seen = SKIP, latency = SKIP, loss = SKIP, mac = SKIP, mos = SKIP, mtu = SKIP, org_id = SKIP, peer_mac = SKIP, peer_port_id = SKIP, peer_router_name = SKIP, peer_site_id = SKIP, port_id = SKIP, router_name = SKIP, site_id = SKIP, type = SKIP, up = SKIP, uptime = SKIP) ⇒ VpnPeerStat

Returns a new instance of VpnPeerStat.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 145

def initialize(is_active = SKIP, jitter = SKIP, last_seen = SKIP,
               latency = SKIP, loss = SKIP, mac = SKIP, mos = SKIP,
               mtu = SKIP, org_id = SKIP, peer_mac = SKIP,
               peer_port_id = SKIP, peer_router_name = SKIP,
               peer_site_id = SKIP, port_id = SKIP, router_name = SKIP,
               site_id = SKIP, type = SKIP, up = SKIP, uptime = SKIP)
  @is_active = is_active unless is_active == SKIP
  @jitter = jitter unless jitter == SKIP
  @last_seen = last_seen unless last_seen == SKIP
  @latency = latency unless latency == SKIP
  @loss = loss unless loss == SKIP
  @mac = mac unless mac == SKIP
  @mos = mos unless mos == SKIP
  @mtu = mtu unless mtu == SKIP
  @org_id = org_id unless org_id == SKIP
  @peer_mac = peer_mac unless peer_mac == SKIP
  @peer_port_id = peer_port_id unless peer_port_id == SKIP
  @peer_router_name = peer_router_name unless peer_router_name == SKIP
  @peer_site_id = peer_site_id unless peer_site_id == SKIP
  @port_id = port_id unless port_id == SKIP
  @router_name = router_name unless router_name == SKIP
  @site_id = site_id unless site_id == SKIP
  @type = type unless type == SKIP
  @up = up unless up == SKIP
  @uptime = uptime unless uptime == SKIP
end

Instance Attribute Details

#is_activeTrueClass | FalseClass

Redundancy status of the associated interface

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 14

def is_active
  @is_active
end

#jitterFloat

Jitter in milliseconds

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 18

def jitter
  @jitter
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


22
23
24
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 22

def last_seen
  @last_seen
end

#latencyFloat

Latency in milliseconds

Returns:

  • (Float)


26
27
28
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 26

def latency
  @latency
end

#lossFloat

Packet loss in percentage

Returns:

  • (Float)


30
31
32
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 30

def loss
  @loss
end

#macString

Router mac address

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 34

def mac
  @mac
end

#mosFloat

Mean Opinion Score, a measure of the quality of the VPN link

Returns:

  • (Float)


38
39
40
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 38

def mos
  @mos
end

#mtuInteger

Mean Opinion Score, a measure of the quality of the VPN link

Returns:

  • (Integer)


42
43
44
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 42

def mtu
  @mtu
end

#org_idUUID | String

Mean Opinion Score, a measure of the quality of the VPN link

Returns:

  • (UUID | String)


46
47
48
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 46

def org_id
  @org_id
end

#peer_macString

Peer router mac address

Returns:

  • (String)


50
51
52
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 50

def peer_mac
  @peer_mac
end

#peer_port_idString

Peer router device interface

Returns:

  • (String)


54
55
56
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 54

def peer_port_id
  @peer_port_id
end

#peer_router_nameString

Peer router device interface

Returns:

  • (String)


58
59
60
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 58

def peer_router_name
  @peer_router_name
end

#peer_site_idUUID | String

Peer router device interface

Returns:

  • (UUID | String)


62
63
64
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 62

def peer_site_id
  @peer_site_id
end

#port_idString

Router device interface

Returns:

  • (String)


66
67
68
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 66

def port_id
  @port_id
end

#router_nameString

Router device interface

Returns:

  • (String)


70
71
72
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 70

def router_name
  @router_name
end

#site_idUUID | String

Router device interface

Returns:

  • (UUID | String)


74
75
76
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 74

def site_id
  @site_id
end

#typeString

‘ipsec`for SRX, `svr` for 128T

Returns:

  • (String)


78
79
80
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 78

def type
  @type
end

#upTrueClass | FalseClass

‘ipsec`for SRX, `svr` for 128T

Returns:

  • (TrueClass | FalseClass)


82
83
84
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 82

def up
  @up
end

#uptimeInteger

‘ipsec`for SRX, `svr` for 128T

Returns:

  • (Integer)


86
87
88
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 86

def uptime
  @uptime
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 173

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_active = hash.key?('is_active') ? hash['is_active'] : SKIP
  jitter = hash.key?('jitter') ? hash['jitter'] : SKIP
  last_seen = hash.key?('last_seen') ? hash['last_seen'] : SKIP
  latency = hash.key?('latency') ? hash['latency'] : SKIP
  loss = hash.key?('loss') ? hash['loss'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  mos = hash.key?('mos') ? hash['mos'] : SKIP
  mtu = hash.key?('mtu') ? hash['mtu'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  peer_mac = hash.key?('peer_mac') ? hash['peer_mac'] : SKIP
  peer_port_id = hash.key?('peer_port_id') ? hash['peer_port_id'] : SKIP
  peer_router_name =
    hash.key?('peer_router_name') ? hash['peer_router_name'] : SKIP
  peer_site_id = hash.key?('peer_site_id') ? hash['peer_site_id'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  router_name = hash.key?('router_name') ? hash['router_name'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP
  uptime = hash.key?('uptime') ? hash['uptime'] : SKIP

  # Create object from extracted values.
  VpnPeerStat.new(is_active,
                  jitter,
                  last_seen,
                  latency,
                  loss,
                  mac,
                  mos,
                  mtu,
                  org_id,
                  peer_mac,
                  peer_port_id,
                  peer_router_name,
                  peer_site_id,
                  port_id,
                  router_name,
                  site_id,
                  type,
                  up,
                  uptime)
end

.namesObject

A mapping from model property names to API property names.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 89

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['is_active'] = 'is_active'
  @_hash['jitter'] = 'jitter'
  @_hash['last_seen'] = 'last_seen'
  @_hash['latency'] = 'latency'
  @_hash['loss'] = 'loss'
  @_hash['mac'] = 'mac'
  @_hash['mos'] = 'mos'
  @_hash['mtu'] = 'mtu'
  @_hash['org_id'] = 'org_id'
  @_hash['peer_mac'] = 'peer_mac'
  @_hash['peer_port_id'] = 'peer_port_id'
  @_hash['peer_router_name'] = 'peer_router_name'
  @_hash['peer_site_id'] = 'peer_site_id'
  @_hash['port_id'] = 'port_id'
  @_hash['router_name'] = 'router_name'
  @_hash['site_id'] = 'site_id'
  @_hash['type'] = 'type'
  @_hash['up'] = 'up'
  @_hash['uptime'] = 'uptime'
  @_hash
end

.nullablesObject

An array for nullable fields



139
140
141
142
143
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 139

def self.nullables
  %w[
    last_seen
  ]
end

.optionalsObject

An array for optional fields



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 114

def self.optionals
  %w[
    is_active
    jitter
    last_seen
    latency
    loss
    mac
    mos
    mtu
    org_id
    peer_mac
    peer_port_id
    peer_router_name
    peer_site_id
    port_id
    router_name
    site_id
    type
    up
    uptime
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



231
232
233
234
235
236
237
238
239
240
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 231

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} is_active: #{@is_active.inspect}, jitter: #{@jitter.inspect}, last_seen:"\
  " #{@last_seen.inspect}, latency: #{@latency.inspect}, loss: #{@loss.inspect}, mac:"\
  " #{@mac.inspect}, mos: #{@mos.inspect}, mtu: #{@mtu.inspect}, org_id: #{@org_id.inspect},"\
  " peer_mac: #{@peer_mac.inspect}, peer_port_id: #{@peer_port_id.inspect}, peer_router_name:"\
  " #{@peer_router_name.inspect}, peer_site_id: #{@peer_site_id.inspect}, port_id:"\
  " #{@port_id.inspect}, router_name: #{@router_name.inspect}, site_id: #{@site_id.inspect},"\
  " type: #{@type.inspect}, up: #{@up.inspect}, uptime: #{@uptime.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



221
222
223
224
225
226
227
228
# File 'lib/mist_api/models/vpn_peer_stat.rb', line 221

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} is_active: #{@is_active}, jitter: #{@jitter}, last_seen: #{@last_seen},"\
  " latency: #{@latency}, loss: #{@loss}, mac: #{@mac}, mos: #{@mos}, mtu: #{@mtu}, org_id:"\
  " #{@org_id}, peer_mac: #{@peer_mac}, peer_port_id: #{@peer_port_id}, peer_router_name:"\
  " #{@peer_router_name}, peer_site_id: #{@peer_site_id}, port_id: #{@port_id}, router_name:"\
  " #{@router_name}, site_id: #{@site_id}, type: #{@type}, up: #{@up}, uptime: #{@uptime}>"
end