Class: MistApi::Mxtunnel

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

Overview

MxTunnel

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(anchor_mxtunnel_ids = SKIP, auto_preemption = SKIP, created_time = SKIP, for_site = SKIP, hello_interval = 60, hello_retries = 7, id = SKIP, ipsec = SKIP, modified_time = SKIP, mtu = 0, mxcluster_ids = SKIP, name = SKIP, org_id = SKIP, protocol = MxtunnelProtocolEnum::UDP, site_id = SKIP, vlan_ids = SKIP, additional_properties = nil) ⇒ Mxtunnel

Returns a new instance of Mxtunnel.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/mist_api/models/mxtunnel.rb', line 131

def initialize(anchor_mxtunnel_ids = SKIP, auto_preemption = SKIP,
               created_time = SKIP, for_site = SKIP, hello_interval = 60,
               hello_retries = 7, id = SKIP, ipsec = SKIP,
               modified_time = SKIP, mtu = 0, mxcluster_ids = SKIP,
               name = SKIP, org_id = SKIP,
               protocol = MxtunnelProtocolEnum::UDP, site_id = SKIP,
               vlan_ids = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @anchor_mxtunnel_ids = anchor_mxtunnel_ids unless anchor_mxtunnel_ids == SKIP
  @auto_preemption = auto_preemption unless auto_preemption == SKIP
  @created_time = created_time unless created_time == SKIP
  @for_site = for_site unless for_site == SKIP
  @hello_interval = hello_interval unless hello_interval == SKIP
  @hello_retries = hello_retries unless hello_retries == SKIP
  @id = id unless id == SKIP
  @ipsec = ipsec unless ipsec == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @mtu = mtu unless mtu == SKIP
  @mxcluster_ids = mxcluster_ids unless mxcluster_ids == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @protocol = protocol unless protocol == SKIP
  @site_id = site_id unless site_id == SKIP
  @vlan_ids = vlan_ids unless vlan_ids == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#anchor_mxtunnel_idsArray[UUID | String]

List of anchor mxtunnels used for forming edge to edge tunnels

Returns:

  • (Array[UUID | String])


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

def anchor_mxtunnel_ids
  @anchor_mxtunnel_ids
end

#auto_preemptionAutoPreemption

Schedule to preempt ap’s which are not connected to preferred peer

Returns:



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

def auto_preemption
  @auto_preemption
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#hello_intervalInteger

In seconds, used as heartbeat to detect if a tunnel is alive. AP will try another peer after missing N hellos specified by ‘hello_retries`.

Returns:

  • (Integer)


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

def hello_interval
  @hello_interval
end

#hello_retriesInteger

In seconds, used as heartbeat to detect if a tunnel is alive. AP will try another peer after missing N hellos specified by ‘hello_retries`.

Returns:

  • (Integer)


36
37
38
# File 'lib/mist_api/models/mxtunnel.rb', line 36

def hello_retries
  @hello_retries
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


40
41
42
# File 'lib/mist_api/models/mxtunnel.rb', line 40

def id
  @id
end

#ipsecMxtunnelIpsec

Unique ID of the object instance in the Mist Organization

Returns:



44
45
46
# File 'lib/mist_api/models/mxtunnel.rb', line 44

def ipsec
  @ipsec
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


48
49
50
# File 'lib/mist_api/models/mxtunnel.rb', line 48

def modified_time
  @modified_time
end

#mtuInteger

0 to enable PMTU, 552-1500 to start PMTU with a lower MTU

Returns:

  • (Integer)


52
53
54
# File 'lib/mist_api/models/mxtunnel.rb', line 52

def mtu
  @mtu
end

#mxcluster_idsArray[UUID | String]

List of mxclusters to deploy this tunnel to

Returns:

  • (Array[UUID | String])


56
57
58
# File 'lib/mist_api/models/mxtunnel.rb', line 56

def mxcluster_ids
  @mxcluster_ids
end

#nameString

List of mxclusters to deploy this tunnel to

Returns:

  • (String)


60
61
62
# File 'lib/mist_api/models/mxtunnel.rb', line 60

def name
  @name
end

#org_idUUID | String

List of mxclusters to deploy this tunnel to

Returns:

  • (UUID | String)


64
65
66
# File 'lib/mist_api/models/mxtunnel.rb', line 64

def org_id
  @org_id
end

#protocolMxtunnelProtocolEnum

enum: ‘ip`, `udp`



68
69
70
# File 'lib/mist_api/models/mxtunnel.rb', line 68

def protocol
  @protocol
end

#site_idUUID | String

enum: ‘ip`, `udp`

Returns:

  • (UUID | String)


72
73
74
# File 'lib/mist_api/models/mxtunnel.rb', line 72

def site_id
  @site_id
end

#vlan_idsArray[Integer]

List of vlan_ids that will be used

Returns:

  • (Array[Integer])


76
77
78
# File 'lib/mist_api/models/mxtunnel.rb', line 76

def vlan_ids
  @vlan_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/mist_api/models/mxtunnel.rb', line 161

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  anchor_mxtunnel_ids =
    hash.key?('anchor_mxtunnel_ids') ? hash['anchor_mxtunnel_ids'] : SKIP
  auto_preemption = AutoPreemption.from_hash(hash['auto_preemption']) if
    hash['auto_preemption']
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  hello_interval = hash['hello_interval'] ||= 60
  hello_retries = hash['hello_retries'] ||= 7
  id = hash.key?('id') ? hash['id'] : SKIP
  ipsec = MxtunnelIpsec.from_hash(hash['ipsec']) if hash['ipsec']
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  mtu = hash['mtu'] ||= 0
  mxcluster_ids = hash.key?('mxcluster_ids') ? hash['mxcluster_ids'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  protocol = hash['protocol'] ||= MxtunnelProtocolEnum::UDP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  vlan_ids = hash.key?('vlan_ids') ? hash['vlan_ids'] : 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.
  Mxtunnel.new(anchor_mxtunnel_ids,
               auto_preemption,
               created_time,
               for_site,
               hello_interval,
               hello_retries,
               id,
               ipsec,
               modified_time,
               mtu,
               mxcluster_ids,
               name,
               org_id,
               protocol,
               site_id,
               vlan_ids,
               additional_properties)
end

.namesObject

A mapping from model property names to API property names.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/mist_api/models/mxtunnel.rb', line 79

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['anchor_mxtunnel_ids'] = 'anchor_mxtunnel_ids'
  @_hash['auto_preemption'] = 'auto_preemption'
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['hello_interval'] = 'hello_interval'
  @_hash['hello_retries'] = 'hello_retries'
  @_hash['id'] = 'id'
  @_hash['ipsec'] = 'ipsec'
  @_hash['modified_time'] = 'modified_time'
  @_hash['mtu'] = 'mtu'
  @_hash['mxcluster_ids'] = 'mxcluster_ids'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['protocol'] = 'protocol'
  @_hash['site_id'] = 'site_id'
  @_hash['vlan_ids'] = 'vlan_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



123
124
125
126
127
128
129
# File 'lib/mist_api/models/mxtunnel.rb', line 123

def self.nullables
  %w[
    hello_interval
    hello_retries
    name
  ]
end

.optionalsObject

An array for optional fields



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/mist_api/models/mxtunnel.rb', line 101

def self.optionals
  %w[
    anchor_mxtunnel_ids
    auto_preemption
    created_time
    for_site
    hello_interval
    hello_retries
    id
    ipsec
    modified_time
    mtu
    mxcluster_ids
    name
    org_id
    protocol
    site_id
    vlan_ids
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



223
224
225
226
227
228
229
230
231
232
233
# File 'lib/mist_api/models/mxtunnel.rb', line 223

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} anchor_mxtunnel_ids: #{@anchor_mxtunnel_ids.inspect}, auto_preemption:"\
  " #{@auto_preemption.inspect}, created_time: #{@created_time.inspect}, for_site:"\
  " #{@for_site.inspect}, hello_interval: #{@hello_interval.inspect}, hello_retries:"\
  " #{@hello_retries.inspect}, id: #{@id.inspect}, ipsec: #{@ipsec.inspect}, modified_time:"\
  " #{@modified_time.inspect}, mtu: #{@mtu.inspect}, mxcluster_ids: #{@mxcluster_ids.inspect},"\
  " name: #{@name.inspect}, org_id: #{@org_id.inspect}, protocol: #{@protocol.inspect},"\
  " site_id: #{@site_id.inspect}, vlan_ids: #{@vlan_ids.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



212
213
214
215
216
217
218
219
220
# File 'lib/mist_api/models/mxtunnel.rb', line 212

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} anchor_mxtunnel_ids: #{@anchor_mxtunnel_ids}, auto_preemption:"\
  " #{@auto_preemption}, created_time: #{@created_time}, for_site: #{@for_site},"\
  " hello_interval: #{@hello_interval}, hello_retries: #{@hello_retries}, id: #{@id}, ipsec:"\
  " #{@ipsec}, modified_time: #{@modified_time}, mtu: #{@mtu}, mxcluster_ids:"\
  " #{@mxcluster_ids}, name: #{@name}, org_id: #{@org_id}, protocol: #{@protocol}, site_id:"\
  " #{@site_id}, vlan_ids: #{@vlan_ids}, additional_properties: #{@additional_properties}>"
end