Class: MistApi::BgpPeer
- Defined in:
- lib/mist_api/models/bgp_peer.rb
Overview
Only present when ‘bgp_peers` in `fields` query parameter
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.
-
#neighbor ⇒ String
BGP AS, value in range 1-4294967294.
-
#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.
-
#rx_pkts ⇒ Integer
Amount of packets received since connection.
-
#rx_routes ⇒ Integer
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, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, rx_pkts = SKIP, rx_routes = SKIP, state = SKIP, timestamp = SKIP, tx_pkts = SKIP, tx_routes = SKIP, up = SKIP, uptime = SKIP, vrf_name = SKIP) ⇒ BgpPeer
constructor
A new instance of BgpPeer.
-
#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, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, rx_pkts = SKIP, rx_routes = SKIP, state = SKIP, timestamp = SKIP, tx_pkts = SKIP, tx_routes = SKIP, up = SKIP, uptime = SKIP, vrf_name = SKIP) ⇒ BgpPeer
Returns a new instance of BgpPeer.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/mist_api/models/bgp_peer.rb', line 132 def initialize( = SKIP, = SKIP, local_as = SKIP, neighbor = SKIP, neighbor_as = SKIP, neighbor_mac = SKIP, node = SKIP, rx_pkts = SKIP, rx_routes = 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 @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 @rx_pkts = rx_pkts unless rx_pkts == SKIP @rx_routes = rx_routes unless rx_routes == 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_peer.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_peer.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_peer.rb', line 23 def local_as @local_as end |
#neighbor ⇒ String
BGP AS, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}` )
28 29 30 |
# File 'lib/mist_api/models/bgp_peer.rb', line 28 def neighbor @neighbor end |
#neighbor_as ⇒ Object
BGP AS, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}` )
33 34 35 |
# File 'lib/mist_api/models/bgp_peer.rb', line 33 def neighbor_as @neighbor_as end |
#neighbor_mac ⇒ String
If it’s another device in the same org
37 38 39 |
# File 'lib/mist_api/models/bgp_peer.rb', line 37 def neighbor_mac @neighbor_mac end |
#node ⇒ String
Node0/node1
41 42 43 |
# File 'lib/mist_api/models/bgp_peer.rb', line 41 def node @node end |
#rx_pkts ⇒ Integer
Amount of packets received since connection
45 46 47 |
# File 'lib/mist_api/models/bgp_peer.rb', line 45 def rx_pkts @rx_pkts end |
#rx_routes ⇒ Integer
Number of received routes
49 50 51 |
# File 'lib/mist_api/models/bgp_peer.rb', line 49 def rx_routes @rx_routes end |
#state ⇒ BgpStatsStateEnum
enum: ‘active`, `connect`, `established`, `idle`, `open_config`, `open_sent`
54 55 56 |
# File 'lib/mist_api/models/bgp_peer.rb', line 54 def state @state end |
#timestamp ⇒ Float
Epoch (seconds)
58 59 60 |
# File 'lib/mist_api/models/bgp_peer.rb', line 58 def @timestamp end |
#tx_pkts ⇒ Integer
Amount of packets sent since connection
62 63 64 |
# File 'lib/mist_api/models/bgp_peer.rb', line 62 def tx_pkts @tx_pkts end |
#tx_routes ⇒ Integer
Amount of packets sent since connection
66 67 68 |
# File 'lib/mist_api/models/bgp_peer.rb', line 66 def tx_routes @tx_routes end |
#up ⇒ TrueClass | FalseClass
Amount of packets sent since connection
70 71 72 |
# File 'lib/mist_api/models/bgp_peer.rb', line 70 def up @up end |
#uptime ⇒ Integer
Amount of packets sent since connection
74 75 76 |
# File 'lib/mist_api/models/bgp_peer.rb', line 74 def uptime @uptime end |
#vrf_name ⇒ String
Amount of packets sent since connection
78 79 80 |
# File 'lib/mist_api/models/bgp_peer.rb', line 78 def vrf_name @vrf_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 191 192 193 194 195 196 197 198 |
# File 'lib/mist_api/models/bgp_peer.rb', line 156 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 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 rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP rx_routes = hash.key?('rx_routes') ? hash['rx_routes'] : 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. BgpPeer.new(, , local_as, neighbor, neighbor_as, neighbor_mac, node, rx_pkts, rx_routes, state, , tx_pkts, tx_routes, up, uptime, vrf_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mist_api/models/bgp_peer.rb', line 81 def self.names @_hash = {} if @_hash.nil? @_hash['evpn_overlay'] = 'evpn_overlay' @_hash['for_overlay'] = 'for_overlay' @_hash['local_as'] = 'local_as' @_hash['neighbor'] = 'neighbor' @_hash['neighbor_as'] = 'neighbor_as' @_hash['neighbor_mac'] = 'neighbor_mac' @_hash['node'] = 'node' @_hash['rx_pkts'] = 'rx_pkts' @_hash['rx_routes'] = 'rx_routes' @_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
125 126 127 128 129 130 |
# File 'lib/mist_api/models/bgp_peer.rb', line 125 def self.nullables %w[ rx_pkts tx_pkts ] end |
.optionals ⇒ Object
An array for optional fields
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/mist_api/models/bgp_peer.rb', line 103 def self.optionals %w[ evpn_overlay for_overlay local_as neighbor neighbor_as neighbor_mac node rx_pkts rx_routes state timestamp tx_pkts tx_routes up uptime vrf_name ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
202 203 204 205 206 207 208 |
# File 'lib/mist_api/models/bgp_peer.rb', line 202 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.
221 222 223 224 225 226 227 228 229 230 |
# File 'lib/mist_api/models/bgp_peer.rb', line 221 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}, neighbor: #{@neighbor.inspect},"\ " neighbor_as: #{@neighbor_as.inspect}, neighbor_mac: #{@neighbor_mac.inspect}, node:"\ " #{@node.inspect}, rx_pkts: #{@rx_pkts.inspect}, rx_routes: #{@rx_routes.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.
211 212 213 214 215 216 217 218 |
# File 'lib/mist_api/models/bgp_peer.rb', line 211 def to_s class_name = self.class.name.split('::').last "<#{class_name} evpn_overlay: #{@evpn_overlay}, for_overlay: #{@for_overlay}, local_as:"\ " #{@local_as}, neighbor: #{@neighbor}, neighbor_as: #{@neighbor_as}, neighbor_mac:"\ " #{@neighbor_mac}, node: #{@node}, rx_pkts: #{@rx_pkts}, rx_routes: #{@rx_routes}, state:"\ " #{@state}, timestamp: #{@timestamp}, tx_pkts: #{@tx_pkts}, tx_routes: #{@tx_routes}, up:"\ " #{@up}, uptime: #{@uptime}, vrf_name: #{@vrf_name}>" end |