Class: MistApi::Radsec

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

Overview

RadSec settings

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(coa_enabled = false, enabled = SKIP, idle_timeout = SKIP, mxcluster_ids = SKIP, proxy_hosts = SKIP, server_name = SKIP, servers = SKIP, use_mxedge = SKIP, use_site_mxedge = false) ⇒ Radsec

Returns a new instance of Radsec.



88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/mist_api/models/radsec.rb', line 88

def initialize(coa_enabled = false, enabled = SKIP, idle_timeout = SKIP,
               mxcluster_ids = SKIP, proxy_hosts = SKIP, server_name = SKIP,
               servers = SKIP, use_mxedge = SKIP, use_site_mxedge = false)
  @coa_enabled = coa_enabled unless coa_enabled == SKIP
  @enabled = enabled unless enabled == SKIP
  @idle_timeout = idle_timeout unless idle_timeout == SKIP
  @mxcluster_ids = mxcluster_ids unless mxcluster_ids == SKIP
  @proxy_hosts = proxy_hosts unless proxy_hosts == SKIP
  @server_name = server_name unless server_name == SKIP
  @servers = servers unless servers == SKIP
  @use_mxedge = use_mxedge unless use_mxedge == SKIP
  @use_site_mxedge = use_site_mxedge unless use_site_mxedge == SKIP
end

Instance Attribute Details

#coa_enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def coa_enabled
  @coa_enabled
end

#enabledTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#idle_timeoutObject

Radsec Idle Timeout in seconds. Default is 60

Returns:

  • (Object)


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

def idle_timeout
  @idle_timeout
end

#mxcluster_idsArray[UUID | String]

To use Org mxedges when this WLAN does not use mxtunnel, specify their mxcluster_ids. Org mxedge(s) identified by mxcluster_ids

Returns:

  • (Array[UUID | String])


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

def mxcluster_ids
  @mxcluster_ids
end

#proxy_hostsArray[String]

Default is site.mxedge.radsec.proxy_hosts which must be a superset of all ‘wlans.radsec.proxy_hosts`. When `radsec.proxy_hosts` are not used, tunnel peers (org or site mxedges) are used irrespective of `use_site_mxedge`

Returns:

  • (Array[String])


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

def proxy_hosts
  @proxy_hosts
end

#server_nameString

Name of the server to verify (against the cacerts in Org Setting). Only if not Mist Edge.

Returns:

  • (String)


39
40
41
# File 'lib/mist_api/models/radsec.rb', line 39

def server_name
  @server_name
end

#serversArray[RadsecServer]

List of RadSec Servers. Only if not Mist Edge.

Returns:



43
44
45
# File 'lib/mist_api/models/radsec.rb', line 43

def servers
  @servers
end

#use_mxedgeTrueClass | FalseClass

use mxedge(s) as RadSec Proxy

Returns:

  • (TrueClass | FalseClass)


47
48
49
# File 'lib/mist_api/models/radsec.rb', line 47

def use_mxedge
  @use_mxedge
end

#use_site_mxedgeTrueClass | FalseClass

To use Site mxedges when this WLAN does not use mxtunnel

Returns:

  • (TrueClass | FalseClass)


51
52
53
# File 'lib/mist_api/models/radsec.rb', line 51

def use_site_mxedge
  @use_site_mxedge
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
129
130
131
132
133
134
135
136
137
138
# File 'lib/mist_api/models/radsec.rb', line 103

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  coa_enabled = hash['coa_enabled'] ||= false
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  idle_timeout = hash.key?('idle_timeout') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:RadsecIdleTimeout), hash['idle_timeout']
  ) : SKIP
  mxcluster_ids = hash.key?('mxcluster_ids') ? hash['mxcluster_ids'] : SKIP
  proxy_hosts = hash.key?('proxy_hosts') ? hash['proxy_hosts'] : SKIP
  server_name = hash.key?('server_name') ? hash['server_name'] : SKIP
  # Parameter is an array, so we need to iterate through it
  servers = nil
  unless hash['servers'].nil?
    servers = []
    hash['servers'].each do |structure|
      servers << (RadsecServer.from_hash(structure) if structure)
    end
  end

  servers = SKIP unless hash.key?('servers')
  use_mxedge = hash.key?('use_mxedge') ? hash['use_mxedge'] : SKIP
  use_site_mxedge = hash['use_site_mxedge'] ||= false

  # Create object from extracted values.
  Radsec.new(coa_enabled,
             enabled,
             idle_timeout,
             mxcluster_ids,
             proxy_hosts,
             server_name,
             servers,
             use_mxedge,
             use_site_mxedge)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/radsec.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['coa_enabled'] = 'coa_enabled'
  @_hash['enabled'] = 'enabled'
  @_hash['idle_timeout'] = 'idle_timeout'
  @_hash['mxcluster_ids'] = 'mxcluster_ids'
  @_hash['proxy_hosts'] = 'proxy_hosts'
  @_hash['server_name'] = 'server_name'
  @_hash['servers'] = 'servers'
  @_hash['use_mxedge'] = 'use_mxedge'
  @_hash['use_site_mxedge'] = 'use_site_mxedge'
  @_hash
end

.nullablesObject

An array for nullable fields



84
85
86
# File 'lib/mist_api/models/radsec.rb', line 84

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/radsec.rb', line 69

def self.optionals
  %w[
    coa_enabled
    enabled
    idle_timeout
    mxcluster_ids
    proxy_hosts
    server_name
    servers
    use_mxedge
    use_site_mxedge
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (Radsec | Hash)

    value against the validation is performed.



142
143
144
145
146
147
148
# File 'lib/mist_api/models/radsec.rb', line 142

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



160
161
162
163
164
165
166
167
# File 'lib/mist_api/models/radsec.rb', line 160

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} coa_enabled: #{@coa_enabled.inspect}, enabled: #{@enabled.inspect},"\
  " idle_timeout: #{@idle_timeout.inspect}, mxcluster_ids: #{@mxcluster_ids.inspect},"\
  " proxy_hosts: #{@proxy_hosts.inspect}, server_name: #{@server_name.inspect}, servers:"\
  " #{@servers.inspect}, use_mxedge: #{@use_mxedge.inspect}, use_site_mxedge:"\
  " #{@use_site_mxedge.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



151
152
153
154
155
156
157
# File 'lib/mist_api/models/radsec.rb', line 151

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} coa_enabled: #{@coa_enabled}, enabled: #{@enabled}, idle_timeout:"\
  " #{@idle_timeout}, mxcluster_ids: #{@mxcluster_ids}, proxy_hosts: #{@proxy_hosts},"\
  " server_name: #{@server_name}, servers: #{@servers}, use_mxedge: #{@use_mxedge},"\
  " use_site_mxedge: #{@use_site_mxedge}>"
end