Class: MistApi::Mxcluster

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

Overview

MxCluster

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(created_time = SKIP, for_site = SKIP, id = SKIP, mist_das = SKIP, mist_nac = SKIP, modified_time = SKIP, mxedge_mgmt = SKIP, name = SKIP, org_id = SKIP, proxy = SKIP, radsec = SKIP, radsec_tls = SKIP, site_id = SKIP, tunterm_ap_subnets = SKIP, tunterm_dhcpd_config = SKIP, tunterm_extra_routes = SKIP, tunterm_hosts = SKIP, tunterm_hosts_order = SKIP, tunterm_hosts_selection = MxclusterTuntermHostsSelectionEnum::SHUFFLE, tunterm_monitoring = SKIP, tunterm_monitoring_disabled = SKIP, additional_properties = nil) ⇒ Mxcluster

Returns a new instance of Mxcluster.



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
210
211
212
213
214
215
216
# File 'lib/mist_api/models/mxcluster.rb', line 177

def initialize(
  created_time = SKIP, for_site = SKIP, id = SKIP, mist_das = SKIP,
  mist_nac = SKIP, modified_time = SKIP, mxedge_mgmt = SKIP, name = SKIP,
  org_id = SKIP, proxy = SKIP, radsec = SKIP, radsec_tls = SKIP,
  site_id = SKIP, tunterm_ap_subnets = SKIP, tunterm_dhcpd_config = SKIP,
  tunterm_extra_routes = SKIP, tunterm_hosts = SKIP,
  tunterm_hosts_order = SKIP,
  tunterm_hosts_selection = MxclusterTuntermHostsSelectionEnum::SHUFFLE,
  tunterm_monitoring = SKIP, tunterm_monitoring_disabled = 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
  @mist_das = mist_das unless mist_das == SKIP
  @mist_nac = mist_nac unless mist_nac == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @mxedge_mgmt = mxedge_mgmt unless mxedge_mgmt == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @proxy = proxy unless proxy == SKIP
  @radsec = radsec unless radsec == SKIP
  @radsec_tls = radsec_tls unless radsec_tls == SKIP
  @site_id = site_id unless site_id == SKIP
  @tunterm_ap_subnets = tunterm_ap_subnets unless tunterm_ap_subnets == SKIP
  @tunterm_dhcpd_config = tunterm_dhcpd_config unless tunterm_dhcpd_config == SKIP
  @tunterm_extra_routes = tunterm_extra_routes unless tunterm_extra_routes == SKIP
  @tunterm_hosts = tunterm_hosts unless tunterm_hosts == SKIP
  @tunterm_hosts_order = tunterm_hosts_order unless tunterm_hosts_order == SKIP
  @tunterm_hosts_selection = tunterm_hosts_selection unless tunterm_hosts_selection == SKIP
  @tunterm_monitoring = tunterm_monitoring unless tunterm_monitoring == SKIP
  unless tunterm_monitoring_disabled == SKIP
    @tunterm_monitoring_disabled =
      tunterm_monitoring_disabled
  end
  @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/mxcluster.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/mxcluster.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/mxcluster.rb', line 22

def id
  @id
end

#mist_dasMxedgeDas

Configure cloud-assisted dynamic authorization service on this cluster of mist edges

Returns:



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

def mist_das
  @mist_das
end

#mist_nacMxclusterNac

Configure cloud-assisted dynamic authorization service on this cluster of mist edges

Returns:



32
33
34
# File 'lib/mist_api/models/mxcluster.rb', line 32

def mist_nac
  @mist_nac
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#mxedge_mgmtMxedgeMgmt

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

Returns:



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

def mxedge_mgmt
  @mxedge_mgmt
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

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

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#proxyProxy

Proxy Configuration to talk to Mist

Returns:



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

def proxy
  @proxy
end

#radsecMxclusterRadsec

MxEdge RadSec Configuration

Returns:



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

def radsec
  @radsec
end

#radsec_tlsMxclusterRadsecTls

MxEdge RadSec Configuration

Returns:



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

def radsec_tls
  @radsec_tls
end

#site_idUUID | String

MxEdge RadSec Configuration

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#tunterm_ap_subnetsArray[String]

List of subnets where we allow AP to establish Mist Tunnels from

Returns:

  • (Array[String])


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

def tunterm_ap_subnets
  @tunterm_ap_subnets
end

#tunterm_dhcpd_configTuntermDhcpdConfig

DHCP server/relay configuration of Mist Tunneled VLANs. Property key is the VLAN ID

Returns:



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

def tunterm_dhcpd_config
  @tunterm_dhcpd_config
end

#tunterm_extra_routesHash[String, MxclusterTuntermExtraRoute]

Extra routes for Mist Tunneled VLANs. Property key is a CIDR

Returns:



77
78
79
# File 'lib/mist_api/models/mxcluster.rb', line 77

def tunterm_extra_routes
  @tunterm_extra_routes
end

#tunterm_hostsArray[String]

Hostnames or IPs where a Mist Tunnel will use as the Peer (i.e. they are reachable from AP)

Returns:

  • (Array[String])


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

def tunterm_hosts
  @tunterm_hosts
end

#tunterm_hosts_orderArray[Integer]

List of index of tunterm_hosts

Returns:

  • (Array[Integer])


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

def tunterm_hosts_order
  @tunterm_hosts_order
end

#tunterm_hosts_selectionMxclusterTuntermHostsSelectionEnum

Ordering of tunterm_hosts for mxedge within the same mxcluster. enum:

* `shuffle`: the ordering of tunterm_hosts is randomized by the

device”s MAC

* `shuffle-by-site`: shuffle by site_id+tunnel_id (so when client

connects to a specific Tunnel, it will go to the same (order of) mxedge, and we load-balancing between tunnels)

* `ordered`: order decided by tunterm_hosts_order


96
97
98
# File 'lib/mist_api/models/mxcluster.rb', line 96

def tunterm_hosts_selection
  @tunterm_hosts_selection
end

#tunterm_monitoringArray[TuntermMonitoringItem]

Ordering of tunterm_hosts for mxedge within the same mxcluster. enum:

* `shuffle`: the ordering of tunterm_hosts is randomized by the

device”s MAC

* `shuffle-by-site`: shuffle by site_id+tunnel_id (so when client

connects to a specific Tunnel, it will go to the same (order of) mxedge, and we load-balancing between tunnels)

* `ordered`: order decided by tunterm_hosts_order

Returns:



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

def tunterm_monitoring
  @tunterm_monitoring
end

#tunterm_monitoring_disabledTrueClass | FalseClass

Ordering of tunterm_hosts for mxedge within the same mxcluster. enum:

* `shuffle`: the ordering of tunterm_hosts is randomized by the

device”s MAC

* `shuffle-by-site`: shuffle by site_id+tunnel_id (so when client

connects to a specific Tunnel, it will go to the same (order of) mxedge, and we load-balancing between tunnels)

* `ordered`: order decided by tunterm_hosts_order

Returns:

  • (TrueClass | FalseClass)


116
117
118
# File 'lib/mist_api/models/mxcluster.rb', line 116

def tunterm_monitoring_disabled
  @tunterm_monitoring_disabled
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
251
252
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
# File 'lib/mist_api/models/mxcluster.rb', line 219

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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
  mist_das = MxedgeDas.from_hash(hash['mist_das']) if hash['mist_das']
  mist_nac = MxclusterNac.from_hash(hash['mist_nac']) if hash['mist_nac']
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  mxedge_mgmt = MxedgeMgmt.from_hash(hash['mxedge_mgmt']) if hash['mxedge_mgmt']
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  proxy = Proxy.from_hash(hash['proxy']) if hash['proxy']
  radsec = MxclusterRadsec.from_hash(hash['radsec']) if hash['radsec']
  radsec_tls = MxclusterRadsecTls.from_hash(hash['radsec_tls']) if hash['radsec_tls']
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  tunterm_ap_subnets =
    hash.key?('tunterm_ap_subnets') ? hash['tunterm_ap_subnets'] : SKIP
  tunterm_dhcpd_config = TuntermDhcpdConfig.from_hash(hash['tunterm_dhcpd_config']) if
    hash['tunterm_dhcpd_config']
  tunterm_extra_routes = MxclusterTuntermExtraRoute.from_hash(hash['tunterm_extra_routes']) if
    hash['tunterm_extra_routes']

  tunterm_extra_routes = SKIP unless hash.key?('tunterm_extra_routes')
  tunterm_hosts = hash.key?('tunterm_hosts') ? hash['tunterm_hosts'] : SKIP
  tunterm_hosts_order =
    hash.key?('tunterm_hosts_order') ? hash['tunterm_hosts_order'] : SKIP
  tunterm_hosts_selection =
    hash['tunterm_hosts_selection'] ||= MxclusterTuntermHostsSelectionEnum::SHUFFLE
  # 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')
  tunterm_monitoring_disabled =
    hash.key?('tunterm_monitoring_disabled') ? hash['tunterm_monitoring_disabled'] : 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.
  Mxcluster.new(created_time,
                for_site,
                id,
                mist_das,
                mist_nac,
                modified_time,
                mxedge_mgmt,
                name,
                org_id,
                proxy,
                radsec,
                radsec_tls,
                site_id,
                tunterm_ap_subnets,
                tunterm_dhcpd_config,
                tunterm_extra_routes,
                tunterm_hosts,
                tunterm_hosts_order,
                tunterm_hosts_selection,
                tunterm_monitoring,
                tunterm_monitoring_disabled,
                additional_properties)
end

.namesObject

A mapping from model property names to API property names.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/mist_api/models/mxcluster.rb', line 119

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['mist_das'] = 'mist_das'
  @_hash['mist_nac'] = 'mist_nac'
  @_hash['modified_time'] = 'modified_time'
  @_hash['mxedge_mgmt'] = 'mxedge_mgmt'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['proxy'] = 'proxy'
  @_hash['radsec'] = 'radsec'
  @_hash['radsec_tls'] = 'radsec_tls'
  @_hash['site_id'] = 'site_id'
  @_hash['tunterm_ap_subnets'] = 'tunterm_ap_subnets'
  @_hash['tunterm_dhcpd_config'] = 'tunterm_dhcpd_config'
  @_hash['tunterm_extra_routes'] = 'tunterm_extra_routes'
  @_hash['tunterm_hosts'] = 'tunterm_hosts'
  @_hash['tunterm_hosts_order'] = 'tunterm_hosts_order'
  @_hash['tunterm_hosts_selection'] = 'tunterm_hosts_selection'
  @_hash['tunterm_monitoring'] = 'tunterm_monitoring'
  @_hash['tunterm_monitoring_disabled'] = 'tunterm_monitoring_disabled'
  @_hash
end

.nullablesObject

An array for nullable fields



173
174
175
# File 'lib/mist_api/models/mxcluster.rb', line 173

def self.nullables
  []
end

.optionalsObject

An array for optional fields



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/mist_api/models/mxcluster.rb', line 146

def self.optionals
  %w[
    created_time
    for_site
    id
    mist_das
    mist_nac
    modified_time
    mxedge_mgmt
    name
    org_id
    proxy
    radsec
    radsec_tls
    site_id
    tunterm_ap_subnets
    tunterm_dhcpd_config
    tunterm_extra_routes
    tunterm_hosts
    tunterm_hosts_order
    tunterm_hosts_selection
    tunterm_monitoring
    tunterm_monitoring_disabled
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/mist_api/models/mxcluster.rb', line 310

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, for_site: #{@for_site.inspect}, id:"\
  " #{@id.inspect}, mist_das: #{@mist_das.inspect}, mist_nac: #{@mist_nac.inspect},"\
  " modified_time: #{@modified_time.inspect}, mxedge_mgmt: #{@mxedge_mgmt.inspect}, name:"\
  " #{@name.inspect}, org_id: #{@org_id.inspect}, proxy: #{@proxy.inspect}, radsec:"\
  " #{@radsec.inspect}, radsec_tls: #{@radsec_tls.inspect}, site_id: #{@site_id.inspect},"\
  " tunterm_ap_subnets: #{@tunterm_ap_subnets.inspect}, tunterm_dhcpd_config:"\
  " #{@tunterm_dhcpd_config.inspect}, tunterm_extra_routes: #{@tunterm_extra_routes.inspect},"\
  " tunterm_hosts: #{@tunterm_hosts.inspect}, tunterm_hosts_order:"\
  " #{@tunterm_hosts_order.inspect}, tunterm_hosts_selection:"\
  " #{@tunterm_hosts_selection.inspect}, tunterm_monitoring: #{@tunterm_monitoring.inspect},"\
  " tunterm_monitoring_disabled: #{@tunterm_monitoring_disabled.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/mist_api/models/mxcluster.rb', line 295

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, for_site: #{@for_site}, id: #{@id},"\
  " mist_das: #{@mist_das}, mist_nac: #{@mist_nac}, modified_time: #{@modified_time},"\
  " mxedge_mgmt: #{@mxedge_mgmt}, name: #{@name}, org_id: #{@org_id}, proxy: #{@proxy},"\
  " radsec: #{@radsec}, radsec_tls: #{@radsec_tls}, site_id: #{@site_id}, tunterm_ap_subnets:"\
  " #{@tunterm_ap_subnets}, tunterm_dhcpd_config: #{@tunterm_dhcpd_config},"\
  " tunterm_extra_routes: #{@tunterm_extra_routes}, tunterm_hosts: #{@tunterm_hosts},"\
  " tunterm_hosts_order: #{@tunterm_hosts_order}, tunterm_hosts_selection:"\
  " #{@tunterm_hosts_selection}, tunterm_monitoring: #{@tunterm_monitoring},"\
  " tunterm_monitoring_disabled: #{@tunterm_monitoring_disabled}, additional_properties:"\
  " #{@additional_properties}>"
end