Class: MistApi::Mxedge

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

Overview

MxEdge

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(model = nil, name = nil, created_time = SKIP, for_site = SKIP, id = SKIP, mac = SKIP, magic = SKIP, modified_time = SKIP, mxagent_registered = SKIP, mxcluster_id = SKIP, mxedge_mgmt = SKIP, notes = SKIP, ntp_servers = SKIP, oob_ip_config = SKIP, org_id = SKIP, proxy = SKIP, services = SKIP, site_id = SKIP, tunterm_dhcpd_config = SKIP, tunterm_extra_routes = SKIP, tunterm_igmp_snooping_config = SKIP, tunterm_ip_config = SKIP, tunterm_monitoring = SKIP, tunterm_multicast_config = SKIP, tunterm_other_ip_configs = SKIP, tunterm_port_config = SKIP, tunterm_registered = SKIP, tunterm_switch_config = SKIP, versions = SKIP, additional_properties = nil) ⇒ Mxedge

Returns a new instance of Mxedge.



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/mist_api/models/mxedge.rb', line 201

def initialize(model = nil, name = nil, created_time = SKIP,
               for_site = SKIP, id = SKIP, mac = SKIP, magic = SKIP,
               modified_time = SKIP, mxagent_registered = SKIP,
               mxcluster_id = SKIP, mxedge_mgmt = SKIP, notes = SKIP,
               ntp_servers = SKIP, oob_ip_config = SKIP, org_id = SKIP,
               proxy = SKIP, services = SKIP, site_id = SKIP,
               tunterm_dhcpd_config = SKIP, tunterm_extra_routes = SKIP,
               tunterm_igmp_snooping_config = SKIP,
               tunterm_ip_config = SKIP, tunterm_monitoring = SKIP,
               tunterm_multicast_config = SKIP,
               tunterm_other_ip_configs = SKIP, tunterm_port_config = SKIP,
               tunterm_registered = SKIP, tunterm_switch_config = SKIP,
               versions = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @created_time = created_time unless created_time == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @mac = mac unless mac == SKIP
  @magic = magic unless magic == SKIP
  @model = model
  @modified_time = modified_time unless modified_time == SKIP
  @mxagent_registered = mxagent_registered unless mxagent_registered == SKIP
  @mxcluster_id = mxcluster_id unless mxcluster_id == SKIP
  @mxedge_mgmt = mxedge_mgmt unless mxedge_mgmt == SKIP
  @name = name
  @notes = notes unless notes == SKIP
  @ntp_servers = ntp_servers unless ntp_servers == SKIP
  @oob_ip_config = oob_ip_config unless oob_ip_config == SKIP
  @org_id = org_id unless org_id == SKIP
  @proxy = proxy unless proxy == SKIP
  @services = services unless services == SKIP
  @site_id = site_id unless site_id == SKIP
  @tunterm_dhcpd_config = tunterm_dhcpd_config unless tunterm_dhcpd_config == SKIP
  @tunterm_extra_routes = tunterm_extra_routes unless tunterm_extra_routes == SKIP
  unless tunterm_igmp_snooping_config == SKIP
    @tunterm_igmp_snooping_config =
      tunterm_igmp_snooping_config
  end
  @tunterm_ip_config = tunterm_ip_config unless tunterm_ip_config == SKIP
  @tunterm_monitoring = tunterm_monitoring unless tunterm_monitoring == SKIP
  @tunterm_multicast_config = tunterm_multicast_config unless tunterm_multicast_config == SKIP
  @tunterm_other_ip_configs = tunterm_other_ip_configs unless tunterm_other_ip_configs == SKIP
  @tunterm_port_config = tunterm_port_config unless tunterm_port_config == SKIP
  @tunterm_registered = tunterm_registered unless tunterm_registered == SKIP
  @tunterm_switch_config = tunterm_switch_config unless tunterm_switch_config == SKIP
  @versions = versions unless versions == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#macString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def mac
  @mac
end

#magicString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def magic
  @magic
end

#modelString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def model
  @model
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#mxagent_registeredTrueClass | FalseClass

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

Returns:

  • (TrueClass | FalseClass)


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

def mxagent_registered
  @mxagent_registered
end

#mxcluster_idUUID | String

MxCluster this MxEdge belongs to

Returns:

  • (UUID | String)


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

def mxcluster_id
  @mxcluster_id
end

#mxedge_mgmtMxedgeMgmt

MxCluster this MxEdge belongs to

Returns:



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

def mxedge_mgmt
  @mxedge_mgmt
end

#nameString

MxCluster this MxEdge belongs to

Returns:

  • (String)


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

def name
  @name
end

#notesString

MxCluster this MxEdge belongs to

Returns:

  • (String)


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

def notes
  @notes
end

#ntp_serversArray[String]

MxCluster this MxEdge belongs to

Returns:

  • (Array[String])


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

def ntp_servers
  @ntp_servers
end

#oob_ip_configMxedgeOobIpConfig

IPconfiguration of the Mist Edge out-of_band management interface

Returns:

  • (MxedgeOobIpConfig)


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

def oob_ip_config
  @oob_ip_config
end

#org_idUUID | String

IPconfiguration of the Mist Edge out-of_band management interface

Returns:

  • (UUID | String)


70
71
72
# File 'lib/mist_api/models/mxedge.rb', line 70

def org_id
  @org_id
end

#proxyProxy

Proxy Configuration to talk to Mist

Returns:



74
75
76
# File 'lib/mist_api/models/mxedge.rb', line 74

def proxy
  @proxy
end

#servicesArray[String]

List of services to run, tunterm only for now

Returns:

  • (Array[String])


78
79
80
# File 'lib/mist_api/models/mxedge.rb', line 78

def services
  @services
end

#site_idUUID | String

List of services to run, tunterm only for now

Returns:

  • (UUID | String)


82
83
84
# File 'lib/mist_api/models/mxedge.rb', line 82

def site_id
  @site_id
end

#tunterm_dhcpd_configMxedgeTuntermDhcpdConfig

Global and per-VLAN. Property key is the VLAN ID



86
87
88
# File 'lib/mist_api/models/mxedge.rb', line 86

def tunterm_dhcpd_config
  @tunterm_dhcpd_config
end

#tunterm_extra_routesHash[String, MxedgeTuntermExtraRoute]

Property key is a CIDR

Returns:



90
91
92
# File 'lib/mist_api/models/mxedge.rb', line 90

def tunterm_extra_routes
  @tunterm_extra_routes
end

#tunterm_igmp_snooping_configMxedgeTuntermIgmpSnoopingConfig

Property key is a CIDR



94
95
96
# File 'lib/mist_api/models/mxedge.rb', line 94

def tunterm_igmp_snooping_config
  @tunterm_igmp_snooping_config
end

#tunterm_ip_configMxedgeTuntermIpConfig

IPconfiguration of the Mist Tunnel interface



98
99
100
# File 'lib/mist_api/models/mxedge.rb', line 98

def tunterm_ip_config
  @tunterm_ip_config
end

#tunterm_monitoringArray[TuntermMonitoringItem]

IPconfiguration of the Mist Tunnel interface

Returns:



102
103
104
# File 'lib/mist_api/models/mxedge.rb', line 102

def tunterm_monitoring
  @tunterm_monitoring
end

#tunterm_multicast_configMxedgeTuntermMulticastConfig

IPconfiguration of the Mist Tunnel interface



106
107
108
# File 'lib/mist_api/models/mxedge.rb', line 106

def tunterm_multicast_config
  @tunterm_multicast_config
end

#tunterm_other_ip_configsHash[String, MxedgeTuntermOtherIpConfig]

IPconfigs by VLAN ID. Property key is the VLAN ID

Returns:



110
111
112
# File 'lib/mist_api/models/mxedge.rb', line 110

def tunterm_other_ip_configs
  @tunterm_other_ip_configs
end

#tunterm_port_configTuntermPortConfig

Ethernet port configurations

Returns:



114
115
116
# File 'lib/mist_api/models/mxedge.rb', line 114

def tunterm_port_config
  @tunterm_port_config
end

#tunterm_registeredTrueClass | FalseClass

Ethernet port configurations

Returns:

  • (TrueClass | FalseClass)


118
119
120
# File 'lib/mist_api/models/mxedge.rb', line 118

def tunterm_registered
  @tunterm_registered
end

#tunterm_switch_configMxedgeTuntermSwitchConfigs

If custom vlan settings are desired



122
123
124
# File 'lib/mist_api/models/mxedge.rb', line 122

def tunterm_switch_config
  @tunterm_switch_config
end

#versionsMxedgeVersions

If custom vlan settings are desired

Returns:



126
127
128
# File 'lib/mist_api/models/mxedge.rb', line 126

def versions
  @versions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/mist_api/models/mxedge.rb', line 253

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  model = hash.key?('model') ? hash['model'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  magic = hash.key?('magic') ? hash['magic'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  mxagent_registered =
    hash.key?('mxagent_registered') ? hash['mxagent_registered'] : SKIP
  mxcluster_id = hash.key?('mxcluster_id') ? hash['mxcluster_id'] : SKIP
  mxedge_mgmt = MxedgeMgmt.from_hash(hash['mxedge_mgmt']) if hash['mxedge_mgmt']
  notes = hash.key?('notes') ? hash['notes'] : SKIP
  ntp_servers = hash.key?('ntp_servers') ? hash['ntp_servers'] : SKIP
  oob_ip_config = MxedgeOobIpConfig.from_hash(hash['oob_ip_config']) if hash['oob_ip_config']
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  proxy = Proxy.from_hash(hash['proxy']) if hash['proxy']
  services = hash.key?('services') ? hash['services'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  tunterm_dhcpd_config = MxedgeTuntermDhcpdConfig.from_hash(hash['tunterm_dhcpd_config']) if
    hash['tunterm_dhcpd_config']
  tunterm_extra_routes = MxedgeTuntermExtraRoute.from_hash(hash['tunterm_extra_routes']) if
    hash['tunterm_extra_routes']

  tunterm_extra_routes = SKIP unless hash.key?('tunterm_extra_routes')
  if hash['tunterm_igmp_snooping_config']
    tunterm_igmp_snooping_config = MxedgeTuntermIgmpSnoopingConfig.from_hash(hash['tunterm_igmp_snooping_config'])
  end
  tunterm_ip_config = MxedgeTuntermIpConfig.from_hash(hash['tunterm_ip_config']) if
    hash['tunterm_ip_config']
  # Parameter is an array, so we need to iterate through it
  tunterm_monitoring = nil
  unless hash['tunterm_monitoring'].nil?
    tunterm_monitoring = []
    hash['tunterm_monitoring'].each do |structure|
      tunterm_monitoring << (TuntermMonitoringItem.from_hash(structure) if structure)
    end
  end

  tunterm_monitoring = SKIP unless hash.key?('tunterm_monitoring')
  if hash['tunterm_multicast_config']
    tunterm_multicast_config = MxedgeTuntermMulticastConfig.from_hash(hash['tunterm_multicast_config'])
  end
  if hash['tunterm_other_ip_configs']
    tunterm_other_ip_configs = MxedgeTuntermOtherIpConfig.from_hash(hash['tunterm_other_ip_configs'])
  end

  tunterm_other_ip_configs = SKIP unless hash.key?('tunterm_other_ip_configs')
  tunterm_port_config = TuntermPortConfig.from_hash(hash['tunterm_port_config']) if
    hash['tunterm_port_config']
  tunterm_registered =
    hash.key?('tunterm_registered') ? hash['tunterm_registered'] : SKIP
  tunterm_switch_config = MxedgeTuntermSwitchConfigs.from_hash(hash['tunterm_switch_config']) if
    hash['tunterm_switch_config']
  versions = MxedgeVersions.from_hash(hash['versions']) if hash['versions']

  # 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.
  Mxedge.new(model,
             name,
             created_time,
             for_site,
             id,
             mac,
             magic,
             modified_time,
             mxagent_registered,
             mxcluster_id,
             mxedge_mgmt,
             notes,
             ntp_servers,
             oob_ip_config,
             org_id,
             proxy,
             services,
             site_id,
             tunterm_dhcpd_config,
             tunterm_extra_routes,
             tunterm_igmp_snooping_config,
             tunterm_ip_config,
             tunterm_monitoring,
             tunterm_multicast_config,
             tunterm_other_ip_configs,
             tunterm_port_config,
             tunterm_registered,
             tunterm_switch_config,
             versions,
             additional_properties)
end

.namesObject

A mapping from model property names to API property names.



129
130
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
159
160
161
# File 'lib/mist_api/models/mxedge.rb', line 129

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['mac'] = 'mac'
  @_hash['magic'] = 'magic'
  @_hash['model'] = 'model'
  @_hash['modified_time'] = 'modified_time'
  @_hash['mxagent_registered'] = 'mxagent_registered'
  @_hash['mxcluster_id'] = 'mxcluster_id'
  @_hash['mxedge_mgmt'] = 'mxedge_mgmt'
  @_hash['name'] = 'name'
  @_hash['notes'] = 'notes'
  @_hash['ntp_servers'] = 'ntp_servers'
  @_hash['oob_ip_config'] = 'oob_ip_config'
  @_hash['org_id'] = 'org_id'
  @_hash['proxy'] = 'proxy'
  @_hash['services'] = 'services'
  @_hash['site_id'] = 'site_id'
  @_hash['tunterm_dhcpd_config'] = 'tunterm_dhcpd_config'
  @_hash['tunterm_extra_routes'] = 'tunterm_extra_routes'
  @_hash['tunterm_igmp_snooping_config'] = 'tunterm_igmp_snooping_config'
  @_hash['tunterm_ip_config'] = 'tunterm_ip_config'
  @_hash['tunterm_monitoring'] = 'tunterm_monitoring'
  @_hash['tunterm_multicast_config'] = 'tunterm_multicast_config'
  @_hash['tunterm_other_ip_configs'] = 'tunterm_other_ip_configs'
  @_hash['tunterm_port_config'] = 'tunterm_port_config'
  @_hash['tunterm_registered'] = 'tunterm_registered'
  @_hash['tunterm_switch_config'] = 'tunterm_switch_config'
  @_hash['versions'] = 'versions'
  @_hash
end

.nullablesObject

An array for nullable fields



197
198
199
# File 'lib/mist_api/models/mxedge.rb', line 197

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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
# File 'lib/mist_api/models/mxedge.rb', line 164

def self.optionals
  %w[
    created_time
    for_site
    id
    mac
    magic
    modified_time
    mxagent_registered
    mxcluster_id
    mxedge_mgmt
    notes
    ntp_servers
    oob_ip_config
    org_id
    proxy
    services
    site_id
    tunterm_dhcpd_config
    tunterm_extra_routes
    tunterm_igmp_snooping_config
    tunterm_ip_config
    tunterm_monitoring
    tunterm_multicast_config
    tunterm_other_ip_configs
    tunterm_port_config
    tunterm_registered
    tunterm_switch_config
    versions
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/mist_api/models/mxedge.rb', line 372

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, for_site: #{@for_site.inspect}, id:"\
  " #{@id.inspect}, mac: #{@mac.inspect}, magic: #{@magic.inspect}, model: #{@model.inspect},"\
  " modified_time: #{@modified_time.inspect}, mxagent_registered:"\
  " #{@mxagent_registered.inspect}, mxcluster_id: #{@mxcluster_id.inspect}, mxedge_mgmt:"\
  " #{@mxedge_mgmt.inspect}, name: #{@name.inspect}, notes: #{@notes.inspect}, ntp_servers:"\
  " #{@ntp_servers.inspect}, oob_ip_config: #{@oob_ip_config.inspect}, org_id:"\
  " #{@org_id.inspect}, proxy: #{@proxy.inspect}, services: #{@services.inspect}, site_id:"\
  " #{@site_id.inspect}, tunterm_dhcpd_config: #{@tunterm_dhcpd_config.inspect},"\
  " tunterm_extra_routes: #{@tunterm_extra_routes.inspect}, tunterm_igmp_snooping_config:"\
  " #{@tunterm_igmp_snooping_config.inspect}, tunterm_ip_config:"\
  " #{@tunterm_ip_config.inspect}, tunterm_monitoring: #{@tunterm_monitoring.inspect},"\
  " tunterm_multicast_config: #{@tunterm_multicast_config.inspect}, tunterm_other_ip_configs:"\
  " #{@tunterm_other_ip_configs.inspect}, tunterm_port_config:"\
  " #{@tunterm_port_config.inspect}, tunterm_registered: #{@tunterm_registered.inspect},"\
  " tunterm_switch_config: #{@tunterm_switch_config.inspect}, versions: #{@versions.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/mist_api/models/mxedge.rb', line 354

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, for_site: #{@for_site}, id: #{@id}, mac:"\
  " #{@mac}, magic: #{@magic}, model: #{@model}, modified_time: #{@modified_time},"\
  " mxagent_registered: #{@mxagent_registered}, mxcluster_id: #{@mxcluster_id}, mxedge_mgmt:"\
  " #{@mxedge_mgmt}, name: #{@name}, notes: #{@notes}, ntp_servers: #{@ntp_servers},"\
  " oob_ip_config: #{@oob_ip_config}, org_id: #{@org_id}, proxy: #{@proxy}, services:"\
  " #{@services}, site_id: #{@site_id}, tunterm_dhcpd_config: #{@tunterm_dhcpd_config},"\
  " tunterm_extra_routes: #{@tunterm_extra_routes}, tunterm_igmp_snooping_config:"\
  " #{@tunterm_igmp_snooping_config}, tunterm_ip_config: #{@tunterm_ip_config},"\
  " tunterm_monitoring: #{@tunterm_monitoring}, tunterm_multicast_config:"\
  " #{@tunterm_multicast_config}, tunterm_other_ip_configs: #{@tunterm_other_ip_configs},"\
  " tunterm_port_config: #{@tunterm_port_config}, tunterm_registered: #{@tunterm_registered},"\
  " tunterm_switch_config: #{@tunterm_switch_config}, versions: #{@versions},"\
  " additional_properties: #{@additional_properties}>"
end