Class: MistApi::StatsGatewayVpnPeer

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

Overview

StatsGatewayVpnPeer 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, mos = SKIP, mtu = SKIP, peer_mac = SKIP, peer_port_id = SKIP, peer_router_name = SKIP, peer_site_id = SKIP, port_id = SKIP, router_name = SKIP, type = SKIP, up = SKIP, uptime = SKIP) ⇒ StatsGatewayVpnPeer

Returns a new instance of StatsGatewayVpnPeer.



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 127

def initialize(is_active = SKIP, jitter = SKIP, last_seen = SKIP,
               latency = SKIP, loss = SKIP, mos = SKIP, mtu = SKIP,
               peer_mac = SKIP, peer_port_id = SKIP,
               peer_router_name = SKIP, peer_site_id = SKIP, port_id = SKIP,
               router_name = 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
  @mos = mos unless mos == SKIP
  @mtu = mtu unless mtu == 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
  @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/stats_gateway_vpn_peer.rb', line 14

def is_active
  @is_active
end

#jitterFloat

Jitter in milliseconds

Returns:

  • (Float)


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

def jitter
  @jitter
end

#last_seenFloat

Last seen timestamp

Returns:

  • (Float)


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

def last_seen
  @last_seen
end

#latencyFloat

Latency in milliseconds

Returns:

  • (Float)


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

def latency
  @latency
end

#lossFloat

Packet loss in percentage

Returns:

  • (Float)


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

def loss
  @loss
end

#mosFloat

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

Returns:

  • (Float)


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

def mos
  @mos
end

#mtuInteger

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

Returns:

  • (Integer)


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

def mtu
  @mtu
end

#peer_macString

Peer router mac address

Returns:

  • (String)


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

def peer_mac
  @peer_mac
end

#peer_port_idString

Peer router device interface

Returns:

  • (String)


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

def peer_port_id
  @peer_port_id
end

#peer_router_nameString

Peer router device interface

Returns:

  • (String)


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

def peer_router_name
  @peer_router_name
end

#peer_site_idUUID | String

Peer router device interface

Returns:

  • (UUID | String)


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

def peer_site_id
  @peer_site_id
end

#port_idString

Router device interface

Returns:

  • (String)


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

def port_id
  @port_id
end

#router_nameString

Router device interface

Returns:

  • (String)


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

def router_name
  @router_name
end

#typeString

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

Returns:

  • (String)


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

def type
  @type
end

#upTrueClass | FalseClass

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

Returns:

  • (TrueClass | FalseClass)


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

def up
  @up
end

#uptimeInteger

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

Returns:

  • (Integer)


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

def uptime
  @uptime
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 151

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
  mos = hash.key?('mos') ? hash['mos'] : SKIP
  mtu = hash.key?('mtu') ? hash['mtu'] : 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
  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.
  StatsGatewayVpnPeer.new(is_active,
                          jitter,
                          last_seen,
                          latency,
                          loss,
                          mos,
                          mtu,
                          peer_mac,
                          peer_port_id,
                          peer_router_name,
                          peer_site_id,
                          port_id,
                          router_name,
                          type,
                          up,
                          uptime)
end

.namesObject

A mapping from model property names to API property names.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 77

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['mos'] = 'mos'
  @_hash['mtu'] = 'mtu'
  @_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['type'] = 'type'
  @_hash['up'] = 'up'
  @_hash['uptime'] = 'uptime'
  @_hash
end

.nullablesObject

An array for nullable fields



121
122
123
124
125
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 121

def self.nullables
  %w[
    last_seen
  ]
end

.optionalsObject

An array for optional fields



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 99

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



203
204
205
206
207
208
209
210
211
212
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 203

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}, mos:"\
  " #{@mos.inspect}, mtu: #{@mtu.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}, type: #{@type.inspect}, up: #{@up.inspect}, uptime:"\
  " #{@uptime.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



193
194
195
196
197
198
199
200
# File 'lib/mist_api/models/stats_gateway_vpn_peer.rb', line 193

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}, mos: #{@mos}, mtu: #{@mtu}, 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}, type: #{@type}, up:"\
  " #{@up}, uptime: #{@uptime}>"
end