Class: MistApi::UtilsShowArp

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

Overview

UtilsShowArp 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(duration = 0, interval = 0, ip = SKIP, node = SKIP, port_id = SKIP, vrf = SKIP, additional_properties = nil) ⇒ UtilsShowArp

Returns a new instance of UtilsShowArp.



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/mist_api/models/utils_show_arp.rb', line 66

def initialize(duration = 0, interval = 0, ip = SKIP, node = SKIP,
               port_id = SKIP, vrf = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @duration = duration unless duration == SKIP
  @interval = interval unless interval == SKIP
  @ip = ip unless ip == SKIP
  @node = node unless node == SKIP
  @port_id = port_id unless port_id == SKIP
  @vrf = vrf unless vrf == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#durationInteger

Duration in sec for which refresh is enabled. Should be set only if interval is configured to non-zero value.

Returns:

  • (Integer)


15
16
17
# File 'lib/mist_api/models/utils_show_arp.rb', line 15

def duration
  @duration
end

#intervalInteger

Rate at which output will refresh

Returns:

  • (Integer)


19
20
21
# File 'lib/mist_api/models/utils_show_arp.rb', line 19

def interval
  @interval
end

#ipString

IP Address

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/utils_show_arp.rb', line 23

def ip
  @ip
end

#nodeHaClusterNodeEnum1Enum

HA cluster node to run the command on, required for Gateways



27
28
29
# File 'lib/mist_api/models/utils_show_arp.rb', line 27

def node
  @node
end

#port_idString

Device Port ID

Returns:

  • (String)


31
32
33
# File 'lib/mist_api/models/utils_show_arp.rb', line 31

def port_id
  @port_id
end

#vrfString

VRF Name

Returns:

  • (String)


35
36
37
# File 'lib/mist_api/models/utils_show_arp.rb', line 35

def vrf
  @vrf
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/mist_api/models/utils_show_arp.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  duration = hash['duration'] ||= 0
  interval = hash['interval'] ||= 0
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  node = hash.key?('node') ? hash['node'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  vrf = hash.key?('vrf') ? hash['vrf'] : 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.
  UtilsShowArp.new(duration,
                   interval,
                   ip,
                   node,
                   port_id,
                   vrf,
                   additional_properties)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/utils_show_arp.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['duration'] = 'duration'
  @_hash['interval'] = 'interval'
  @_hash['ip'] = 'ip'
  @_hash['node'] = 'node'
  @_hash['port_id'] = 'port_id'
  @_hash['vrf'] = 'vrf'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/mist_api/models/utils_show_arp.rb', line 50

def self.optionals
  %w[
    duration
    interval
    ip
    node
    port_id
    vrf
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
# File 'lib/mist_api/models/utils_show_arp.rb', line 117

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} duration: #{@duration.inspect}, interval: #{@interval.inspect}, ip:"\
  " #{@ip.inspect}, node: #{@node.inspect}, port_id: #{@port_id.inspect}, vrf:"\
  " #{@vrf.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



110
111
112
113
114
# File 'lib/mist_api/models/utils_show_arp.rb', line 110

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} duration: #{@duration}, interval: #{@interval}, ip: #{@ip}, node: #{@node},"\
  " port_id: #{@port_id}, vrf: #{@vrf}, additional_properties: #{@additional_properties}>"
end