-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutil.py
More file actions
1448 lines (1346 loc) · 75.3 KB
/
util.py
File metadata and controls
1448 lines (1346 loc) · 75.3 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
"""
Copyright 2023, 2024, 2025, 2026 Jack Consoli, LLC. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may also obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
The license is free for single customer use (internal applications). Use of this module in the production,
redistribution, or service delivery for commerce requires an additional license. Contact [email protected] for
details.
**Description**
Used for:
* Defining common HTTP status & messages
* CLI to API conversion for MAPS rules
* Action tables, see discussion below
In FOS 8.2.1c, module-version was introduced but as of v9.2.0, still contained scant information about each module. The
table uri_map is a hard coded table to serve applications and other libraries that need to know how to build a full URI
and define the behavior of each exposed in the API. The hope is that some day, this information will be available
through the API allowing uri_map to be built dynamically.
**WARNING**
Only GET is valid in the 'methods' leaf of uri_map
**Important Notes**
Prior to 9.2, the Rest API documentation always "double clutched" the module name and main branch. For example, for
brocade-zone, both the module name and main branch is "brocade-zone". The leaves follow.:
Module Tree
module: brocade-zone
+--rw brocade-zone
+--rw defined-configuration {fibrechannel:fibrechannel_switch_platform}?
In FOS 10.0 and above, the module and main branch have different names. I'm assuming it's the branch name, not the
module name that is used in the URI. This is also how it's documented in the Yang models.
Example of FOS 10.0 new branch:
Module Tree
module: brocade-traffic-class
+--ro trafficClass <-- Not the same as the module name, brocade-traffic-class
+--ro configuration* [trafficClassName] {fibrechannel:ip_storage_logical_switch}?
**Public Methods & Data**
+-----------------------+---------------------------------------------------------------------------------------+
| Method | Description |
+=======================+=======================================================================================+
| HTTP_xxx | Several comon status codes and reasons for synthesizing API responses. Typically this |
| | used for logic that determines an issue whereby the request can't be sent to the |
| | switch API based on problems found with the input to the method. |
+-----------------------+---------------------------------------------------------------------------------------+
| add_uri_map | Builds out the URI map and adds it to the session. Intended to be called once |
| | immediately after login |
+-----------------------+---------------------------------------------------------------------------------------+
| format_uri | Formats a full URI |
+-----------------------+---------------------------------------------------------------------------------------+
| fos_to_dict | Converts a FOS version into a dictionary to be used for comparing for version numbers |
+-----------------------+---------------------------------------------------------------------------------------+
| mask_ip_addr | Replaces IP address with xxx.xxx.xxx.123 or all x depending on keep_last |
+-----------------------+---------------------------------------------------------------------------------------+
| session_cntl | Returns the control dictionary (uri map) for the uri |
+-----------------------+---------------------------------------------------------------------------------------+
| split_uri | Strips out leading '/rest/'. Optionally remove 'running' and 'operations' |
+-----------------------+---------------------------------------------------------------------------------------+
| uri_d | Returns the dictionary in the URI map for a specified URI |
+-----------------------+---------------------------------------------------------------------------------------+
| validate_fid | Validates a FID or list of FIDs |
+-----------------------+---------------------------------------------------------------------------------------+
| vfid_to_str | Converts a FID to a string, '?vf-id=xx' to be appended to a URI that requires a FID |
+-----------------------+---------------------------------------------------------------------------------------+
**Version Control**
+-----------+---------------+---------------------------------------------------------------------------------------+
| Version | Last Edit | Description |
+===========+===============+=======================================================================================+
| 4.0.0 | 04 Aug 2023 | Re-Launch |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.1 | 06 Mar 2024 | Added brocade-maps and brocade-fibrechannel-routing to common URIs. Added |
| | | validate_fid() |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.2 | 26 Jun 2024 | Moved fos_to_dict() from brcddb.util.util to here. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.3 | 20 Oct 2024 | Added several URIs. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.4 | 06 Dec 2024 | Use stats_uri instead of explicit values for fibrechannel-statistics. Added |
| | | bc_support_sn |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.5 | 26 Dec 2024 | Updated comments only. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.6 | 12 Apr 2025 | FOS 9.2 updates. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.7 | 25 Aug 2025 | Moved sec policies from chassis to fabric. Updated default methods with 9.1.1b. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.8 | 19 Oct 2025 | Updated comments only. |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.0.9 | 20 Feb 2026 | Added ficon_sw_rnid, bz_def, bz_eff, fdmi_port, fdmi_hba, and bifc_stats |
+-----------+---------------+---------------------------------------------------------------------------------------+
| 4.1.0 | 10 Mar 2026 | Added brocade-ip-storage-*, brocade-isns-*, brocade-object-server, and |
| | | brocade-traffic-class. New in 9.2 or 10.0. |
+-----------+---------------+---------------------------------------------------------------------------------------+
"""
__author__ = 'Jack Consoli'
__copyright__ = 'Copyright 2024, 2025, 2026 Jack Consoli'
__date__ = '10 Mar 2026'
__license__ = 'Apache License, Version 2.0'
__email__ = '[email protected]'
__maintainer__ = 'Jack Consoli'
__status__ = 'Released'
__version__ = '4.1.0'
import sys
import types
import importlib
import pprint
import copy
import brcdapi.log as brcdapi_log
import brcdapi.gen_util as gen_util
class Found(Exception):
pass
# Common HTTP error codes and reason messages
HTTP_OK = 200
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_FORBIDDEN = 403
HTTP_NOT_FOUND = 404
HTTP_REQUEST_TIMEOUT = 408
HTTP_REQUEST_CONFLICT = 409
HTTP_PRECONDITION_REQUIRED = 428
HTTP_INT_SERVER_ERROR = 500
HTTP_INT_SERVER_UNAVAIL = 503
HTTP_REASON_MISSING_OPERAND = 'Missing operand'
HTTP_REASON_MAL_FORMED_CMD = 'Malformed command'
HTTP_REASON_MAL_FORMED_OBJ = 'Malformed object'
HTTP_REASON_NOT_FOUND = 'Referenced resource not found'
HTTP_REASON_MISSING_PARAM = 'Missing parameter'
HTTP_REASON_UNEXPECTED_RESP = 'Unexpected response'
HTTP_REASON_PENDING_UPDATES = 'Unsaved changes'
HTTP_REASON_USER_ABORT = 'User terminated session, ctl-C'
GOOD_STATUS_OBJ = dict(_raw_data=dict(status=HTTP_OK, reason='OK'))
encoding_type = 'utf-8' # Unless running these scripts on a mainframe, this will always be utf-8.
# Commonly used URIs: brocade-name-server
bns_uri = 'brocade-name-server/fibrechannel-name-server'
bns_fc4_features = bns_uri + '/fc4-features'
bns_node_symbol = bns_uri + '/node-symbolic-name'
bns_port_symbol = bns_uri + '/port-symbolic-name'
bns_share_area = bns_uri + '/share-area'
bns_redirection = bns_uri + '/frame-redirection'
bns_partial = bns_uri + '/partial'
bns_lsan = bns_uri + '/lsan'
bns_cascade_ag = bns_uri + '/cascaded-ag'
bns_connect_ag = bns_uri + '/connected-through-ag'
bns_dev_behind_ag = bns_uri + '/real-device-behind-ag'
bns_fcoe_dev = bns_uri + '/fcoe-device'
bns_sddq = bns_uri + '/slow-drain-device-quarantine'
bns_port_id = bns_uri + '/port-id'
bns_port_name = bns_uri + '/port-name'
bns_link_speed = bns_uri + '/link-speed'
bns_ns_dev_type = bns_uri + '/name-server-device-type'
bns_node_name = bns_uri + '/node-name'
bns_scr = bns_uri + '/state-change-registration'
bns_fab_port_name = bns_uri + '/fabric-port-name'
bns_perm_port_name = bns_uri + '/permanent-port-name'
bns_port_index = bns_uri + '/port-index'
# Commonly used URIs: brocade-fibrechannel-switch
bfs_uri = 'brocade-fibrechannel-switch/fibrechannel-switch'
bfs_name = bfs_uri + '/name'
bfs_did = bfs_uri + '/domain-id'
bfs_fcid_hex = bfs_uri + '/fcid-hex'
bfs_principal = bfs_uri + '/principal'
bfs_isprincipal = bfs_uri + '/is-principal'
bfs_op_status = bfs_uri + '/operational-status'
bfs_op_status_str = bfs_uri + '/operational-status-string'
bfs_fab_user_name = bfs_uri + '/fabric-user-friendly-name'
bfs_sw_user_name = bfs_uri + '/user-friendly-name'
bfs_banner = bfs_uri + '/banner'
bfs_fw_version = bfs_uri + '/firmware-version'
bfs_adv_tuning = bfs_uri + '/advanced-performance-tuning-policy'
bfs_dls = bfs_uri + '/dynamic-load-sharing'
bfs_domain_name = bfs_uri + '/domain-name'
bfs_model = bfs_uri + '/model'
bfs_vf_id = bfs_uri + '/vf-id'
bfs_ag_mode = bfs_uri + '/ag-mode' # Deprecated
bfs_ag_mode_str = bfs_uri + '/ag-mode-string'
bfs_enabled_state = bfs_uri + '/is-enabled-state'
bfc_up_time = bfs_uri + '/up-time'
# Commonly used URIs: brocade-fibrechannel-configuration
bfc_uri = 'brocade-fibrechannel-configuration/fabric'
bfc_idid = bfc_uri + '/insistent-domain-id-enabled'
bfc_principal_en = bfc_uri + '/principal-selection-enabled'
bfc_principal_pri = bfc_uri + '/principal-priority'
bfc_port_uri = 'brocade-fibrechannel-configuration/port-configuration'
bfc_portname_mode = bfc_port_uri + '/portname-mode'
bfc_portname_format = bfc_port_uri + '/dynamic-portname-format'
# Commonly used URIs: brocade-fibrechannel-configuration/f-port-login-settings
bfcfp_uri = 'brocade-fibrechannel-configuration/f-port-login-settings'
bfc_max_logins = bfcfp_uri + '/max-logins'
bfc_max_flogi_rate = bfcfp_uri + '/max-flogi-rate-per-switch'
bfc_stage_interval = bfcfp_uri + '/stage-interval'
bfc_free_fdisc = bfcfp_uri + '/free-fdisc'
bfc_max_flogi_rate_port = bfcfp_uri + '/max-flogi-rate-per-port'
bfc_fport_enforce_login = bfcfp_uri + '/enforce-login' # Deprecated
bfc_fport_enforce_login_str = bfcfp_uri + '/enforce-login-string'
# Commonly used URIs: brocade-fibrechannel-configuration/switch-configuration
bfc_sw_uri = 'brocade-fibrechannel-configuration/switch-configuration'
bfc_xisl_en = bfc_sw_uri + '/xisl-enabled'
bfc_area_mode = bfc_sw_uri + '/area-mode'
bfc_port_id_mode = bfc_sw_uri + '/wwn-port-id-mode'
bfs_edge_hold = bfc_sw_uri + '/edge-hold-time'
# Commonly used URIs: brocade-fru
fru_uri = 'brocade-fru'
fru_blade = fru_uri + '/blade'
fru_fan = fru_uri + '/fan'
fru_ps = fru_uri + '/power-supply'
fru_sensor = fru_uri + '/sensor'
fru_wwn = fru_uri + '/wwn'
fru_blade_pn = fru_uri + '/blade/part-number'
# Commonly used URIs: brocade-chassis/chassis
bcc_uri = 'brocade-chassis/chassis'
bc_mfg = bcc_uri + '/manufacturer'
bc_product_name = bcc_uri + '/product-name' # product-name
bc_serial_num = bcc_uri + '/serial-number'
bc_support_sn = bcc_uri + '/entitlement-serial-number' # S/N for entitlement
bc_vf = bcc_uri + '/vf-supported'
bc_time_alive = bcc_uri + '/time-alive'
bc_time_awake = bcc_uri + '/time-awake'
bc_fcr_en = bcc_uri + '/fcr-enabled'
bc_fcr_supported = bcc_uri + '/fcr-supported'
bc_user_name = bcc_uri + '/chassis-user-friendly-name'
bc_wwn = bcc_uri + '/chassis-wwn'
bc_license_id = bcc_uri + '/license-id'
bc_org_name = bcc_uri + '/registered-organization-name'
bc_org_reg_date = bcc_uri + '/organization-registration-date'
bc_pn = bcc_uri + '/part-number'
bc_vendor_pn = bcc_uri + '/vendor-part-number'
bc_max_blades = bcc_uri + '/max-blades-supported'
bc_vendor_sn = bcc_uri + '/vendor-serial-number'
bc_vendor_rev_num = bcc_uri + '/vendor-revision-number'
bc_date = bcc_uri + '/date'
bc_enabled = bcc_uri + '/chassis-enabled'
bc_motd = bcc_uri + '/message-of-the-day'
bc_shell_to = bcc_uri + '/shell-timeout'
bc_session_to = bcc_uri + '/session-timeout'
bc_usb_enbled = bcc_uri + '/usb-device-enabled'
bc_usb_avail_space = bcc_uri + '/usb-available-space'
bc_tcp_to_level = bcc_uri + '/tcp-timeout-level'
bc_bp_rev = bcc_uri + '/backplane-revision'
bp_vf_enabled = bcc_uri + '/vf-enabled'
# Commonly used URIs: brocade-chassis/ha-status
bcha_uri = 'brocade-chassis/ha-status'
bc_ha = bcha_uri + '/ha-enabled'
bc_heartbeat = bcha_uri + '/heartbeat-up'
bc_active_cp = bcha_uri + '/active-cp'
bc_active_slot = bcha_uri + '/active-slot'
bc_ha_recovery = bcha_uri + '/recovery-type'
bc_ha_standby_cp = bcha_uri + '/standby-cp'
bc_ha_standby_health = bcha_uri + '/standby-health'
bc_ha_standby_slot = bcha_uri + '/standby-slot'
bc_ha_enabled = bcha_uri + '/ha-enabled'
bc_ha_sync = bcha_uri + '/ha-synchronized'
bc_sync = bc_ha_sync # This used to be 'brocade-chassis/chassis/ha-synchronized' which was deprecated early in 8.2.x
# Commonly used URIs: brocade-chassis/management-interface-configuration
bcmic_uri = 'brocade-chassis/management-interface-configuration'
bc_rest_enabled = bcmic_uri + '/rest-enabled'
bc_https_enabled = bcmic_uri + '/https-protocol-enabled'
bc_eff_protocol = bcmic_uri + '/effective-protocol'
bc_max_rest = bcmic_uri + '/max-rest-sessions'
bc_https_ka = bcmic_uri + '/https-keep-alive-enabled'
bc_https_ka_to = bcmic_uri + '/https-keep-alive-timeout'
bc_https_sys_uptime = bcmic_uri + '/system-uptime'
bc_https_sessions = bcmic_uri + '/user-sessions'
bc_https_load_1 = bcmic_uri + '/one-minute-load-average'
bc_https_load_5 = bcmic_uri + '/five-minutes-load-average'
bc_https_load_15 = bcmic_uri + '/fifteen-minutes-load-average'
bc_https_total_mem = bcmic_uri + '/total-memory'
bc_https_used_mem = bcmic_uri + '/used-memory'
bc_https_free_mem = bcmic_uri + '/free-memory'
bc_https_shared_mem = bcmic_uri + '/shared-memory'
bc_https_cache_mem = bcmic_uri + '/buffer-cache-memory'
# Commonly used URIs: brocade-chassis/version
bcv_uri = 'brocade-chassis/version'
bc_version_kernal = bcv_uri + '/kernel'
bc_version_fos = bcv_uri + '/fabric-os'
# Commonly used URIs: brocade-fabric/fabric-switch
bfsw_uri = 'brocade-fabric/fabric-switch' # I think this entire branch is deprecated
bf_sw_user_name = bfsw_uri + '/switch-user-friendly-name' # Deprecated? Use bfs_sw_user_name
bf_sw_wwn = bfsw_uri + '/name'
bf_fw_version = bfsw_uri + '/firmware-version' # Deprecated?
# Commonly used URIs: brocade-fibrechannel-logical-switch
bfls_uri = 'brocade-fibrechannel-logical-switch/fibrechannel-logical-switch'
bfls_sw_wwn = bfls_uri + '/switch-wwn'
bfls_fid = bfls_uri + '/fabric-id'
bfls_base_sw_en = bfls_uri + '/base-switch-enabled'
bfls_def_sw_status = bfls_uri + '/default-switch-status'
bfls_ficon_mode_en = bfls_uri + '/ficon-mode-enabled'
bfls_isl_enabled = bfls_uri + '/logical-isl-enabled'
bfls_mem_list = bfls_uri + '/port-member-list'
bfls_ge_mem_list = bfls_uri + '/ge-port-member-list'
# Commonly used URIs: brocade-maps
maps_uri = 'brocade-maps'
maps_db_hist = maps_uri + '/dashboard-history'
maps_db_misc = maps_uri + '/dashboard-misc'
maps_db_rule = maps_uri + '/dashboard-rule'
maps_group = maps_uri + '/group'
maps_config = maps_uri + '/maps-config'
maps_policy = maps_uri + '/maps-policy'
maps_rule = maps_uri + '/rule'
# Commonly used URIs: brocade-ficon
ficon_cup_uri = 'brocade-ficon/cup'
ficon_cup_en = ficon_cup_uri + '/fmsmode-enabled'
ficon_posc = ficon_cup_uri + '/programmed-offline-state-control'
ficon_uam = ficon_cup_uri + '/user-alert-mode'
ficon_asm = ficon_cup_uri + '/active-equal-saved-mode'
ficon_dcam = ficon_cup_uri + '/director-clock-alert-mode'
ficon_mihpto = ficon_cup_uri + '/mihpto'
ficon_uam_fru = ficon_cup_uri + '/unsolicited-alert-mode-fru-enabled'
ficon_uam_hsc = ficon_cup_uri + '/unsolicited-alert-mode-hsc-enabled'
ficon_uam_invalid_attach = ficon_cup_uri + '/unsolicited-alert-mode-invalid-attach-enabled'
ficon_sw_rnid = 'brocade-ficon/switch-rnid'
ficon_sw_wwn = ficon_sw_rnid + '/switch-wwn'
ficon_sw_rnid_flags = ficon_sw_rnid + '/flags'
ficon_sw_node_params = ficon_sw_rnid + '/node-parameters'
ficon_sw_rnid_type = ficon_sw_rnid + '/type-number'
ficon_sw_rnid_model = ficon_sw_rnid + '/model-number'
ficon_sw_rnid_mfg = ficon_sw_rnid + '/manufacturer'
ficon_sw_rnid_pant = ficon_sw_rnid + '/plant'
ficon_sw_rnid_seq = ficon_sw_rnid + '/sequence-number'
ficon_sw_rnid_tag = ficon_sw_rnid + '/tag'
# Commonly used URIs: media-rdp
sfp_speed = 'media-rdp/media-speed-capability/speed'
sfp_wave = 'media-rdp/wavelength'
sfp_vendor = 'media-rdp/vendor-name'
sfp_sn = 'media-rdp/serial-number'
sfp_oui = 'media-rdp/vendor-oui'
sfp_pn = 'media-rdp/part-number'
sfp_volt = 'media-rdp/voltage'
sfp_current = 'media-rdp/current'
sfp_temp = 'media-rdp/temperature'
sfp_rx_pwr = 'media-rdp/rx-power'
sfp_tx_pwr = 'media-rdp/tx-power'
sfp_state = 'media-rdp/physical-state'
sfp_distance = 'media-rdp/media-distance/distance'
sfp_power_on = 'media-rdp/power-on-time'
sfp_remote_speed = 'media-rdp/remote-media-speed-capability/speed'
sfp_cur_high_alarm = 'media-rdp/remote-media-tx-bias-alert/high-alarm'
sfp_cur_high_warn = 'media-rdp/remote-media-tx-bias-alert/high-warning'
sfp_cur_low_alarm = 'media-rdp/remote-media-tx-bias-alert/low-alarm'
sfp_cur_low_warn = 'media-rdp/remote-media-tx-bias-alert/low-warning'
sfp_volt_high_alarm = 'media-rdp/remote-media-voltage-alert/high-alarm'
sfp_volt_high_warn = 'media-rdp/remote-media-voltage-alert/high-warning'
sfp_volt_low_alarm = 'media-rdp/remote-media-voltage-alert/low-alarm'
sfp_volt_low_warn = 'media-rdp/remote-media-voltage-alert/low-warning'
sfp_temp_high_alarm = 'media-rdp/remote-media-temperature-alert/high-alarm'
sfp_temp_high_warn = 'media-rdp/remote-media-temperature-alert/high-warning'
sfp_temp_low_alarm = 'media-rdp/remote-media-temperature-alert/low-alarm'
sfp_temp_low_warn = 'media-rdp/remote-media-temperature-alert/low-warning'
sfp_txp_high_alarm = 'media-rdp/remote-media-tx-power-alert/high-alarm'
sfp_txp_high_warn = 'media-rdp/remote-media-tx-power-alert/high-warning'
sfp_txp_low_alarm = 'media-rdp/remote-media-tx-power-alert/low-alarm'
sfp_txp_low_warn = 'media-rdp/remote-media-tx-power-alert/low-warning'
sfp_rxp_high_alarm = 'media-rdp/remote-media-rx-power-alert/high-alarm'
sfp_rxp_high_warn = 'media-rdp/remote-media-rx-power-alert/high-warning'
sfp_rxp_low_alarm = 'media-rdp/remote-media-rx-power-alert/low-alarm'
sfp_rxp_low_warn = 'media-rdp/remote-media-rx-power-alert/low-warning'
# Commonly used URIs: fibrechannel-statistics
stats_uri = 'fibrechannel-statistics'
stats_addr = stats_uri + '/address-errors'
stats_delimiter = stats_uri + '/delimiter-errors'
stats_out_frames = stats_uri + '/out-frames'
stats_in_frames = stats_uri + '/in-frames'
stats_enc_disp = stats_uri + '/encoding-disparity-errors'
stats_crc = stats_uri + '/crc-errors'
stats_in_crc = stats_uri + '/in-crc-errors'
stats_ios = stats_uri + '/invalid-ordered-sets'
stats_fec_un = stats_uri + '/fec-uncorrected'
stats_tunc = stats_uri + '/truncated-frames'
stats_long = stats_uri + '/frames-too-long'
stats_bad_eof = stats_uri + '/bad-eofs-received'
stats_enc = stats_uri + '/encoding-errors-outside-frame'
stats_c3 = stats_uri + '/class-3-discards'
stats_c3_out = stats_uri + '/class3-out-discards'
stats_c3_in = stats_uri + '/class3-in-discards'
stats_itw = stats_uri + '/invalid-transmission-words'
stats_link_fail = stats_uri + '/link-failures'
stats_in_reset = stats_uri + '/in-link-resets'
stats_loss_sync = stats_uri + '/loss-of-sync'
stats_loss_sig = stats_uri + '/loss-of-signal'
stats_off_seq = stats_uri + '/in-offline-sequences'
stats_out_off_seq = stats_uri + '/out-offline-sequences'
stats_out_reset = stats_uri + '/out-link-resets'
stats_p_rjt = stats_uri + '/p-rjt-frames'
stats_p_busy = stats_uri + '/p-busy-frames'
stats_bb_credit = stats_uri + '/bb-credit-zero'
stats_seq = stats_uri + '/primitive-sequence-protocol-error'
stats_rdy = stats_uri + '/too-many-rdys'
stats_multicast_to = stats_uri + '/multicast-timeouts'
stats_in_lcs = stats_uri + '/in-lcs'
stats_buf_full = stats_uri + '/input-buffer-full'
stats_f_busy = stats_uri + '/f-busy-frames'
stats_f_rjt = stats_uri + '/f-rjt-frames'
stats_lli = stats_uri + '/ink-level-interrupts'
stats_fpr = stats_uri + '/frames-processing-required'
stats_to = stats_uri + '/frames-timed-out'
stats_trans = stats_uri + '/frames-transmitter-unavailable-errors'
stats_nos_in = stats_uri + '/non-operational-sequences-in'
stats_nos_out = stats_uri + '/non-operational-sequences-out'
stats_time = stats_uri + '/time-generated'
# Commonly used URIs: brocade-interface
bifc_uri = 'brocade-interface/fibrechannel'
bifc_pod = bifc_uri + '/pod-license-state'
bifc_stats = 'brocade-interface/fibrechannel-statistics'
# Commonly used URIs: fibrechannel
fc_auto_neg = 'fibrechannel/auto-negotiate'
fc_name = 'fibrechannel/name' # The port number in s/p notation
fc_enabled = 'fibrechannel/is-enabled-state'
fc_op_status = 'fibrechannel/operational-status' # Deprecated
fc_op_status_str = 'fibrechannel/operational-status-string'
fc_state = 'fibrechannel/physical-state'
fc_port_type = 'fibrechannel/port-type' # Deprecated
fc_port_type_str = 'fibrechannel/port-type-string'
fc_fcid_hex = 'fibrechannel/fcid-hex'
fc_neighbor_node_wwn = 'fibrechannel/neighbor-node-wwn'
fc_neighbor = 'fibrechannel/neighbor'
fc_neighbor_wwn = 'fibrechannel/neighbor/wwn'
fc_index = 'fibrechannel/index'
fc_speed = 'fibrechannel/speed'
fc_max_speed = 'fibrechannel/max-speed'
fc_user_name = 'fibrechannel/user-friendly-name'
fc_los_tov = 'fibrechannel/los-tov-mode-enabled'
fc_eport_credit = 'fibrechannel/e-port-credit'
fc_fport_buffers = 'fibrechannel/f-port-buffers'
fc_fcid = 'fibrechannel/fcid'
fc_long_distance = 'fibrechannel/long-distance'
fc_npiv_pp_limit = 'fibrechannel/npiv-pp-limit'
fc_speed_combo = 'fibrechannel/octet-speed-combo'
fc_rate_limited_en = 'fibrechannel/rate-limit-enabled'
fc_wwn = 'fibrechannel/wwn'
fc_chip_buf_avail = 'fibrechannel/chip-buffers-available'
fc_chip_instance = 'fibrechannel/chip-instance'
fc_encrypt = 'fibrechannel/encryption-enabled'
fc_comp_act = 'fibrechannel/compression-active'
fc_comp_en = 'fibrechannel/compression-configured'
fc_credit_recov_act = 'fibrechannel/credit-recovery-active'
fc_credit_recov_en = 'fibrechannel/credit-recovery-enabled'
fc_d_port_en = 'fibrechannel/d-port-enable'
fc_e_port_dis = 'fibrechannel/e-port-disable'
fc_npiv_en = 'fibrechannel/npiv-enabled'
# Commonly used URIs: brocade-zone
bz_def = 'brocade-zone/defined-configuration'
bz_def_alias = bz_def + '/alias'
bz_def_cfg = bz_def + '/cfg'
bz_def_zone = bz_def + '/zone'
bz_eff = 'brocade-zone/effective-configuration'
bz_eff_cfg = bz_eff + '/cfg-name'
bz_eff_db_avail = bz_eff + '/db-avail'
bz_eff_checksum = bz_eff + '/checksum'
bz_eff_db_committed = bz_eff + '/db-committed'
bz_eff_cfg_action = bz_eff + '/cfg-action'
bz_eff_db_max = bz_eff + '/db-max'
bz_eff_default_zone = bz_eff + '/default-zone-access'
bz_eff_db_trans = bz_eff + '/db-transaction'
bz_eff_trans_token = bz_eff + '/transaction-token'
bz_eff_db_chassis_committed = bz_eff + '/db-chassis-wide-committed'
# Commonly used URIs: brocade-fdmi
fdmi_port = 'brocade-fdmi/port'
fdmi_hba = 'brocade-fdmi/hba'
fdmi_port_sym = 'brocade-fdmi/port-symbolic-name'
fdmi_node_sym = 'brocade-fdmi/node-symbolic-name'
# Commonly used URIs: brocade-fibrechannel-routing
bfr_uri = 'brocade-fibrechannel-routing'
bfr_rc = bfr_uri + '/routing-configuration'
bfr_rc_lc = bfr_rc + '/maximum-lsan-count'
bfr_rc_bfid = bfr_rc + '/backbone-fabric-id'
bfr_rc_ifl = bfr_rc + '/shortest-ifl'
bfr_rc_en_tags = '/lsan-enforce-tags'
bfr_rc_sp_tags = bfr_rc + '/lsan-speed-tag'
bfr_rc_mm = bfr_rc + '/migration-mode'
bfr_rc_ptde = bfr_rc + '/persistent-translate-domain-enabled'
bfr_lz = bfr_uri + '/lsan-zone'
bfr_ld = bfr_uri + '/lsan-device'
bfr_efa = bfr_uri + '/edge-fabric-alias'
bfr_fcr = bfr_uri + '/fibrechannel-router'
bfr_stats = bfr_uri + '/router-statistics'
bfr_stats_lz_in_use = bfr_stats + '/lsan-zones-in-use'
bfr_stats_mld = bfr_stats + '/maximum-lsan-devices'
bfr_stats_ld_in_use = bfr_stats + '/lsan-devices-in-use'
bfr_stats_mpds = bfr_stats + '/maximum-proxy-device-slots'
bfr_stats_pds_in_use = bfr_stats + '/proxy-device-slots-in-use'
bfr_stats_mpd = bfr_stats + '/maximum-proxy-devices'
bfr_stats_max_nr = bfr_stats + '/maximum-nr-ports'
bfr_pc = bfr_uri + '/proxy-config'
bfr_tdc = bfr_uri + '/translate-domain-config'
bfr_std = bfr_uri + '/stale-translate-domain'
class VirtualFabricIdError(Exception):
pass
_VF_ID = '?vf-id='
# sfp_rules.xlsx actions may have been entered using CLI syntax so this table converts the CLI syntax to API syntax.
# Note that only actions with different syntax are converted. Actions not in this table are assumed to be correct API
# syntax.
_cli_to_api_convert = dict(
fence='port-fence',
snmp='snmp-trap',
unquar='un-quarantine',
decom='decommission',
toggle='port-toggle',
email='e-mail',
uninstall_vtap='vtap-uninstall',
sw_marginal='sw-marginal',
sw_critical='sw-critical',
sfp_marginal='sfp-marginal',
)
# Used in area in default_uri_map
NULL_OBJ = 0 # Actions on this KPI are either not supported or I didn't know what to do with them yet.
SESSION_OBJ = NULL_OBJ + 1
CHASSIS_OBJ = SESSION_OBJ + 1 # URI is associated with a physical chassis
CHASSIS_SWITCH_OBJ = CHASSIS_OBJ + 1 # URI is associated with a physical chassis containing switch objects
SWITCH_OBJ = CHASSIS_SWITCH_OBJ + 1 # URI is associated with a logical switch
SWITCH_PORT_OBJ = SWITCH_OBJ + 1 # URI is associated with a logical switch containing port objects
FABRIC_OBJ = SWITCH_PORT_OBJ + 1 # URI is associated with a fabric
FABRIC_SWITCH_OBJ = FABRIC_OBJ + 1 # URI is associated with a fabric containing switch objects
FABRIC_ZONE_OBJ = FABRIC_SWITCH_OBJ + 1 # URI is associated with a fabric containing zoning objects
# op_no* is used in the op field in session to determine if OPTIONS has been requested for the associated URI
op_no = 0 # OPTIONS has not been requested. Using defaults.
op_not_supported = 1 # OPTIONS is not supported for the URI
op_yes = 2 # OPTIONS has been requested. Defaults for the URI have been replaced with the actual methods supported.
"""Below is the default URI map. It was built against FOS 9.1. It is necessary because there is no way to retrieve the
FID or area from the FOS API. An RFE was submitted to get this information. This information is used to build
default_uri_map. Up to the time this was written, all keys (branches) were unique regardless of the URL type. In
FOS 9.1, a new URL type, "operations" was introduced. Although it appears that all keys are still unique, separate keys
for each type were added because it does not appear that anyone in engineering is thinking they need to be unique.
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| Key 0 | Branch |Key 1 | Type | Description |
+===============+===========+===========+=======+===================================================================+
| | | | dict | URI prefix is just "/rest/" |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| | | area | int | Used to indicate what type of object this request is associated |
| | | | | with. Search for "Used in area in default_uri_map" above for |
| | | | | details. |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| | | fid | bool | If True, this is a fabric level request and the VF ID (?vf-id=xx) |
| | | | | should be appended to the uri |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| | | methods | list | List of supported methods. Currently, only checked for GET. |
| | | | | Intended for future use. |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| | | op | int | "Options Polled". 0: No, 1: OPTIONS not supported, 2: Yes |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| running | | | dict | URI prefix is "/rest/running/". Sub dictionaries are area, fid, |
| | | | | and methods as with "root". |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
| operations | | | dict | URI prefix is "/rest/operations/". Sub dictionaries are area, fid,|
| | | | | and methods as with "root". |
+---------------+-----------+-----------+-------+-------------------------------------------------------------------+
"""
default_uri_map = {
'auth-token': dict(area=NULL_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'brocade-module-version': dict(area=NULL_OBJ, fid=False, methods=()),
'brocade-module-version/module': dict(area=NULL_OBJ, fid=False, methods=('GET', 'HEAD', 'OPTIONS')),
'login': dict(area=SESSION_OBJ, fid=False, methods=('POST',)),
'logout': dict(area=SESSION_OBJ, fid=False, methods=('POST',)),
'running': {
'brocade-fibrechannel-switch': {
'fibrechannel-switch': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'switch-fabric-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'topology-domain': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'topology-route': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'topology-error': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-application-server': {
'application-server-device': dict(area=CHASSIS_OBJ, id=False, methods=('GET', 'HEAD', 'OPTIONS')),
},
'brocade-fibrechannel-logical-switch': {
'fibrechannel-logical-switch': dict(
area=CHASSIS_SWITCH_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
},
'brocade-interface': {
'fibrechannel': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'fibrechannel-statistics': dict(
area=SWITCH_PORT_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
'fibrechannel-performance': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'fibrechannel-statistics-db': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'extension-ip-interface': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('GET', 'DELETE')),
'fibrechannel-lag': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'gigabitethernet': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'gigabitethernet-statistics': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'logical-e-port': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'portchannel': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'portchannel-statistics': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'fibrechannel-router-statistics': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-media': {
'media-rdp': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fabric': {
'access-gateway': dict(area=FABRIC_SWITCH_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'fabric-switch': dict(area=FABRIC_SWITCH_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fibrechannel-routing': {
'routing-configuration': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'lsan-zone': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'lsan-device': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'edge-fabric-alias': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'fibrechannel-router': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'router-statistics': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'proxy-config': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'translate-domain-config': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'stale-translate-domain': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD')),
},
'brocade-ip-storage': dict(
ipStorage=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD')
),
),
'brocade-ip-storage-diagnostics': dict(
ipStorageDiagnostics=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD')
),
),
'brocade-ip-storage-diagnostic-reachable': dict(
ipStorageDiagnosticReachable=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD')
),
),
'brocade-isns': dict(
isns=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD')
),
),
'brocade-object-server': dict(
objectServer=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD')
),
),
'brocade-traffic-class': dict(
trafficClass=dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
),
'brocade-zone': {
'defined-configuration': dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'effective-configuration': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'fabric-lock': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fibrechannel-diagnostics': {
'fibrechannel-diagnostics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
},
'brocade-fdmi': {
'hba': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'port': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-name-server': {
'fibrechannel-name-server': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fabric-traffic-controller': {
'fabric-traffic-controller-device': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fibrechannel-configuration': {
'switch-configuration': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'f-port-login-settings': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'port-configuration': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'zone-configuration': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'fabric': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'chassis-config-settings': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
# fos-settings is not in the REST API documentation. The OPTIONS request returns 'reason': 'OK',
# 'status': 200. The response is a list, as expected, but contains None. GET completes successfully with:
# 'reason': 'OK', 'status': 200, but there is no response body. I suspect these are chassis related
# settings, but everything else in this branch is logical switch related. If someone ever uses fos-settings,
# they have a little debugging to do and likely will have to open a defect with FOS engineering.
'fos-settings': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET')),
},
'brocade-logging': {
'audit': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'syslog-server': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'log-setting': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'log-quiet-control': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'raslog': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'raslog-module': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'supportftp': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'error-log': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'audit-log': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'management-session-login-information': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fibrechannel-trunk': {
'trunk': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'performance': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'trunk-area': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')),
},
'brocade-ficon': {
'cup': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'logical-path': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'rnid': dict(area=SWITCH_PORT_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'switch-rnid': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'lirr': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'rlir': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-fru': {
'power-supply': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'fan': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'blade': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'history-log': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'sensor': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'wwn': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-chassis': {
'chassis': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'ha-status': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'credit-recovery': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'management-interface-configuration': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
'management-ethernet-interface': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
'management-port-track-configuration': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
'management-port-connection-statistics': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'sn-chassis': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'version': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-maps': {
'maps-config': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'rule': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')),
'maps-policy': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'group': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')),
'dashboard-rule': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'dashboard-history': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'dashboard-misc': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'credit-stall-dashboard': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'oversubscription-dashboard': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'system-resources': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'paused-cfg': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')),
'monitoring-system-matrix': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'switch-status-policy-report': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'fpi-profile': dict(
area=SWITCH_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'maps-violation': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'backend-ports-history': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'gigabit-ethernet-ports-history': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'maps-device-login': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'quarantined-devices': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-time': {
'clock-server': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'time-zone': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'ntp-clock-server': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'ntp-clock-server-key': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')
),
},
'brocade-security': {
'sec-crypto-cfg': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'sec-crypto-cfg-template': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'sec-crypto-cfg-template-action': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS',)),
'password-cfg': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'user-specific-password-cfg': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'user-config': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'ldap-role-map': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'sshutil': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'sshutil-key': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')),
'sshutil-known-host': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')
),
'sshutil-public-key': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'DELETE', 'GET', 'HEAD')),
'sshutil-public-key-action': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS',)),
'password': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS',)),
'security-certificate-generate': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS',)),
'security-certificate-action': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'DELETE')),
'security-certificate': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'radius-server': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'tacacs-server': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'ldap-server': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'auth-spec': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'ipfilter-policy': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'ipfilter-rule': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST')
),
'security-certificate-extension': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'role-config': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'rbac-class': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'management-rbac-map': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'security-violation-statistics': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'acl-policy': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'authentication-configuration': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')
),
'dh-chap-authentication-secret': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
# Fabric based security policies
'defined-fcs-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'active-fcs-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'defined-scc-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'active-scc-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'defined-dcc-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'active-dcc-policy-member-list': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'security-policy-size': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'policy-distribution-config': dict(area=SWITCH_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
},
'brocade-license': {
'license': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'ports-on-demand-license-info': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'end-user-license-agreement': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-snmp': {
'system': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'mib-capability': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'trap-capability': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'v1-account': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'v1-trap': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'v3-account': dict(
area=CHASSIS_OBJ,
fid=False,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'v3-trap': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'access-control': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
},
'brocade-management-ip-interface': {
'management-ip-interface': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
'management-interface-lldp-neighbor': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'management-interface-lldp-statistics': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-firmware': {
'firmware-history': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'firmware-config': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD', 'PATCH')),
},
'brocade-dynamic-feature-tracking': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
'brocade-usb': {
'usb-file': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-extension-ip-route': {
'extension-ip-route': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-extension-ipsec-policy': {
'extension-ipsec-policy': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-extension-tunnel': { # I think some of these should be SWITCH_PORT_OBJ
'extension-tunnel': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'extension-tunnel-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'extension-circuit': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'extension-circuit-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'circuit-qos-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'circuit-interval-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'wan-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'wan-statistics-v1': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-extension': {
'traffic-control-list': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'dp-hcl-status': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'global-lan-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'lan-flow-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-lldp': {
'lldp-neighbor': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'lldp-profile': dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
'lldp-statistics': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'lldp-global': dict(
area=FABRIC_OBJ,
fid=True,
methods=('OPTIONS', 'DELETE', 'GET', 'HEAD', 'POST', 'PATCH')
),
},
'brocade-supportlink': {
'supportlink-profile': dict(area=CHASSIS_OBJ, fid=False, methods=('GET', 'PATCH', 'HEAD', 'OPTIONS')),
'supportlink-history': dict(area=CHASSIS_OBJ, fid=False, methods=('OPTIONS', 'GET', 'HEAD')),
},
'brocade-traffic-optimizer': {
'performance-group-profile': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'performance-group-flows': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
'performance-group': dict(area=FABRIC_OBJ, fid=True, methods=('OPTIONS', 'GET', 'HEAD')),
},
},
'operations': {
'brocade-diagnostics': dict(area=NULL_OBJ, fid=False, methods=('POST', 'OPTIONS')),
'configdownload': dict(area=NULL_OBJ, fid=False, methods=('POST', 'OPTIONS')),
'configupload': dict(area=NULL_OBJ, fid=False, methods=('POST', 'OPTIONS')),