Class: MistApi::StatsWanTunnel
- Defined in:
- lib/mist_api/models/stats_wan_tunnel.rb
Overview
StatsWanTunnel Model.
Instance Attribute Summary collapse
-
#auth_algo ⇒ String
Authentication algorithm.
-
#encrypt_algo ⇒ String
Encryption algorithm.
-
#ike_version ⇒ String
IKE version.
-
#ip ⇒ String
IP Address.
-
#last_event ⇒ String
Reason of why the tunnel is down.
-
#mac ⇒ String
Router mac address.
-
#node ⇒ String
Node0/node1.
-
#org_id ⇒ UUID | String
Node0/node1.
-
#peer_host ⇒ String
Peer host.
-
#peer_ip ⇒ String
Peer ip address.
-
#priority ⇒ TunnelPriorityEnum
enum: ‘primary`, `secondary`.
-
#protocol ⇒ WanTunnelProtocolEnum
enum: ‘gre`, `ipsec`.
-
#rx_bytes ⇒ Integer
Amount of traffic received since connection.
-
#rx_pkts ⇒ Integer
Amount of packets received since connection.
-
#site_id ⇒ UUID | String
Amount of packets received since connection.
-
#tunnel_name ⇒ String
Mist Tunnel Name.
-
#tx_bytes ⇒ Integer
Amount of traffic sent since connection.
-
#tx_pkts ⇒ Integer
Amount of packets sent since connection.
-
#up ⇒ TrueClass | FalseClass
Amount of packets sent since connection.
-
#uptime ⇒ Integer
Duration from first (or last) SA was established.
-
#wan_name ⇒ String
WAN interface name.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(peer_ip = nil, auth_algo = SKIP, encrypt_algo = SKIP, ike_version = SKIP, ip = SKIP, last_event = SKIP, mac = SKIP, node = SKIP, org_id = SKIP, peer_host = SKIP, priority = SKIP, protocol = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tunnel_name = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, up = SKIP, uptime = SKIP, wan_name = SKIP, additional_properties = nil) ⇒ StatsWanTunnel
constructor
A new instance of StatsWanTunnel.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(peer_ip = nil, auth_algo = SKIP, encrypt_algo = SKIP, ike_version = SKIP, ip = SKIP, last_event = SKIP, mac = SKIP, node = SKIP, org_id = SKIP, peer_host = SKIP, priority = SKIP, protocol = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tunnel_name = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, up = SKIP, uptime = SKIP, wan_name = SKIP, additional_properties = nil) ⇒ StatsWanTunnel
Returns a new instance of StatsWanTunnel.
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 191 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 159 def initialize(peer_ip = nil, auth_algo = SKIP, encrypt_algo = SKIP, ike_version = SKIP, ip = SKIP, last_event = SKIP, mac = SKIP, node = SKIP, org_id = SKIP, peer_host = SKIP, priority = SKIP, protocol = SKIP, rx_bytes = SKIP, rx_pkts = SKIP, site_id = SKIP, tunnel_name = SKIP, tx_bytes = SKIP, tx_pkts = SKIP, up = SKIP, uptime = SKIP, wan_name = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @auth_algo = auth_algo unless auth_algo == SKIP @encrypt_algo = encrypt_algo unless encrypt_algo == SKIP @ike_version = ike_version unless ike_version == SKIP @ip = ip unless ip == SKIP @last_event = last_event unless last_event == SKIP @mac = mac unless mac == SKIP @node = node unless node == SKIP @org_id = org_id unless org_id == SKIP @peer_host = peer_host unless peer_host == SKIP @peer_ip = peer_ip @priority = priority unless priority == SKIP @protocol = protocol unless protocol == SKIP @rx_bytes = rx_bytes unless rx_bytes == SKIP @rx_pkts = rx_pkts unless rx_pkts == SKIP @site_id = site_id unless site_id == SKIP @tunnel_name = tunnel_name unless tunnel_name == SKIP @tx_bytes = tx_bytes unless tx_bytes == SKIP @tx_pkts = tx_pkts unless tx_pkts == SKIP @up = up unless up == SKIP @uptime = uptime unless uptime == SKIP @wan_name = wan_name unless wan_name == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#auth_algo ⇒ String
Authentication algorithm
14 15 16 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 14 def auth_algo @auth_algo end |
#encrypt_algo ⇒ String
Encryption algorithm
18 19 20 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 18 def encrypt_algo @encrypt_algo end |
#ike_version ⇒ String
IKE version
22 23 24 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 22 def ike_version @ike_version end |
#ip ⇒ String
IP Address
26 27 28 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 26 def ip @ip end |
#last_event ⇒ String
Reason of why the tunnel is down
30 31 32 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 30 def last_event @last_event end |
#mac ⇒ String
Router mac address
34 35 36 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 34 def mac @mac end |
#node ⇒ String
Node0/node1
38 39 40 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 38 def node @node end |
#org_id ⇒ UUID | String
Node0/node1
42 43 44 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 42 def org_id @org_id end |
#peer_host ⇒ String
Peer host
46 47 48 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 46 def peer_host @peer_host end |
#peer_ip ⇒ String
Peer ip address
50 51 52 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 50 def peer_ip @peer_ip end |
#priority ⇒ TunnelPriorityEnum
enum: ‘primary`, `secondary`
54 55 56 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 54 def priority @priority end |
#protocol ⇒ WanTunnelProtocolEnum
enum: ‘gre`, `ipsec`
58 59 60 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 58 def protocol @protocol end |
#rx_bytes ⇒ Integer
Amount of traffic received since connection
62 63 64 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 62 def rx_bytes @rx_bytes end |
#rx_pkts ⇒ Integer
Amount of packets received since connection
66 67 68 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 66 def rx_pkts @rx_pkts end |
#site_id ⇒ UUID | String
Amount of packets received since connection
70 71 72 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 70 def site_id @site_id end |
#tunnel_name ⇒ String
Mist Tunnel Name
74 75 76 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 74 def tunnel_name @tunnel_name end |
#tx_bytes ⇒ Integer
Amount of traffic sent since connection
78 79 80 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 78 def tx_bytes @tx_bytes end |
#tx_pkts ⇒ Integer
Amount of packets sent since connection
82 83 84 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 82 def tx_pkts @tx_pkts end |
#up ⇒ TrueClass | FalseClass
Amount of packets sent since connection
86 87 88 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 86 def up @up end |
#uptime ⇒ Integer
Duration from first (or last) SA was established
90 91 92 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 90 def uptime @uptime end |
#wan_name ⇒ String
WAN interface name
94 95 96 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 94 def wan_name @wan_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 194 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. peer_ip = hash.key?('peer_ip') ? hash['peer_ip'] : nil auth_algo = hash.key?('auth_algo') ? hash['auth_algo'] : SKIP encrypt_algo = hash.key?('encrypt_algo') ? hash['encrypt_algo'] : SKIP ike_version = hash.key?('ike_version') ? hash['ike_version'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP last_event = hash.key?('last_event') ? hash['last_event'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP node = hash.key?('node') ? hash['node'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP peer_host = hash.key?('peer_host') ? hash['peer_host'] : SKIP priority = hash.key?('priority') ? hash['priority'] : SKIP protocol = hash.key?('protocol') ? hash['protocol'] : SKIP rx_bytes = hash.key?('rx_bytes') ? hash['rx_bytes'] : SKIP rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP tunnel_name = hash.key?('tunnel_name') ? hash['tunnel_name'] : SKIP tx_bytes = hash.key?('tx_bytes') ? hash['tx_bytes'] : SKIP tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP up = hash.key?('up') ? hash['up'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP wan_name = hash.key?('wan_name') ? hash['wan_name'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. StatsWanTunnel.new(peer_ip, auth_algo, encrypt_algo, ike_version, ip, last_event, mac, node, org_id, peer_host, priority, protocol, rx_bytes, rx_pkts, site_id, tunnel_name, tx_bytes, tx_pkts, up, uptime, wan_name, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 97 def self.names @_hash = {} if @_hash.nil? @_hash['auth_algo'] = 'auth_algo' @_hash['encrypt_algo'] = 'encrypt_algo' @_hash['ike_version'] = 'ike_version' @_hash['ip'] = 'ip' @_hash['last_event'] = 'last_event' @_hash['mac'] = 'mac' @_hash['node'] = 'node' @_hash['org_id'] = 'org_id' @_hash['peer_host'] = 'peer_host' @_hash['peer_ip'] = 'peer_ip' @_hash['priority'] = 'priority' @_hash['protocol'] = 'protocol' @_hash['rx_bytes'] = 'rx_bytes' @_hash['rx_pkts'] = 'rx_pkts' @_hash['site_id'] = 'site_id' @_hash['tunnel_name'] = 'tunnel_name' @_hash['tx_bytes'] = 'tx_bytes' @_hash['tx_pkts'] = 'tx_pkts' @_hash['up'] = 'up' @_hash['uptime'] = 'uptime' @_hash['wan_name'] = 'wan_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
150 151 152 153 154 155 156 157 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 150 def self.nullables %w[ rx_bytes rx_pkts tx_bytes tx_pkts ] end |
.optionals ⇒ Object
An array for optional fields
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 124 def self.optionals %w[ auth_algo encrypt_algo ike_version ip last_event mac node org_id peer_host priority protocol rx_bytes rx_pkts site_id tunnel_name tx_bytes tx_pkts up uptime wan_name ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 254 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.peer_ip, ->(val) { val.instance_of? String }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['peer_ip'], ->(val) { val.instance_of? String }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 279 def inspect class_name = self.class.name.split('::').last "<#{class_name} auth_algo: #{@auth_algo.inspect}, encrypt_algo: #{@encrypt_algo.inspect},"\ " ike_version: #{@ike_version.inspect}, ip: #{@ip.inspect}, last_event:"\ " #{@last_event.inspect}, mac: #{@mac.inspect}, node: #{@node.inspect}, org_id:"\ " #{@org_id.inspect}, peer_host: #{@peer_host.inspect}, peer_ip: #{@peer_ip.inspect},"\ " priority: #{@priority.inspect}, protocol: #{@protocol.inspect}, rx_bytes:"\ " #{@rx_bytes.inspect}, rx_pkts: #{@rx_pkts.inspect}, site_id: #{@site_id.inspect},"\ " tunnel_name: #{@tunnel_name.inspect}, tx_bytes: #{@tx_bytes.inspect}, tx_pkts:"\ " #{@tx_pkts.inspect}, up: #{@up.inspect}, uptime: #{@uptime.inspect}, wan_name:"\ " #{@wan_name.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
267 268 269 270 271 272 273 274 275 276 |
# File 'lib/mist_api/models/stats_wan_tunnel.rb', line 267 def to_s class_name = self.class.name.split('::').last "<#{class_name} auth_algo: #{@auth_algo}, encrypt_algo: #{@encrypt_algo}, ike_version:"\ " #{@ike_version}, ip: #{@ip}, last_event: #{@last_event}, mac: #{@mac}, node: #{@node},"\ " org_id: #{@org_id}, peer_host: #{@peer_host}, peer_ip: #{@peer_ip}, priority:"\ " #{@priority}, protocol: #{@protocol}, rx_bytes: #{@rx_bytes}, rx_pkts: #{@rx_pkts},"\ " site_id: #{@site_id}, tunnel_name: #{@tunnel_name}, tx_bytes: #{@tx_bytes}, tx_pkts:"\ " #{@tx_pkts}, up: #{@up}, uptime: #{@uptime}, wan_name: #{@wan_name},"\ " additional_properties: #{@additional_properties}>" end |