Class: MistApi::OspfPeerStatsSearchResultsItems

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

Overview

OspfPeerStatsSearchResultsItems 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(dead_time = SKIP, mac = SKIP, org_id = SKIP, peer_ip = SKIP, port_id = SKIP, priority = SKIP, site_id = SKIP, state = SKIP, timestamp = SKIP, up = SKIP, vrf_name = SKIP) ⇒ OspfPeerStatsSearchResultsItems

Returns a new instance of OspfPeerStatsSearchResultsItems.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 95

def initialize(dead_time = SKIP, mac = SKIP, org_id = SKIP, peer_ip = SKIP,
               port_id = SKIP, priority = SKIP, site_id = SKIP,
               state = SKIP, timestamp = SKIP, up = SKIP, vrf_name = SKIP)
  @dead_time = dead_time unless dead_time == SKIP
  @mac = mac unless mac == SKIP
  @org_id = org_id unless org_id == SKIP
  @peer_ip = peer_ip unless peer_ip == SKIP
  @port_id = port_id unless port_id == SKIP
  @priority = priority unless priority == SKIP
  @site_id = site_id unless site_id == SKIP
  @state = state unless state == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @up = up unless up == SKIP
  @vrf_name = vrf_name unless vrf_name == SKIP
end

Instance Attribute Details

#dead_timeInteger

Activity timer

Returns:

  • (Integer)


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

def dead_time
  @dead_time
end

#macString

Router MAC address

Returns:

  • (String)


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

def mac
  @mac
end

#org_idUUID | String

Router org ID

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#peer_ipString

Neighbor address (IP)

Returns:

  • (String)


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

def peer_ip
  @peer_ip
end

#port_idString

Interface name

Returns:

  • (String)


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

def port_id
  @port_id
end

#priorityInteger

Neighbor priority, 0-255

Returns:

  • (Integer)


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

def priority
  @priority
end

#site_idUUID | String

Router site ID

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#stateString

Eg. full, down, 2way, init, exstart, exchange, loading

Returns:

  • (String)


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

def state
  @state
end

#timestampFloat

Sampling time (in epoch seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#upTrueClass | FalseClass

True if state is full

Returns:

  • (TrueClass | FalseClass)


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

def up
  @up
end

#vrf_nameString

Instance name, e.g. master

Returns:

  • (String)


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

def vrf_name
  @vrf_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 112

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  dead_time = hash.key?('dead_time') ? hash['dead_time'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  peer_ip = hash.key?('peer_ip') ? hash['peer_ip'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  priority = hash.key?('priority') ? hash['priority'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP
  vrf_name = hash.key?('vrf_name') ? hash['vrf_name'] : SKIP

  # Create object from extracted values.
  OspfPeerStatsSearchResultsItems.new(dead_time,
                                      mac,
                                      org_id,
                                      peer_ip,
                                      port_id,
                                      priority,
                                      site_id,
                                      state,
                                      timestamp,
                                      up,
                                      vrf_name)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dead_time'] = 'dead_time'
  @_hash['mac'] = 'mac'
  @_hash['org_id'] = 'org_id'
  @_hash['peer_ip'] = 'peer_ip'
  @_hash['port_id'] = 'port_id'
  @_hash['priority'] = 'priority'
  @_hash['site_id'] = 'site_id'
  @_hash['state'] = 'state'
  @_hash['timestamp'] = 'timestamp'
  @_hash['up'] = 'up'
  @_hash['vrf_name'] = 'vrf_name'
  @_hash
end

.nullablesObject

An array for nullable fields



91
92
93
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 91

def self.nullables
  []
end

.optionalsObject

An array for optional fields



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 74

def self.optionals
  %w[
    dead_time
    mac
    org_id
    peer_ip
    port_id
    priority
    site_id
    state
    timestamp
    up
    vrf_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



151
152
153
154
155
156
157
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 151

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dead_time: #{@dead_time.inspect}, mac: #{@mac.inspect}, org_id:"\
  " #{@org_id.inspect}, peer_ip: #{@peer_ip.inspect}, port_id: #{@port_id.inspect}, priority:"\
  " #{@priority.inspect}, site_id: #{@site_id.inspect}, state: #{@state.inspect}, timestamp:"\
  " #{@timestamp.inspect}, up: #{@up.inspect}, vrf_name: #{@vrf_name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
148
# File 'lib/mist_api/models/ospf_peer_stats_search_results_items.rb', line 143

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dead_time: #{@dead_time}, mac: #{@mac}, org_id: #{@org_id}, peer_ip:"\
  " #{@peer_ip}, port_id: #{@port_id}, priority: #{@priority}, site_id: #{@site_id}, state:"\
  " #{@state}, timestamp: #{@timestamp}, up: #{@up}, vrf_name: #{@vrf_name}>"
end