forked from meraki/dashboard-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwireless.py
More file actions
3565 lines (2649 loc) · 194 KB
/
Copy pathwireless.py
File metadata and controls
3565 lines (2649 loc) · 194 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
139
140
141
142
143
144
145
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
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
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
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
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import urllib
class Wireless(object):
def __init__(self, session):
super(Wireless, self).__init__()
self._session = session
def updateDeviceWirelessAlternateManagementInterfaceIpv6(self, serial: str, **kwargs):
"""
**Update alternate management interface IPv6 address**
https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-alternate-management-interface-ipv-6
- serial (string): Serial
- addresses (array): configured alternate management interface addresses
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'alternateManagementInterface', 'ipv6'],
'operation': 'updateDeviceWirelessAlternateManagementInterfaceIpv6'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/alternateManagementInterface/ipv6'
body_params = ['addresses', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getDeviceWirelessBluetoothSettings(self, serial: str):
"""
**Return the bluetooth settings for a wireless device**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-bluetooth-settings
- serial (string): Serial
"""
metadata = {
'tags': ['wireless', 'configure', 'bluetooth', 'settings'],
'operation': 'getDeviceWirelessBluetoothSettings'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/bluetooth/settings'
return self._session.get(metadata, resource)
def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs):
"""
**Update the bluetooth settings for a wireless device**
https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings
- serial (string): Serial
- uuid (string): Desired UUID of the beacon. If the value is set to null it will reset to Dashboard's
automatically generated value.
- major (integer): Desired major value of the beacon. If the value is set to null it will reset to
Dashboard's automatically generated value.
- minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to
Dashboard's automatically generated value.
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'bluetooth', 'settings'],
'operation': 'updateDeviceWirelessBluetoothSettings'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/bluetooth/settings'
body_params = ['uuid', 'major', 'minor', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getDeviceWirelessConnectionStats(self, serial: str, **kwargs):
"""
**Aggregated connectivity info for a given AP on this network**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-connection-stats
- serial (string): Serial
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'connectionStats'],
'operation': 'getDeviceWirelessConnectionStats'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/connectionStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getDeviceWirelessElectronicShelfLabel(self, serial: str):
"""
**Return the ESL settings of a device**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-electronic-shelf-label
- serial (string): Serial
"""
metadata = {
'tags': ['wireless', 'configure', 'electronicShelfLabel'],
'operation': 'getDeviceWirelessElectronicShelfLabel'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/electronicShelfLabel'
return self._session.get(metadata, resource)
def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs):
"""
**Update the ESL settings of a device**
https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label
- serial (string): Serial
- channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel
- enabled (boolean): Turn ESL features on and off for this device
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'electronicShelfLabel'],
'operation': 'updateDeviceWirelessElectronicShelfLabel'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/electronicShelfLabel'
body_params = ['channel', 'enabled', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getDeviceWirelessLatencyStats(self, serial: str, **kwargs):
"""
**Aggregated latency info for a given AP on this network**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-latency-stats
- serial (string): Serial
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
- fields (string): Partial selection: If present, this call will return only the selected fields of ["rawDistribution", "avg"]. All fields will be returned by default. Selected fields must be entered as a comma separated string.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'latencyStats'],
'operation': 'getDeviceWirelessLatencyStats'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/latencyStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', 'fields', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getDeviceWirelessRadioSettings(self, serial: str):
"""
**Return the manually configured radio settings overrides of a device, which take precedence over RF profiles.**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-radio-settings
- serial (string): Serial
"""
metadata = {
'tags': ['wireless', 'configure', 'radio', 'settings'],
'operation': 'getDeviceWirelessRadioSettings'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/radio/settings'
return self._session.get(metadata, resource)
def updateDeviceWirelessRadioSettings(self, serial: str, **kwargs):
"""
**Update the radio settings overrides of a device, which take precedence over RF profiles.**
https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-radio-settings
- serial (string): Serial
- rfProfileId (string): The ID of an RF profile to assign to the device. If the value of this parameter is null, the appropriate basic RF profile (indoor or outdoor) will be assigned to the device. Assigning an RF profile will clear ALL manually configured overrides on the device (channel width, channel, power).
- twoFourGhzSettings (object): Manual radio settings for 2.4 GHz.
- fiveGhzSettings (object): Manual radio settings for 5 GHz.
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'radio', 'settings'],
'operation': 'updateDeviceWirelessRadioSettings'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/radio/settings'
body_params = ['rfProfileId', 'twoFourGhzSettings', 'fiveGhzSettings', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getDeviceWirelessStatus(self, serial: str):
"""
**Return the SSID statuses of an access point**
https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-status
- serial (string): Serial
"""
metadata = {
'tags': ['wireless', 'monitor', 'status'],
'operation': 'getDeviceWirelessStatus'
}
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/wireless/status'
return self._session.get(metadata, resource)
def getNetworkWirelessAirMarshal(self, networkId: str, **kwargs):
"""
**List Air Marshal scan results from a network**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-air-marshal
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameter t0. The value must be in seconds and be less than or equal to 31 days. The default is 7 days.
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'monitor', 'airMarshal'],
'operation': 'getNetworkWirelessAirMarshal'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/airMarshal'
query_params = ['t0', 'timespan', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def createNetworkWirelessAirMarshalRule(self, networkId: str, type: str, match: dict):
"""
**Creates a new rule**
https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-air-marshal-rule
- networkId (string): Network ID
- type (string): Indicates if this rule will allow, block, or alert.
- match (object): Object describing the rule specification.
"""
kwargs = locals()
if 'type' in kwargs:
options = ['alert', 'allow', 'block']
assert kwargs['type'] in options, f'''"type" cannot be "{kwargs['type']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'configure', 'airMarshal', 'rules'],
'operation': 'createNetworkWirelessAirMarshalRule'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/airMarshal/rules'
body_params = ['type', 'match', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.post(metadata, resource, payload)
def updateNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str, **kwargs):
"""
**Update a rule**
https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-rule
- networkId (string): Network ID
- ruleId (string): Rule ID
- type (string): Indicates if this rule will allow, block, or alert.
- match (object): Object describing the rule specification.
"""
kwargs.update(locals())
if 'type' in kwargs:
options = ['alert', 'allow', 'block']
assert kwargs['type'] in options, f'''"type" cannot be "{kwargs['type']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'configure', 'airMarshal', 'rules'],
'operation': 'updateNetworkWirelessAirMarshalRule'
}
networkId = urllib.parse.quote(str(networkId), safe='')
ruleId = urllib.parse.quote(str(ruleId), safe='')
resource = f'/networks/{networkId}/wireless/airMarshal/rules/{ruleId}'
body_params = ['type', 'match', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def deleteNetworkWirelessAirMarshalRule(self, networkId: str, ruleId: str):
"""
**Delete an Air Marshal rule.**
https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-air-marshal-rule
- networkId (string): Network ID
- ruleId (string): Rule ID
"""
metadata = {
'tags': ['wireless', 'configure', 'airMarshal', 'rules'],
'operation': 'deleteNetworkWirelessAirMarshalRule'
}
networkId = urllib.parse.quote(str(networkId), safe='')
ruleId = urllib.parse.quote(str(ruleId), safe='')
resource = f'/networks/{networkId}/wireless/airMarshal/rules/{ruleId}'
return self._session.delete(metadata, resource)
def updateNetworkWirelessAirMarshalSettings(self, networkId: str, defaultPolicy: str):
"""
**Updates Air Marshal settings.**
https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-air-marshal-settings
- networkId (string): Network ID
- defaultPolicy (string): Allows clients to access rogue networks. Blocked by default.
"""
kwargs = locals()
if 'defaultPolicy' in kwargs:
options = ['allow', 'block']
assert kwargs['defaultPolicy'] in options, f'''"defaultPolicy" cannot be "{kwargs['defaultPolicy']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'configure', 'airMarshal', 'settings'],
'operation': 'updateNetworkWirelessAirMarshalSettings'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/airMarshal/settings'
body_params = ['defaultPolicy', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getNetworkWirelessAlternateManagementInterface(self, networkId: str):
"""
**Return alternate management interface and devices with IP assigned**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-alternate-management-interface
- networkId (string): Network ID
"""
metadata = {
'tags': ['wireless', 'configure', 'alternateManagementInterface'],
'operation': 'getNetworkWirelessAlternateManagementInterface'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/alternateManagementInterface'
return self._session.get(metadata, resource)
def updateNetworkWirelessAlternateManagementInterface(self, networkId: str, **kwargs):
"""
**Update alternate management interface and device static IP**
https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-alternate-management-interface
- networkId (string): Network ID
- enabled (boolean): Boolean value to enable or disable alternate management interface
- vlanId (integer): Alternate management interface VLAN, must be between 1 and 4094
- protocols (array): Can be one or more of the following values: 'radius', 'snmp', 'syslog' or 'ldap'
- accessPoints (array): Array of access point serial number and IP assignment. Note: accessPoints IP assignment is not applicable for template networks, in other words, do not put 'accessPoints' in the body when updating template networks. Also, an empty 'accessPoints' array will remove all previous static IP assignments
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'alternateManagementInterface'],
'operation': 'updateNetworkWirelessAlternateManagementInterface'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/alternateManagementInterface'
body_params = ['enabled', 'vlanId', 'protocols', 'accessPoints', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getNetworkWirelessBilling(self, networkId: str):
"""
**Return the billing settings of this network**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-billing
- networkId (string): Network ID
"""
metadata = {
'tags': ['wireless', 'configure', 'billing'],
'operation': 'getNetworkWirelessBilling'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/billing'
return self._session.get(metadata, resource)
def updateNetworkWirelessBilling(self, networkId: str, **kwargs):
"""
**Update the billing settings**
https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-billing
- networkId (string): Network ID
- currency (string): The currency code of this node group's billing plans
- plans (array): Array of billing plans in the node group. (Can configure a maximum of 5)
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'configure', 'billing'],
'operation': 'updateNetworkWirelessBilling'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/billing'
body_params = ['currency', 'plans', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getNetworkWirelessBluetoothSettings(self, networkId: str):
"""
**Return the Bluetooth settings for a network. <a href="https://documentation.meraki.com/MR/Bluetooth/Bluetooth_Low_Energy_(BLE)">Bluetooth settings</a> must be enabled on the network.**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-bluetooth-settings
- networkId (string): Network ID
"""
metadata = {
'tags': ['wireless', 'configure', 'bluetooth', 'settings'],
'operation': 'getNetworkWirelessBluetoothSettings'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/bluetooth/settings'
return self._session.get(metadata, resource)
def updateNetworkWirelessBluetoothSettings(self, networkId: str, **kwargs):
"""
**Update the Bluetooth settings for a network**
https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-bluetooth-settings
- networkId (string): Network ID
- scanningEnabled (boolean): Whether APs will scan for Bluetooth enabled clients.
- advertisingEnabled (boolean): Whether APs will advertise beacons.
- uuid (string): The UUID to be used in the beacon identifier.
- majorMinorAssignmentMode (string): The way major and minor number should be assigned to nodes in the network. ('Unique', 'Non-unique')
- major (integer): The major number to be used in the beacon identifier. Only valid in 'Non-unique' mode.
- minor (integer): The minor number to be used in the beacon identifier. Only valid in 'Non-unique' mode.
"""
kwargs.update(locals())
if 'majorMinorAssignmentMode' in kwargs:
options = ['Non-unique', 'Unique']
assert kwargs['majorMinorAssignmentMode'] in options, f'''"majorMinorAssignmentMode" cannot be "{kwargs['majorMinorAssignmentMode']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'configure', 'bluetooth', 'settings'],
'operation': 'updateNetworkWirelessBluetoothSettings'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/bluetooth/settings'
body_params = ['scanningEnabled', 'advertisingEnabled', 'uuid', 'majorMinorAssignmentMode', 'major', 'minor', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}
return self._session.put(metadata, resource, payload)
def getNetworkWirelessChannelUtilizationHistory(self, networkId: str, **kwargs):
"""
**Return AP channel utilization over time for a device or network client**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-channel-utilization-history
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days.
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 600, 1200, 3600, 14400, 86400. The default is 86400.
- autoResolution (boolean): Automatically select a data resolution based on the given timespan; this overrides the value specified by the 'resolution' parameter. The default setting is false.
- clientId (string): Filter results by network client to return per-device, per-band AP channel utilization metrics inner joined by the queried client's connection history.
- deviceSerial (string): Filter results by device to return AP channel utilization metrics for the queried device; either :band or :clientId must be jointly specified.
- apTag (string): Filter results by AP tag to return AP channel utilization metrics for devices labeled with the given tag; either :clientId or :deviceSerial must be jointly specified.
- band (string): Filter results by band (either '2.4', '5' or '6').
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'channelUtilizationHistory'],
'operation': 'getNetworkWirelessChannelUtilizationHistory'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/channelUtilizationHistory'
query_params = ['t0', 't1', 'timespan', 'resolution', 'autoResolution', 'clientId', 'deviceSerial', 'apTag', 'band', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientCountHistory(self, networkId: str, **kwargs):
"""
**Return wireless client counts over time for a network, device, or network client**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-count-history
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days.
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300, 600, 1200, 3600, 14400, 86400. The default is 86400.
- autoResolution (boolean): Automatically select a data resolution based on the given timespan; this overrides the value specified by the 'resolution' parameter. The default setting is false.
- clientId (string): Filter results by network client to return per-device client counts over time inner joined by the queried client's connection history.
- deviceSerial (string): Filter results by device.
- apTag (string): Filter results by AP tag.
- band (string): Filter results by band (either '2.4', '5' or '6').
- ssid (integer): Filter results by SSID number.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clientCountHistory'],
'operation': 'getNetworkWirelessClientCountHistory'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/clientCountHistory'
query_params = ['t0', 't1', 'timespan', 'resolution', 'autoResolution', 'clientId', 'deviceSerial', 'apTag', 'band', 'ssid', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientsConnectionStats(self, networkId: str, **kwargs):
"""
**Aggregated connectivity info for this network, grouped by clients**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-connection-stats
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'connectionStats'],
'operation': 'getNetworkWirelessClientsConnectionStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/clients/connectionStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientsLatencyStats(self, networkId: str, **kwargs):
"""
**Aggregated latency info for this network, grouped by clients**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-clients-latency-stats
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
- fields (string): Partial selection: If present, this call will return only the selected fields of ["rawDistribution", "avg"]. All fields will be returned by default. Selected fields must be entered as a comma separated string.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'latencyStats'],
'operation': 'getNetworkWirelessClientsLatencyStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/clients/latencyStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', 'fields', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientConnectionStats(self, networkId: str, clientId: str, **kwargs):
"""
**Aggregated connectivity info for a given client on this network**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-connection-stats
- networkId (string): Network ID
- clientId (string): Client ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'connectionStats'],
'operation': 'getNetworkWirelessClientConnectionStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
clientId = urllib.parse.quote(str(clientId), safe='')
resource = f'/networks/{networkId}/wireless/clients/{clientId}/connectionStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: str, total_pages=1, direction='next', **kwargs):
"""
**List the wireless connectivity events for a client within a network in the timespan.**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-connectivity-events
- networkId (string): Network ID
- clientId (string): Client ID
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
- direction (string): direction to paginate, either "next" (default) or "prev" page
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000.
- startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
- endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
- sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'.
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 1 day.
- types (array): A list of event types to include. If not specified, events of all types will be returned. Valid types are 'assoc', 'disassoc', 'auth', 'deauth', 'dns', 'dhcp', 'roam', 'connection' and/or 'sticky'.
- band (string): Filter results by band. Valid bands are '2.4', '5' or '6'.
- ssidNumber (integer): Filter results by SSID. If not specified, events for all SSIDs will be returned.
- includedSeverities (array): A list of severities to include. If not specified, events of all severities will be returned. Valid severities are 'good', 'info', 'warn' and/or 'bad'.
- deviceSerial (string): Filter results by an AP's serial number.
"""
kwargs.update(locals())
if 'sortOrder' in kwargs:
options = ['ascending', 'descending']
assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}'''
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
if 'ssidNumber' in kwargs:
options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
assert kwargs['ssidNumber'] in options, f'''"ssidNumber" cannot be "{kwargs['ssidNumber']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'connectivityEvents'],
'operation': 'getNetworkWirelessClientConnectivityEvents'
}
networkId = urllib.parse.quote(str(networkId), safe='')
clientId = urllib.parse.quote(str(clientId), safe='')
resource = f'/networks/{networkId}/wireless/clients/{clientId}/connectivityEvents'
query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 't0', 't1', 'timespan', 'types', 'band', 'ssidNumber', 'includedSeverities', 'deviceSerial', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
array_params = ['types', 'includedSeverities', ]
for k, v in kwargs.items():
if k.strip() in array_params:
params[f'{k.strip()}[]'] = kwargs[f'{k}']
params.pop(k.strip())
return self._session.get_pages(metadata, resource, params, total_pages, direction)
def getNetworkWirelessClientLatencyHistory(self, networkId: str, clientId: str, **kwargs):
"""
**Return the latency history for a client**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-latency-history
- networkId (string): Network ID
- clientId (string): Client ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 791 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 791 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 791 days. The default is 1 day.
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 86400. The default is 86400.
"""
kwargs.update(locals())
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'latencyHistory'],
'operation': 'getNetworkWirelessClientLatencyHistory'
}
networkId = urllib.parse.quote(str(networkId), safe='')
clientId = urllib.parse.quote(str(clientId), safe='')
resource = f'/networks/{networkId}/wireless/clients/{clientId}/latencyHistory'
query_params = ['t0', 't1', 'timespan', 'resolution', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessClientLatencyStats(self, networkId: str, clientId: str, **kwargs):
"""
**Aggregated latency info for a given client on this network**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-client-latency-stats
- networkId (string): Network ID
- clientId (string): Client ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
- fields (string): Partial selection: If present, this call will return only the selected fields of ["rawDistribution", "avg"]. All fields will be returned by default. Selected fields must be entered as a comma separated string.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'clients', 'latencyStats'],
'operation': 'getNetworkWirelessClientLatencyStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
clientId = urllib.parse.quote(str(clientId), safe='')
resource = f'/networks/{networkId}/wireless/clients/{clientId}/latencyStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', 'fields', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessConnectionStats(self, networkId: str, **kwargs):
"""
**Aggregated connectivity info for this network**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-connection-stats
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'connectionStats'],
'operation': 'getNetworkWirelessConnectionStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/connectionStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessDataRateHistory(self, networkId: str, **kwargs):
"""
**Return PHY data rates over time for a network, device, or network client**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-data-rate-history
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 31 days. The default is 7 days.
- resolution (integer): The time resolution in seconds for returned data. The valid resolutions are: 300, 600, 1200, 3600, 14400, 86400. The default is 86400.
- autoResolution (boolean): Automatically select a data resolution based on the given timespan; this overrides the value specified by the 'resolution' parameter. The default setting is false.
- clientId (string): Filter results by network client.
- deviceSerial (string): Filter results by device.
- apTag (string): Filter results by AP tag.
- band (string): Filter results by band (either '2.4', '5' or '6').
- ssid (integer): Filter results by SSID number.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'dataRateHistory'],
'operation': 'getNetworkWirelessDataRateHistory'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/dataRateHistory'
query_params = ['t0', 't1', 'timespan', 'resolution', 'autoResolution', 'clientId', 'deviceSerial', 'apTag', 'band', 'ssid', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessDevicesConnectionStats(self, networkId: str, **kwargs):
"""
**Aggregated connectivity info for this network, grouped by node**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-devices-connection-stats
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'devices', 'connectionStats'],
'operation': 'getNetworkWirelessDevicesConnectionStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/devices/connectionStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs):
"""
**Aggregated latency info for this network, grouped by node**
https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-devices-latency-stats
- networkId (string): Network ID
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 180 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 7 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days.
- band (string): Filter results by band (either '2.4', '5' or '6'). Note that data prior to February 2020 will not have band information.
- ssid (integer): Filter results by SSID
- vlan (integer): Filter results by VLAN
- apTag (string): Filter results by AP Tag
- fields (string): Partial selection: If present, this call will return only the selected fields of ["rawDistribution", "avg"]. All fields will be returned by default. Selected fields must be entered as a comma separated string.
"""
kwargs.update(locals())
if 'band' in kwargs:
options = ['2.4', '5', '6']
assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}'''
metadata = {
'tags': ['wireless', 'monitor', 'devices', 'latencyStats'],
'operation': 'getNetworkWirelessDevicesLatencyStats'
}
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/wireless/devices/latencyStats'
query_params = ['t0', 't1', 'timespan', 'band', 'ssid', 'vlan', 'apTag', 'fields', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}
return self._session.get(metadata, resource, params)
def getNetworkWirelessElectronicShelfLabel(self, networkId: str):