Class: MistApi::StatsMxedgePortStat

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

Overview

StatsMxedgePortStat 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(full_duplex = SKIP, lacp = SKIP, lldp_stats = SKIP, mac = SKIP, rx_bytes = SKIP, rx_errors = SKIP, rx_pkts = SKIP, sfp = SKIP, speed = SKIP, state = SKIP, tx_bytes = SKIP, tx_errors = SKIP, tx_pkts = SKIP, up = SKIP) ⇒ StatsMxedgePortStat

Returns a new instance of StatsMxedgePortStat.



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

def initialize(full_duplex = SKIP, lacp = SKIP, lldp_stats = SKIP,
               mac = SKIP, rx_bytes = SKIP, rx_errors = SKIP,
               rx_pkts = SKIP, sfp = SKIP, speed = SKIP, state = SKIP,
               tx_bytes = SKIP, tx_errors = SKIP, tx_pkts = SKIP, up = SKIP)
  @full_duplex = full_duplex unless full_duplex == SKIP
  @lacp = lacp unless lacp == SKIP
  @lldp_stats = lldp_stats unless lldp_stats == SKIP
  @mac = mac unless mac == SKIP
  @rx_bytes = rx_bytes unless rx_bytes == SKIP
  @rx_errors = rx_errors unless rx_errors == SKIP
  @rx_pkts = rx_pkts unless rx_pkts == SKIP
  @sfp = sfp unless sfp == SKIP
  @speed = speed unless speed == SKIP
  @state = state unless state == SKIP
  @tx_bytes = tx_bytes unless tx_bytes == SKIP
  @tx_errors = tx_errors unless tx_errors == SKIP
  @tx_pkts = tx_pkts unless tx_pkts == SKIP
  @up = up unless up == SKIP
end

Instance Attribute Details

#full_duplexTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def full_duplex
  @full_duplex
end

#lacpStatsMxedgePortStatLacp

TODO: Write general description for this method



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

def lacp
  @lacp
end

#lldp_statsStatsMxedgePortStatLldpStats

TODO: Write general description for this method



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

def lldp_stats
  @lldp_stats
end

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#rx_bytesInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_bytes
  @rx_bytes
end

#rx_errorsInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_errors
  @rx_errors
end

#rx_pktsInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def rx_pkts
  @rx_pkts
end

#sfpStatsMxedgePortStatSfp

Amount of packets received since connection



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

def sfp
  @sfp
end

#speedInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def speed
  @speed
end

#stateString

Amount of packets received since connection

Returns:

  • (String)


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

def state
  @state
end

#tx_bytesInteger

Amount of traffic sent since connection

Returns:

  • (Integer)


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

def tx_bytes
  @tx_bytes
end

#tx_errorsInteger

Amount of traffic sent since connection

Returns:

  • (Integer)


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

def tx_errors
  @tx_errors
end

#tx_pktsInteger

Amount of packets sent since connection

Returns:

  • (Integer)


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

def tx_pkts
  @tx_pkts
end

#upTrueClass | FalseClass

Amount of packets sent since connection

Returns:

  • (TrueClass | FalseClass)


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

def up
  @up
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



139
140
141
142
143
144
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
171
172
173
174
# File 'lib/mist_api/models/stats_mxedge_port_stat.rb', line 139

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  full_duplex = hash.key?('full_duplex') ? hash['full_duplex'] : SKIP
  lacp = StatsMxedgePortStatLacp.from_hash(hash['lacp']) if hash['lacp']
  lldp_stats = StatsMxedgePortStatLldpStats.from_hash(hash['lldp_stats']) if
    hash['lldp_stats']
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  rx_bytes = hash.key?('rx_bytes') ? hash['rx_bytes'] : SKIP
  rx_errors = hash.key?('rx_errors') ? hash['rx_errors'] : SKIP
  rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP
  sfp = StatsMxedgePortStatSfp.from_hash(hash['sfp']) if hash['sfp']
  speed = hash.key?('speed') ? hash['speed'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  tx_bytes = hash.key?('tx_bytes') ? hash['tx_bytes'] : SKIP
  tx_errors = hash.key?('tx_errors') ? hash['tx_errors'] : SKIP
  tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP

  # Create object from extracted values.
  StatsMxedgePortStat.new(full_duplex,
                          lacp,
                          lldp_stats,
                          mac,
                          rx_bytes,
                          rx_errors,
                          rx_pkts,
                          sfp,
                          speed,
                          state,
                          tx_bytes,
                          tx_errors,
                          tx_pkts,
                          up)
end

.namesObject

A mapping from model property names to API property names.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/stats_mxedge_port_stat.rb', line 69

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['full_duplex'] = 'full_duplex'
  @_hash['lacp'] = 'lacp'
  @_hash['lldp_stats'] = 'lldp_stats'
  @_hash['mac'] = 'mac'
  @_hash['rx_bytes'] = 'rx_bytes'
  @_hash['rx_errors'] = 'rx_errors'
  @_hash['rx_pkts'] = 'rx_pkts'
  @_hash['sfp'] = 'sfp'
  @_hash['speed'] = 'speed'
  @_hash['state'] = 'state'
  @_hash['tx_bytes'] = 'tx_bytes'
  @_hash['tx_errors'] = 'tx_errors'
  @_hash['tx_pkts'] = 'tx_pkts'
  @_hash['up'] = 'up'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
112
113
114
115
116
# File 'lib/mist_api/models/stats_mxedge_port_stat.rb', line 109

def self.nullables
  %w[
    rx_bytes
    rx_pkts
    tx_bytes
    tx_pkts
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    full_duplex
    lacp
    lldp_stats
    mac
    rx_bytes
    rx_errors
    rx_pkts
    sfp
    speed
    state
    tx_bytes
    tx_errors
    tx_pkts
    up
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



186
187
188
189
190
191
192
193
# File 'lib/mist_api/models/stats_mxedge_port_stat.rb', line 186

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} full_duplex: #{@full_duplex.inspect}, lacp: #{@lacp.inspect}, lldp_stats:"\
  " #{@lldp_stats.inspect}, mac: #{@mac.inspect}, rx_bytes: #{@rx_bytes.inspect}, rx_errors:"\
  " #{@rx_errors.inspect}, rx_pkts: #{@rx_pkts.inspect}, sfp: #{@sfp.inspect}, speed:"\
  " #{@speed.inspect}, state: #{@state.inspect}, tx_bytes: #{@tx_bytes.inspect}, tx_errors:"\
  " #{@tx_errors.inspect}, tx_pkts: #{@tx_pkts.inspect}, up: #{@up.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



177
178
179
180
181
182
183
# File 'lib/mist_api/models/stats_mxedge_port_stat.rb', line 177

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} full_duplex: #{@full_duplex}, lacp: #{@lacp}, lldp_stats: #{@lldp_stats},"\
  " mac: #{@mac}, rx_bytes: #{@rx_bytes}, rx_errors: #{@rx_errors}, rx_pkts: #{@rx_pkts}, sfp:"\
  " #{@sfp}, speed: #{@speed}, state: #{@state}, tx_bytes: #{@tx_bytes}, tx_errors:"\
  " #{@tx_errors}, tx_pkts: #{@tx_pkts}, up: #{@up}>"
end