Class: MistApi::NacClientEvent

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

Overview

NacClientEvent 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(ap = SKIP, auth_type = SKIP, bssid = SKIP, client_type = SKIP, device_mac = SKIP, dryrun_nacrule_id = SKIP, dryrun_nacrule_matched = SKIP, idp_id = SKIP, idp_role = SKIP, idp_username = SKIP, mac = SKIP, mxedge_id = SKIP, nacrule_id = SKIP, nacrule_matched = SKIP, nas_vendor = SKIP, org_id = SKIP, port_id = SKIP, port_type = SKIP, random_mac = SKIP, resp_attrs = SKIP, site_id = SKIP, ssid = SKIP, timestamp = SKIP, type = SKIP, usermac_label = SKIP, username = SKIP, vlan = SKIP, vlan_source = SKIP) ⇒ NacClientEvent

Returns a new instance of NacClientEvent.



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

def initialize(ap = SKIP, auth_type = SKIP, bssid = SKIP,
               client_type = SKIP, device_mac = SKIP,
               dryrun_nacrule_id = SKIP, dryrun_nacrule_matched = SKIP,
               idp_id = SKIP, idp_role = SKIP, idp_username = SKIP,
               mac = SKIP, mxedge_id = SKIP, nacrule_id = SKIP,
               nacrule_matched = SKIP, nas_vendor = SKIP, org_id = SKIP,
               port_id = SKIP, port_type = SKIP, random_mac = SKIP,
               resp_attrs = SKIP, site_id = SKIP, ssid = SKIP,
               timestamp = SKIP, type = SKIP, usermac_label = SKIP,
               username = SKIP, vlan = SKIP, vlan_source = SKIP)
  @ap = ap unless ap == SKIP
  @auth_type = auth_type unless auth_type == SKIP
  @bssid = bssid unless bssid == SKIP
  @client_type = client_type unless client_type == SKIP
  @device_mac = device_mac unless device_mac == SKIP
  @dryrun_nacrule_id = dryrun_nacrule_id unless dryrun_nacrule_id == SKIP
  @dryrun_nacrule_matched = dryrun_nacrule_matched unless dryrun_nacrule_matched == SKIP
  @idp_id = idp_id unless idp_id == SKIP
  @idp_role = idp_role unless idp_role == SKIP
  @idp_username = idp_username unless idp_username == SKIP
  @mac = mac unless mac == SKIP
  @mxedge_id = mxedge_id unless mxedge_id == SKIP
  @nacrule_id = nacrule_id unless nacrule_id == SKIP
  @nacrule_matched = nacrule_matched unless nacrule_matched == SKIP
  @nas_vendor = nas_vendor unless nas_vendor == SKIP
  @org_id = org_id unless org_id == SKIP
  @port_id = port_id unless port_id == SKIP
  @port_type = port_type unless port_type == SKIP
  @random_mac = random_mac unless random_mac == SKIP
  @resp_attrs = resp_attrs unless resp_attrs == SKIP
  @site_id = site_id unless site_id == SKIP
  @ssid = ssid unless ssid == SKIP
  @timestamp = timestamp unless timestamp == SKIP
  @type = type unless type == SKIP
  @usermac_label = usermac_label unless usermac_label == SKIP
  @username = username unless username == SKIP
  @vlan = vlan unless vlan == SKIP
  @vlan_source = vlan_source unless vlan_source == SKIP
end

Instance Attribute Details

#apString

AP mac

Returns:

  • (String)


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

def ap
  @ap
end

#auth_typeNacAuthTypeEnum

enum: ‘cert`, `device-auth`, `eap-teap`, `eap-tls`, `eap-ttls`, `idp`, `mab`, `eap-peap`

Returns:



19
20
21
# File 'lib/mist_api/models/nac_client_event.rb', line 19

def auth_type
  @auth_type
end

#bssidString

BSSID

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/nac_client_event.rb', line 23

def bssid
  @bssid
end

#client_typeNacAccessTypeEnum

Type of network access. enum: ‘wireless`, `wired`, `vty`

Returns:



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

def client_type
  @client_type
end

#device_macString

MAC Address of the device (AP, Switch) the client is connected to

Returns:

  • (String)


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

def device_mac
  @device_mac
end

#dryrun_nacrule_idUUID | String

NAC Policy Dry Run Rule ID, if present and matched

Returns:

  • (UUID | String)


35
36
37
# File 'lib/mist_api/models/nac_client_event.rb', line 35

def dryrun_nacrule_id
  @dryrun_nacrule_id
end

#dryrun_nacrule_matchedTrueClass | FalseClass

‘true` if dryrun rule present and matched with priority, `false` if not matched or not present

Returns:

  • (TrueClass | FalseClass)


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

def dryrun_nacrule_matched
  @dryrun_nacrule_matched
end

#idp_idUUID | String

If IDP is used, the id of the IDP configuration used

Returns:

  • (UUID | String)


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

def idp_id
  @idp_id
end

#idp_roleArray[String]

If IDP is used, the id of the IDP configuration used

Returns:

  • (Array[String])


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

def idp_role
  @idp_role
end

#idp_usernameString

If IDP is used, the username presented to the Identity Provider

Returns:

  • (String)


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

def idp_username
  @idp_username
end

#macString

Client MAC address

Returns:

  • (String)


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

def mac
  @mac
end

#mxedge_idString

Mist Edge ID used to connect to cloud

Returns:

  • (String)


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

def mxedge_id
  @mxedge_id
end

#nacrule_idUUID | String

NAC Policy Rule ID, if matched

Returns:

  • (UUID | String)


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

def nacrule_id
  @nacrule_id
end

#nacrule_matchedTrueClass | FalseClass

NAC Policy Rule Matched

Returns:

  • (TrueClass | FalseClass)


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

def nacrule_matched
  @nacrule_matched
end

#nas_vendorString

Vendor name of the NAS

Returns:

  • (String)


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

def nas_vendor
  @nas_vendor
end

#org_idUUID | String

Vendor name of the NAS

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#port_idString

Port ID where the NAC client event occurred

Returns:

  • (String)


80
81
82
# File 'lib/mist_api/models/nac_client_event.rb', line 80

def port_id
  @port_id
end

#port_typeNacAccessTypeEnum

Type of network access. enum: ‘wireless`, `wired`, `vty`

Returns:



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

def port_type
  @port_type
end

#random_macRandomMacEnum

Whether the client is using randomized MAC Address or not

Returns:



88
89
90
# File 'lib/mist_api/models/nac_client_event.rb', line 88

def random_mac
  @random_mac
end

#resp_attrsArray[String]

List of Radius AVP returned by the Authentication Server

Returns:

  • (Array[String])


92
93
94
# File 'lib/mist_api/models/nac_client_event.rb', line 92

def resp_attrs
  @resp_attrs
end

#site_idUUID | String

List of Radius AVP returned by the Authentication Server

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#ssidString

SSIDs the client was connecting to

Returns:

  • (String)


100
101
102
# File 'lib/mist_api/models/nac_client_event.rb', line 100

def ssid
  @ssid
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


104
105
106
# File 'lib/mist_api/models/nac_client_event.rb', line 104

def timestamp
  @timestamp
end

#typeString

Event type, e.g. NAC_CLIENT_PERMIT. Use the [List NAC Events Definitions]($e/Constants%20Events/listNacEventsDefinitions) endpoint to get the full list of available values.

Returns:

  • (String)


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

def type
  @type
end

#usermac_labelArray[String]

Labels derived from usermac entry

Returns:

  • (Array[String])


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

def usermac_label
  @usermac_label
end

#usernameString

username assigned to the client

Returns:

  • (String)


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

def username
  @username
end

#vlanString

vlan that assigned to the client

Returns:

  • (String)


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

def vlan
  @vlan
end

#vlan_sourceString

Vlan source, e.g. “nactag”, “usermac”

Returns:

  • (String)


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

def vlan_source
  @vlan_source
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/mist_api/models/nac_client_event.rb', line 242

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : SKIP
  auth_type = hash.key?('auth_type') ? hash['auth_type'] : SKIP
  bssid = hash.key?('bssid') ? hash['bssid'] : SKIP
  client_type = hash.key?('client_type') ? hash['client_type'] : SKIP
  device_mac = hash.key?('device_mac') ? hash['device_mac'] : SKIP
  dryrun_nacrule_id =
    hash.key?('dryrun_nacrule_id') ? hash['dryrun_nacrule_id'] : SKIP
  dryrun_nacrule_matched =
    hash.key?('dryrun_nacrule_matched') ? hash['dryrun_nacrule_matched'] : SKIP
  idp_id = hash.key?('idp_id') ? hash['idp_id'] : SKIP
  idp_role = hash.key?('idp_role') ? hash['idp_role'] : SKIP
  idp_username = hash.key?('idp_username') ? hash['idp_username'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  mxedge_id = hash.key?('mxedge_id') ? hash['mxedge_id'] : SKIP
  nacrule_id = hash.key?('nacrule_id') ? hash['nacrule_id'] : SKIP
  nacrule_matched =
    hash.key?('nacrule_matched') ? hash['nacrule_matched'] : SKIP
  nas_vendor = hash.key?('nas_vendor') ? hash['nas_vendor'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  port_id = hash.key?('port_id') ? hash['port_id'] : SKIP
  port_type = hash.key?('port_type') ? hash['port_type'] : SKIP
  random_mac = hash.key?('random_mac') ? hash['random_mac'] : SKIP
  resp_attrs = hash.key?('resp_attrs') ? hash['resp_attrs'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  ssid = hash.key?('ssid') ? hash['ssid'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  usermac_label = hash.key?('usermac_label') ? hash['usermac_label'] : SKIP
  username = hash.key?('username') ? hash['username'] : SKIP
  vlan = hash.key?('vlan') ? hash['vlan'] : SKIP
  vlan_source = hash.key?('vlan_source') ? hash['vlan_source'] : SKIP

  # Create object from extracted values.
  NacClientEvent.new(ap,
                     auth_type,
                     bssid,
                     client_type,
                     device_mac,
                     dryrun_nacrule_id,
                     dryrun_nacrule_matched,
                     idp_id,
                     idp_role,
                     idp_username,
                     mac,
                     mxedge_id,
                     nacrule_id,
                     nacrule_matched,
                     nas_vendor,
                     org_id,
                     port_id,
                     port_type,
                     random_mac,
                     resp_attrs,
                     site_id,
                     ssid,
                     timestamp,
                     type,
                     usermac_label,
                     username,
                     vlan,
                     vlan_source)
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
# File 'lib/mist_api/models/nac_client_event.rb', line 129

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['auth_type'] = 'auth_type'
  @_hash['bssid'] = 'bssid'
  @_hash['client_type'] = 'client_type'
  @_hash['device_mac'] = 'device_mac'
  @_hash['dryrun_nacrule_id'] = 'dryrun_nacrule_id'
  @_hash['dryrun_nacrule_matched'] = 'dryrun_nacrule_matched'
  @_hash['idp_id'] = 'idp_id'
  @_hash['idp_role'] = 'idp_role'
  @_hash['idp_username'] = 'idp_username'
  @_hash['mac'] = 'mac'
  @_hash['mxedge_id'] = 'mxedge_id'
  @_hash['nacrule_id'] = 'nacrule_id'
  @_hash['nacrule_matched'] = 'nacrule_matched'
  @_hash['nas_vendor'] = 'nas_vendor'
  @_hash['org_id'] = 'org_id'
  @_hash['port_id'] = 'port_id'
  @_hash['port_type'] = 'port_type'
  @_hash['random_mac'] = 'random_mac'
  @_hash['resp_attrs'] = 'resp_attrs'
  @_hash['site_id'] = 'site_id'
  @_hash['ssid'] = 'ssid'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash['usermac_label'] = 'usermac_label'
  @_hash['username'] = 'username'
  @_hash['vlan'] = 'vlan'
  @_hash['vlan_source'] = 'vlan_source'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    ap
    auth_type
    bssid
    client_type
    device_mac
    dryrun_nacrule_id
    dryrun_nacrule_matched
    idp_id
    idp_role
    idp_username
    mac
    mxedge_id
    nacrule_id
    nacrule_matched
    nas_vendor
    org_id
    port_id
    port_type
    random_mac
    resp_attrs
    site_id
    ssid
    timestamp
    type
    usermac_label
    username
    vlan
    vlan_source
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (NacClientEvent | Hash)

    value against the validation is performed.



311
312
313
314
315
316
317
# File 'lib/mist_api/models/nac_client_event.rb', line 311

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.



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/mist_api/models/nac_client_event.rb', line 334

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, auth_type: #{@auth_type.inspect}, bssid:"\
  " #{@bssid.inspect}, client_type: #{@client_type.inspect}, device_mac:"\
  " #{@device_mac.inspect}, dryrun_nacrule_id: #{@dryrun_nacrule_id.inspect},"\
  " dryrun_nacrule_matched: #{@dryrun_nacrule_matched.inspect}, idp_id: #{@idp_id.inspect},"\
  " idp_role: #{@idp_role.inspect}, idp_username: #{@idp_username.inspect}, mac:"\
  " #{@mac.inspect}, mxedge_id: #{@mxedge_id.inspect}, nacrule_id: #{@nacrule_id.inspect},"\
  " nacrule_matched: #{@nacrule_matched.inspect}, nas_vendor: #{@nas_vendor.inspect}, org_id:"\
  " #{@org_id.inspect}, port_id: #{@port_id.inspect}, port_type: #{@port_type.inspect},"\
  " random_mac: #{@random_mac.inspect}, resp_attrs: #{@resp_attrs.inspect}, site_id:"\
  " #{@site_id.inspect}, ssid: #{@ssid.inspect}, timestamp: #{@timestamp.inspect}, type:"\
  " #{@type.inspect}, usermac_label: #{@usermac_label.inspect}, username:"\
  " #{@username.inspect}, vlan: #{@vlan.inspect}, vlan_source: #{@vlan_source.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/mist_api/models/nac_client_event.rb', line 320

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, auth_type: #{@auth_type}, bssid: #{@bssid}, client_type:"\
  " #{@client_type}, device_mac: #{@device_mac}, dryrun_nacrule_id: #{@dryrun_nacrule_id},"\
  " dryrun_nacrule_matched: #{@dryrun_nacrule_matched}, idp_id: #{@idp_id}, idp_role:"\
  " #{@idp_role}, idp_username: #{@idp_username}, mac: #{@mac}, mxedge_id: #{@mxedge_id},"\
  " nacrule_id: #{@nacrule_id}, nacrule_matched: #{@nacrule_matched}, nas_vendor:"\
  " #{@nas_vendor}, org_id: #{@org_id}, port_id: #{@port_id}, port_type: #{@port_type},"\
  " random_mac: #{@random_mac}, resp_attrs: #{@resp_attrs}, site_id: #{@site_id}, ssid:"\
  " #{@ssid}, timestamp: #{@timestamp}, type: #{@type}, usermac_label: #{@usermac_label},"\
  " username: #{@username}, vlan: #{@vlan}, vlan_source: #{@vlan_source}>"
end