Class: MistApi::UtilsShowForwardingTable

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

Overview

UtilsShowForwardingTable 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(node = SKIP, prefix = SKIP, service_ip = SKIP, service_name = SKIP, service_port = SKIP, service_protocol = SKIP, service_tenant = SKIP, vrf = SKIP, additional_properties = nil) ⇒ UtilsShowForwardingTable

Returns a new instance of UtilsShowForwardingTable.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 77

def initialize(node = SKIP, prefix = SKIP, service_ip = SKIP,
               service_name = SKIP, service_port = SKIP,
               service_protocol = SKIP, service_tenant = SKIP, vrf = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @node = node unless node == SKIP
  @prefix = prefix unless prefix == SKIP
  @service_ip = service_ip unless service_ip == SKIP
  @service_name = service_name unless service_name == SKIP
  @service_port = service_port unless service_port == SKIP
  @service_protocol = service_protocol unless service_protocol == SKIP
  @service_tenant = service_tenant unless service_tenant == SKIP
  @vrf = vrf unless vrf == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#nodeHaClusterNodeEnum

only for HA. enum: ‘node0`, `node1`

Returns:



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

def node
  @node
end

#prefixString

can be ip, ipv6 prefix

Returns:

  • (String)


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

def prefix
  @prefix
end

#service_ipString

Only supported with SSR

Returns:

  • (String)


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

def service_ip
  @service_ip
end

#service_nameString

Only supported with SSR

Returns:

  • (String)


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

def service_name
  @service_name
end

#service_portInteger

Only supported with SSR

Returns:

  • (Integer)


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

def service_port
  @service_port
end

#service_protocolString

Only supported with SSR

Returns:

  • (String)


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

def service_protocol
  @service_protocol
end

#service_tenantString

Only supported with SSR

Returns:

  • (String)


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

def service_tenant
  @service_tenant
end

#vrfString

VRF Name

Returns:

  • (String)


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

def vrf
  @vrf
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  node = hash.key?('node') ? hash['node'] : SKIP
  prefix = hash.key?('prefix') ? hash['prefix'] : SKIP
  service_ip = hash.key?('service_ip') ? hash['service_ip'] : SKIP
  service_name = hash.key?('service_name') ? hash['service_name'] : SKIP
  service_port = hash.key?('service_port') ? hash['service_port'] : SKIP
  service_protocol =
    hash.key?('service_protocol') ? hash['service_protocol'] : SKIP
  service_tenant =
    hash.key?('service_tenant') ? hash['service_tenant'] : 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.
  UtilsShowForwardingTable.new(node,
                               prefix,
                               service_ip,
                               service_name,
                               service_port,
                               service_protocol,
                               service_tenant,
                               vrf,
                               additional_properties)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['node'] = 'node'
  @_hash['prefix'] = 'prefix'
  @_hash['service_ip'] = 'service_ip'
  @_hash['service_name'] = 'service_name'
  @_hash['service_port'] = 'service_port'
  @_hash['service_protocol'] = 'service_protocol'
  @_hash['service_tenant'] = 'service_tenant'
  @_hash['vrf'] = 'vrf'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    node
    prefix
    service_ip
    service_name
    service_port
    service_protocol
    service_tenant
    vrf
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



140
141
142
143
144
145
146
147
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 140

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} node: #{@node.inspect}, prefix: #{@prefix.inspect}, service_ip:"\
  " #{@service_ip.inspect}, service_name: #{@service_name.inspect}, service_port:"\
  " #{@service_port.inspect}, service_protocol: #{@service_protocol.inspect}, service_tenant:"\
  " #{@service_tenant.inspect}, vrf: #{@vrf.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



131
132
133
134
135
136
137
# File 'lib/mist_api/models/utils_show_forwarding_table.rb', line 131

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} node: #{@node}, prefix: #{@prefix}, service_ip: #{@service_ip},"\
  " service_name: #{@service_name}, service_port: #{@service_port}, service_protocol:"\
  " #{@service_protocol}, service_tenant: #{@service_tenant}, vrf: #{@vrf},"\
  " additional_properties: #{@additional_properties}>"
end