Class: MistApi::BgpStats
- Defined in:
- lib/mist_api/models/bgp_stats.rb
Overview
BgpStats Model.
Instance Attribute Summary collapse
-
#evpn_overlay ⇒ TrueClass | FalseClass
If this is created for evpn overlay.
-
#for_overlay ⇒ TrueClass | FalseClass
If this is created for overlay.
-
#local_as ⇒ Object
BGP AS, value in range 1-4294967294.
-
#mac ⇒ String
Router mac address.
-
#model ⇒ String
Router mac address.
-
#neighbor ⇒ String
Router mac address.
-
#neighbor_as ⇒ Object
BGP AS, value in range 1-4294967294.
-
#neighbor_mac ⇒ String
If it’s another device in the same org.
-
#node ⇒ String
Node0/node1.
-
#org_id ⇒ UUID | String
Node0/node1.
-
#rx_pkts ⇒ Integer
Amount of packets received since connection.
-
#rx_routes ⇒ Integer
Number of received routes.
-
#site_id ⇒ UUID | String
Number of received routes.
-
#state ⇒ BgpStatsStateEnum
enum: ‘active`, `connect`, `established`, `idle`, `open_config`, `open_sent`.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#tx_pkts ⇒ Integer
Amount of packets sent since connection.
-
#tx_routes ⇒ Integer
Amount of packets sent since connection.
-
#up ⇒ TrueClass | FalseClass
Amount of packets sent since connection.
-
#uptime ⇒ Integer
Amount of packets sent since connection.
-
#vrf_name ⇒ String
Amount of packets sent since connection.
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(evpn_overlay = SKIP, for_overlay = SKIP, local_as = SKIP, mac = SKIP, model = SKIP, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, org_id = SKIP, rx_pkts = SKIP, rx_routes = SKIP, site_id = SKIP, state = SKIP, timestamp = SKIP, tx_pkts = SKIP, tx_routes = SKIP, up = SKIP, uptime = SKIP, vrf_name = SKIP) ⇒ BgpStats
constructor
A new instance of BgpStats.
-
#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(evpn_overlay = SKIP, for_overlay = SKIP, local_as = SKIP, mac = SKIP, model = SKIP, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, org_id = SKIP, rx_pkts = SKIP, rx_routes = SKIP, site_id = SKIP, state = SKIP, timestamp = SKIP, tx_pkts = SKIP, tx_routes = SKIP, up = SKIP, uptime = SKIP, vrf_name = SKIP) ⇒ BgpStats
Returns a new instance of BgpStats.
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 |
# File 'lib/mist_api/models/bgp_stats.rb', line 155 def initialize( = SKIP, = SKIP, local_as = SKIP, mac = SKIP, model = SKIP, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, org_id = SKIP, rx_pkts = SKIP, rx_routes = SKIP, site_id = SKIP, state = SKIP, = SKIP, tx_pkts = SKIP, tx_routes = SKIP, up = SKIP, uptime = SKIP, vrf_name = SKIP) @evpn_overlay = unless == SKIP @for_overlay = unless == SKIP @local_as = local_as unless local_as == SKIP @mac = mac unless mac == SKIP @model = model unless model == SKIP @neighbor = neighbor unless neighbor == SKIP @neighbor_as = neighbor_as unless neighbor_as == SKIP @neighbor_mac = neighbor_mac unless neighbor_mac == SKIP @node = node unless node == SKIP @org_id = org_id unless org_id == SKIP @rx_pkts = rx_pkts unless rx_pkts == SKIP @rx_routes = rx_routes unless rx_routes == SKIP @site_id = site_id unless site_id == SKIP @state = state unless state == SKIP @timestamp = unless == SKIP @tx_pkts = tx_pkts unless tx_pkts == SKIP @tx_routes = tx_routes unless tx_routes == SKIP @up = up unless up == SKIP @uptime = uptime unless uptime == SKIP @vrf_name = vrf_name unless vrf_name == SKIP end |
Instance Attribute Details
#evpn_overlay ⇒ TrueClass | FalseClass
If this is created for evpn overlay
14 15 16 |
# File 'lib/mist_api/models/bgp_stats.rb', line 14 def @evpn_overlay end |
#for_overlay ⇒ TrueClass | FalseClass
If this is created for overlay
18 19 20 |
# File 'lib/mist_api/models/bgp_stats.rb', line 18 def @for_overlay end |
#local_as ⇒ Object
BGP AS, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}` )
23 24 25 |
# File 'lib/mist_api/models/bgp_stats.rb', line 23 def local_as @local_as end |
#mac ⇒ String
Router mac address
27 28 29 |
# File 'lib/mist_api/models/bgp_stats.rb', line 27 def mac @mac end |
#model ⇒ String
Router mac address
31 32 33 |
# File 'lib/mist_api/models/bgp_stats.rb', line 31 def model @model end |
#neighbor ⇒ String
Router mac address
35 36 37 |
# File 'lib/mist_api/models/bgp_stats.rb', line 35 def neighbor @neighbor end |
#neighbor_as ⇒ Object
BGP AS, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}` )
40 41 42 |
# File 'lib/mist_api/models/bgp_stats.rb', line 40 def neighbor_as @neighbor_as end |
#neighbor_mac ⇒ String
If it’s another device in the same org
44 45 46 |
# File 'lib/mist_api/models/bgp_stats.rb', line 44 def neighbor_mac @neighbor_mac end |
#node ⇒ String
Node0/node1
48 49 50 |
# File 'lib/mist_api/models/bgp_stats.rb', line 48 def node @node end |
#org_id ⇒ UUID | String
Node0/node1
52 53 54 |
# File 'lib/mist_api/models/bgp_stats.rb', line 52 def org_id @org_id end |
#rx_pkts ⇒ Integer
Amount of packets received since connection
56 57 58 |
# File 'lib/mist_api/models/bgp_stats.rb', line 56 def rx_pkts @rx_pkts end |
#rx_routes ⇒ Integer
Number of received routes
60 61 62 |
# File 'lib/mist_api/models/bgp_stats.rb', line 60 def rx_routes @rx_routes end |
#site_id ⇒ UUID | String
Number of received routes
64 65 66 |
# File 'lib/mist_api/models/bgp_stats.rb', line 64 def site_id @site_id end |
#state ⇒ BgpStatsStateEnum
enum: ‘active`, `connect`, `established`, `idle`, `open_config`, `open_sent`
69 70 71 |
# File 'lib/mist_api/models/bgp_stats.rb', line 69 def state @state end |
#timestamp ⇒ Float
Epoch (seconds)
73 74 75 |
# File 'lib/mist_api/models/bgp_stats.rb', line 73 def @timestamp end |
#tx_pkts ⇒ Integer
Amount of packets sent since connection
77 78 79 |
# File 'lib/mist_api/models/bgp_stats.rb', line 77 def tx_pkts @tx_pkts end |
#tx_routes ⇒ Integer
Amount of packets sent since connection
81 82 83 |
# File 'lib/mist_api/models/bgp_stats.rb', line 81 def tx_routes @tx_routes end |
#up ⇒ TrueClass | FalseClass
Amount of packets sent since connection
85 86 87 |
# File 'lib/mist_api/models/bgp_stats.rb', line 85 def up @up end |
#uptime ⇒ Integer
Amount of packets sent since connection
89 90 91 |
# File 'lib/mist_api/models/bgp_stats.rb', line 89 def uptime @uptime end |
#vrf_name ⇒ String
Amount of packets sent since connection
93 94 95 |
# File 'lib/mist_api/models/bgp_stats.rb', line 93 def vrf_name @vrf_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/mist_api/models/bgp_stats.rb', line 185 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash.key?('evpn_overlay') ? hash['evpn_overlay'] : SKIP = hash.key?('for_overlay') ? hash['for_overlay'] : SKIP local_as = hash.key?('local_as') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:BgpAs), hash['local_as'] ) : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP model = hash.key?('model') ? hash['model'] : SKIP neighbor = hash.key?('neighbor') ? hash['neighbor'] : SKIP neighbor_as = hash.key?('neighbor_as') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:BgpAs), hash['neighbor_as'] ) : SKIP neighbor_mac = hash.key?('neighbor_mac') ? hash['neighbor_mac'] : SKIP node = hash.key?('node') ? hash['node'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP rx_routes = hash.key?('rx_routes') ? hash['rx_routes'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP tx_routes = hash.key?('tx_routes') ? hash['tx_routes'] : SKIP up = hash.key?('up') ? hash['up'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP vrf_name = hash.key?('vrf_name') ? hash['vrf_name'] : SKIP # Create object from extracted values. BgpStats.new(, , local_as, mac, model, neighbor, neighbor_as, neighbor_mac, node, org_id, rx_pkts, rx_routes, site_id, state, , tx_pkts, tx_routes, up, uptime, vrf_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/mist_api/models/bgp_stats.rb', line 96 def self.names @_hash = {} if @_hash.nil? @_hash['evpn_overlay'] = 'evpn_overlay' @_hash['for_overlay'] = 'for_overlay' @_hash['local_as'] = 'local_as' @_hash['mac'] = 'mac' @_hash['model'] = 'model' @_hash['neighbor'] = 'neighbor' @_hash['neighbor_as'] = 'neighbor_as' @_hash['neighbor_mac'] = 'neighbor_mac' @_hash['node'] = 'node' @_hash['org_id'] = 'org_id' @_hash['rx_pkts'] = 'rx_pkts' @_hash['rx_routes'] = 'rx_routes' @_hash['site_id'] = 'site_id' @_hash['state'] = 'state' @_hash['timestamp'] = 'timestamp' @_hash['tx_pkts'] = 'tx_pkts' @_hash['tx_routes'] = 'tx_routes' @_hash['up'] = 'up' @_hash['uptime'] = 'uptime' @_hash['vrf_name'] = 'vrf_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
148 149 150 151 152 153 |
# File 'lib/mist_api/models/bgp_stats.rb', line 148 def self.nullables %w[ rx_pkts tx_pkts ] end |
.optionals ⇒ Object
An array for optional fields
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/mist_api/models/bgp_stats.rb', line 122 def self.optionals %w[ evpn_overlay for_overlay local_as mac model neighbor neighbor_as neighbor_mac node org_id rx_pkts rx_routes site_id state timestamp tx_pkts tx_routes up uptime vrf_name ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
239 240 241 242 243 244 245 |
# File 'lib/mist_api/models/bgp_stats.rb', line 239 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/mist_api/models/bgp_stats.rb', line 259 def inspect class_name = self.class.name.split('::').last "<#{class_name} evpn_overlay: #{@evpn_overlay.inspect}, for_overlay:"\ " #{@for_overlay.inspect}, local_as: #{@local_as.inspect}, mac: #{@mac.inspect}, model:"\ " #{@model.inspect}, neighbor: #{@neighbor.inspect}, neighbor_as: #{@neighbor_as.inspect},"\ " neighbor_mac: #{@neighbor_mac.inspect}, node: #{@node.inspect}, org_id:"\ " #{@org_id.inspect}, rx_pkts: #{@rx_pkts.inspect}, rx_routes: #{@rx_routes.inspect},"\ " site_id: #{@site_id.inspect}, state: #{@state.inspect}, timestamp: #{@timestamp.inspect},"\ " tx_pkts: #{@tx_pkts.inspect}, tx_routes: #{@tx_routes.inspect}, up: #{@up.inspect},"\ " uptime: #{@uptime.inspect}, vrf_name: #{@vrf_name.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
248 249 250 251 252 253 254 255 256 |
# File 'lib/mist_api/models/bgp_stats.rb', line 248 def to_s class_name = self.class.name.split('::').last "<#{class_name} evpn_overlay: #{@evpn_overlay}, for_overlay: #{@for_overlay}, local_as:"\ " #{@local_as}, mac: #{@mac}, model: #{@model}, neighbor: #{@neighbor}, neighbor_as:"\ " #{@neighbor_as}, neighbor_mac: #{@neighbor_mac}, node: #{@node}, org_id: #{@org_id},"\ " rx_pkts: #{@rx_pkts}, rx_routes: #{@rx_routes}, site_id: #{@site_id}, state: #{@state},"\ " timestamp: #{@timestamp}, tx_pkts: #{@tx_pkts}, tx_routes: #{@tx_routes}, up: #{@up},"\ " uptime: #{@uptime}, vrf_name: #{@vrf_name}>" end |