cisco_node_utils 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +13 -0
  5. data/.travis.yml +4 -1
  6. data/CHANGELOG.md +81 -2
  7. data/CONTRIBUTING.md +2 -17
  8. data/Gemfile +5 -0
  9. data/README.md +92 -47
  10. data/Rakefile +23 -1
  11. data/bin/git/hooks/hook_lib +7 -0
  12. data/bin/git/hooks/pre-commit/check_unstaged_changes +18 -0
  13. data/bin/git/hooks/pre-commit/rubocop +7 -2
  14. data/bin/git/hooks/pre-commit/validate-diffs +18 -4
  15. data/bin/git/hooks/pre-commit/validate-yaml +18 -0
  16. data/bin/git/update-hooks +64 -6
  17. data/cisco_node_utils.gemspec +9 -6
  18. data/docs/README-develop-best-practices.md +149 -50
  19. data/docs/README-develop-node-utils-APIs.md +92 -42
  20. data/docs/README-maintainers.md +7 -4
  21. data/docs/README-test-execution.md +57 -0
  22. data/docs/cisco_node_utils.yaml.example +30 -0
  23. data/docs/template-router.rb +4 -0
  24. data/ext/mkrf_conf.rb +63 -0
  25. data/lib/.rubocop.yml +2 -2
  26. data/lib/cisco_node_utils.rb +5 -0
  27. data/lib/cisco_node_utils/aaa_authentication_login.rb +5 -6
  28. data/lib/cisco_node_utils/aaa_authorization_service.rb +1 -1
  29. data/lib/cisco_node_utils/ace.rb +165 -12
  30. data/lib/cisco_node_utils/acl.rb +2 -1
  31. data/lib/cisco_node_utils/bgp.rb +184 -21
  32. data/lib/cisco_node_utils/bgp_af.rb +94 -249
  33. data/lib/cisco_node_utils/bgp_neighbor.rb +94 -14
  34. data/lib/cisco_node_utils/bgp_neighbor_af.rb +75 -8
  35. data/lib/cisco_node_utils/bridge_domain.rb +183 -0
  36. data/lib/cisco_node_utils/bridge_domain_vni.rb +206 -0
  37. data/lib/cisco_node_utils/cisco_cmn_utils.rb +85 -2
  38. data/lib/cisco_node_utils/client.rb +35 -0
  39. data/lib/cisco_node_utils/client/client.rb +234 -0
  40. data/lib/cisco_node_utils/client/grpc.rb +33 -0
  41. data/lib/cisco_node_utils/client/grpc/client.rb +311 -0
  42. data/lib/cisco_node_utils/client/grpc/ems.proto +148 -0
  43. data/lib/cisco_node_utils/client/grpc/ems.rb +111 -0
  44. data/lib/cisco_node_utils/client/grpc/ems_services.rb +49 -0
  45. data/lib/cisco_node_utils/client/nxapi.rb +31 -0
  46. data/lib/cisco_node_utils/client/nxapi/client.rb +305 -0
  47. data/lib/cisco_node_utils/client/utils.rb +164 -0
  48. data/lib/cisco_node_utils/cmd_ref/README_YAML.md +222 -254
  49. data/lib/cisco_node_utils/cmd_ref/aaa_auth_login_service.yaml +11 -8
  50. data/lib/cisco_node_utils/cmd_ref/aaa_authentication_login.yaml +22 -15
  51. data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +11 -8
  52. data/lib/cisco_node_utils/cmd_ref/acl.yaml +21 -16
  53. data/lib/cisco_node_utils/cmd_ref/bgp.yaml +239 -109
  54. data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +114 -55
  55. data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +76 -52
  56. data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +106 -62
  57. data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +71 -0
  58. data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +33 -0
  59. data/lib/cisco_node_utils/cmd_ref/dnsclient.yaml +35 -14
  60. data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +25 -0
  61. data/lib/cisco_node_utils/cmd_ref/evpn_vni.yaml +23 -17
  62. data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +94 -83
  63. data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +22 -17
  64. data/lib/cisco_node_utils/cmd_ref/feature.yaml +76 -26
  65. data/lib/cisco_node_utils/cmd_ref/images.yaml +3 -2
  66. data/lib/cisco_node_utils/cmd_ref/interface.yaml +381 -153
  67. data/lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml +21 -11
  68. data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +21 -21
  69. data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +30 -21
  70. data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +18 -13
  71. data/lib/cisco_node_utils/cmd_ref/inventory.yaml +26 -31
  72. data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +83 -0
  73. data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +119 -0
  74. data/lib/cisco_node_utils/cmd_ref/memory.yaml +17 -6
  75. data/lib/cisco_node_utils/cmd_ref/ntp_config.yaml +10 -3
  76. data/lib/cisco_node_utils/cmd_ref/ntp_server.yaml +17 -5
  77. data/lib/cisco_node_utils/cmd_ref/ospf.yaml +33 -29
  78. data/lib/cisco_node_utils/cmd_ref/overlay_global.yaml +12 -10
  79. data/lib/cisco_node_utils/cmd_ref/pim.yaml +16 -19
  80. data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +40 -25
  81. data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +17 -12
  82. data/lib/cisco_node_utils/cmd_ref/radius_server.yaml +71 -35
  83. data/lib/cisco_node_utils/cmd_ref/radius_server_group.yaml +10 -5
  84. data/lib/cisco_node_utils/cmd_ref/show_system.yaml +6 -2
  85. data/lib/cisco_node_utils/cmd_ref/show_version.yaml +47 -43
  86. data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +13 -11
  87. data/lib/cisco_node_utils/cmd_ref/snmp_group.yaml +4 -2
  88. data/lib/cisco_node_utils/cmd_ref/snmp_notification_receiver.yaml +23 -21
  89. data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +26 -22
  90. data/lib/cisco_node_utils/cmd_ref/snmp_user.yaml +19 -17
  91. data/lib/cisco_node_utils/cmd_ref/snmpnotification.yaml +18 -6
  92. data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +234 -0
  93. data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +24 -9
  94. data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +5 -3
  95. data/lib/cisco_node_utils/cmd_ref/system.yaml +4 -3
  96. data/lib/cisco_node_utils/cmd_ref/tacacs_server.yaml +22 -20
  97. data/lib/cisco_node_utils/cmd_ref/tacacs_server_group.yaml +27 -15
  98. data/lib/cisco_node_utils/cmd_ref/tacacs_server_host.yaml +45 -16
  99. data/lib/cisco_node_utils/cmd_ref/vdc.yaml +21 -11
  100. data/lib/cisco_node_utils/cmd_ref/virtual_service.yaml +3 -2
  101. data/lib/cisco_node_utils/cmd_ref/vlan.yaml +60 -32
  102. data/lib/cisco_node_utils/cmd_ref/vpc.yaml +118 -101
  103. data/lib/cisco_node_utils/cmd_ref/vrf.yaml +54 -58
  104. data/lib/cisco_node_utils/cmd_ref/vrf_af.yaml +118 -0
  105. data/lib/cisco_node_utils/cmd_ref/vtp.yaml +19 -25
  106. data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +28 -18
  107. data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +34 -17
  108. data/lib/cisco_node_utils/cmd_ref/yum.yaml +6 -4
  109. data/lib/cisco_node_utils/command_reference.rb +261 -142
  110. data/lib/cisco_node_utils/constants.rb +33 -0
  111. data/lib/cisco_node_utils/encapsulation.rb +112 -0
  112. data/lib/cisco_node_utils/environment.rb +102 -0
  113. data/lib/cisco_node_utils/evpn_vni.rb +5 -3
  114. data/lib/cisco_node_utils/exceptions.rb +111 -0
  115. data/lib/cisco_node_utils/fabricpath_global.rb +52 -35
  116. data/lib/cisco_node_utils/fabricpath_topology.rb +44 -57
  117. data/lib/cisco_node_utils/feature.rb +165 -3
  118. data/lib/cisco_node_utils/interface.rb +1051 -260
  119. data/lib/cisco_node_utils/interface_channel_group.rb +11 -10
  120. data/lib/cisco_node_utils/interface_ospf.rb +1 -2
  121. data/lib/cisco_node_utils/interface_portchannel.rb +4 -12
  122. data/lib/cisco_node_utils/interface_service_vni.rb +7 -7
  123. data/lib/cisco_node_utils/itd_device_group.rb +248 -0
  124. data/lib/cisco_node_utils/itd_device_group_node.rb +144 -0
  125. data/lib/cisco_node_utils/itd_service.rb +523 -0
  126. data/lib/cisco_node_utils/logger.rb +75 -0
  127. data/lib/cisco_node_utils/node.rb +62 -192
  128. data/lib/cisco_node_utils/node_util.rb +56 -10
  129. data/lib/cisco_node_utils/overlay_global.rb +2 -2
  130. data/lib/cisco_node_utils/pim.rb +2 -13
  131. data/lib/cisco_node_utils/pim_group_list.rb +1 -1
  132. data/lib/cisco_node_utils/pim_rp_address.rb +1 -1
  133. data/lib/cisco_node_utils/platform.rb +52 -21
  134. data/lib/cisco_node_utils/portchannel_global.rb +89 -19
  135. data/lib/cisco_node_utils/radius_server.rb +168 -37
  136. data/lib/cisco_node_utils/router_ospf.rb +20 -35
  137. data/lib/cisco_node_utils/router_ospf_vrf.rb +4 -4
  138. data/lib/cisco_node_utils/snmpserver.rb +1 -6
  139. data/lib/cisco_node_utils/snmpuser.rb +6 -4
  140. data/lib/cisco_node_utils/stp_global.rb +676 -0
  141. data/lib/cisco_node_utils/syslog_server.rb +77 -18
  142. data/lib/cisco_node_utils/syslog_settings.rb +1 -1
  143. data/lib/cisco_node_utils/tacacs_server_group.rb +8 -4
  144. data/lib/cisco_node_utils/tacacs_server_host.rb +115 -25
  145. data/lib/cisco_node_utils/vdc.rb +12 -0
  146. data/lib/cisco_node_utils/version.rb +1 -1
  147. data/lib/cisco_node_utils/vlan.rb +147 -29
  148. data/lib/cisco_node_utils/vpc.rb +55 -3
  149. data/lib/cisco_node_utils/vrf.rb +72 -11
  150. data/lib/cisco_node_utils/vrf_af.rb +114 -29
  151. data/lib/cisco_node_utils/vtp.rb +34 -52
  152. data/lib/cisco_node_utils/vxlan_vtep.rb +34 -8
  153. data/lib/cisco_node_utils/vxlan_vtep_vni.rb +36 -4
  154. data/lib/minitest/environment_plugin.rb +31 -0
  155. data/lib/minitest/log_level_plugin.rb +41 -0
  156. data/spec/client_spec.rb +7 -0
  157. data/spec/environment_spec.rb +263 -0
  158. data/spec/grpc_client_spec.rb +23 -0
  159. data/spec/isolate/all_clients_spec.rb +9 -0
  160. data/spec/isolate/grpc_only_spec.rb +16 -0
  161. data/spec/isolate/no_clients_spec.rb +26 -0
  162. data/spec/isolate/nxapi_only_spec.rb +16 -0
  163. data/spec/nxapi_client_spec.rb +42 -0
  164. data/spec/schema.yaml +75 -0
  165. data/spec/shared_examples_for_clients.rb +14 -0
  166. data/spec/spec_helper.rb +91 -0
  167. data/spec/whitespace_spec.rb +10 -0
  168. data/spec/yaml_spec.rb +42 -0
  169. data/tests/.rubocop.yml +2 -2
  170. data/tests/CSCuxdublin-1.0.0-7.0.3.I3.1.lib32_n9000.rpm +0 -0
  171. data/tests/basetest.rb +96 -36
  172. data/tests/ciscotest.rb +220 -12
  173. data/tests/cmd_config.yaml +71 -49
  174. data/tests/cmd_config_invalid.yaml +1 -1
  175. data/tests/test_aaa_authentication_login.rb +1 -0
  176. data/tests/test_aaa_authentication_login_service.rb +9 -0
  177. data/tests/test_aaa_authorization_service.rb +173 -367
  178. data/tests/test_ace.rb +171 -100
  179. data/tests/test_acl.rb +10 -1
  180. data/tests/test_bgp_af.rb +395 -728
  181. data/tests/test_bgp_neighbor.rb +274 -115
  182. data/tests/test_bgp_neighbor_af.rb +178 -77
  183. data/tests/test_bridge_domain.rb +191 -0
  184. data/tests/test_bridge_domain_vni.rb +116 -0
  185. data/tests/test_client_utils.rb +111 -0
  186. data/tests/test_command_config.rb +9 -5
  187. data/tests/test_command_reference.rb +380 -102
  188. data/tests/test_dns_domain.rb +13 -3
  189. data/tests/test_domain_name.rb +13 -3
  190. data/tests/test_encapsulation.rb +77 -0
  191. data/tests/test_evpn_vni.rb +25 -7
  192. data/tests/test_fabricpath_global.rb +167 -163
  193. data/tests/test_fabricpath_topology.rb +12 -33
  194. data/tests/test_feature.rb +215 -0
  195. data/tests/test_grpc.rb +166 -0
  196. data/tests/test_interface.rb +585 -344
  197. data/tests/test_interface_bdi.rb +80 -0
  198. data/tests/test_interface_channel_group.rb +6 -3
  199. data/tests/test_interface_ospf.rb +26 -24
  200. data/tests/test_interface_portchannel.rb +1 -0
  201. data/tests/test_interface_private_vlan.rb +724 -0
  202. data/tests/test_interface_service_vni.rb +37 -66
  203. data/tests/test_interface_svi.rb +98 -101
  204. data/tests/test_interface_switchport.rb +419 -549
  205. data/tests/test_itd_device_group.rb +145 -0
  206. data/tests/test_itd_device_group_node.rb +199 -0
  207. data/tests/test_itd_service.rb +298 -0
  208. data/tests/test_logger.rb +43 -0
  209. data/tests/test_name_server.rb +11 -2
  210. data/tests/test_node.rb +16 -75
  211. data/tests/test_node_ext.rb +174 -163
  212. data/tests/test_node_util.rb +119 -0
  213. data/tests/test_ntp_config.rb +5 -1
  214. data/tests/test_ntp_server.rb +2 -2
  215. data/tests/test_nxapi.rb +221 -0
  216. data/tests/test_overlay_global.rb +47 -38
  217. data/tests/test_pim.rb +2 -0
  218. data/tests/test_pim_group_list.rb +2 -0
  219. data/tests/test_pim_rp_address.rb +2 -0
  220. data/tests/test_platform.rb +86 -39
  221. data/tests/test_portchannel_global.rb +211 -135
  222. data/tests/test_radius_global.rb +13 -5
  223. data/tests/test_radius_server.rb +256 -104
  224. data/tests/test_radius_server_group.rb +2 -0
  225. data/tests/test_router_bgp.rb +781 -485
  226. data/tests/test_router_ospf.rb +26 -103
  227. data/tests/test_router_ospf_vrf.rb +52 -57
  228. data/tests/test_snmp_notification_receiver.rb +2 -0
  229. data/tests/test_snmpcommunity.rb +2 -0
  230. data/tests/test_snmpgroup.rb +2 -0
  231. data/tests/test_snmpnotification.rb +40 -21
  232. data/tests/test_snmpserver.rb +2 -0
  233. data/tests/test_snmpuser.rb +2 -0
  234. data/tests/test_stp_global.rb +563 -0
  235. data/tests/test_syslog_server.rb +32 -8
  236. data/tests/test_syslog_settings.rb +22 -9
  237. data/tests/test_tacacs_server.rb +32 -27
  238. data/tests/test_tacacs_server_group.rb +100 -45
  239. data/tests/test_tacacs_server_host.rb +135 -43
  240. data/tests/test_vdc.rb +2 -16
  241. data/tests/test_vlan.rb +106 -54
  242. data/tests/test_vlan_mt_full.rb +11 -21
  243. data/tests/test_vlan_private.rb +669 -0
  244. data/tests/test_vpc.rb +312 -159
  245. data/tests/test_vrf.rb +122 -113
  246. data/tests/test_vrf_af.rb +238 -0
  247. data/tests/test_vtp.rb +58 -102
  248. data/tests/test_vxlan_vtep.rb +38 -17
  249. data/tests/test_vxlan_vtep_vni.rb +61 -9
  250. data/tests/test_yum.rb +49 -25
  251. metadata +122 -36
  252. data/lib/cisco_node_utils/cmd_ref/fex.yaml +0 -9
  253. data/lib/cisco_node_utils/cmd_ref/vni.yaml +0 -76
  254. data/lib/cisco_node_utils/vni.rb +0 -227
  255. data/tests/test_vni.rb +0 -106
@@ -1,22 +1,25 @@
1
1
  # aaa_auth_login_service
2
2
  ---
3
+ _exclude: [ios_xr]
4
+
3
5
  groups:
4
- config_get: "show aaa authentication"
5
- config_get_token: ["TABLE_AuthenMethods", "ROW_AuthenMethods"]
6
+ get_data_format: nxapi_structured
7
+ get_command: "show aaa authentication"
8
+ get_context: ["TABLE_AuthenMethods", "ROW_AuthenMethods"]
6
9
  # this set is only used when there are groups to configure
7
- config_set: "%s aaa authentication login %s group %s %s"
10
+ set_value: "%s aaa authentication login %s group %s %s"
8
11
  default_value: []
9
12
  multiple:
10
13
 
11
14
  method:
12
15
  auto_default: false
13
- config_get: "show aaa authentication"
14
- config_get_token: '/^\s*%s:.*(local|none)\s*$/'
16
+ get_command: "show aaa authentication"
17
+ get_value: '/^\s*%s:.*(local|none)\s*$/'
15
18
  # this set is only used when there are no groups to configure
16
- config_set: "%s aaa authentication login %s %s"
19
+ set_value: "%s aaa authentication login %s %s"
17
20
  default_value: :local
18
21
 
19
22
  services:
20
- config_get: "show run aaa all"
21
- config_get_token: '/^aaa authentication login (\S+) (?:none|group|local)/'
23
+ get_command: "show run aaa all"
24
+ get_value: '/^aaa authentication login (\S+) (?:none|group|local)/'
22
25
  multiple:
@@ -1,31 +1,38 @@
1
1
  # aaa_authentication_login
2
2
  ---
3
+ _exclude: [ios_xr]
4
+
3
5
  ascii_authentication:
4
- config_get: "show run aaa all"
5
- config_get_token: '/^aaa authentication login ascii-authentication/'
6
- config_set: "%s aaa authentication login ascii-authentication"
6
+ kind: boolean
7
+ get_command: "show run aaa all"
8
+ get_value: '/^aaa authentication login ascii-authentication/'
9
+ set_value: "%s aaa authentication login ascii-authentication"
7
10
  default_value: false
8
11
 
9
12
  chap:
10
- config_get: "show run aaa all"
11
- config_get_token: '/^aaa authentication login chap enable/'
12
- config_set: "%s aaa authentication login chap enable"
13
+ kind: boolean
14
+ get_command: "show run aaa all"
15
+ get_value: '/^aaa authentication login chap enable/'
16
+ set_value: "%s aaa authentication login chap enable"
13
17
  default_value: false
14
18
 
15
19
  error_display:
16
- config_get: "show run aaa all"
17
- config_get_token: '/^aaa authentication login error-enable/'
18
- config_set: "%s aaa authentication login error-enable"
20
+ kind: boolean
21
+ get_command: "show run aaa all"
22
+ get_value: '/^aaa authentication login error-enable/'
23
+ set_value: "%s aaa authentication login error-enable"
19
24
  default_value: false
20
25
 
21
26
  mschap:
22
- config_get: "show run aaa all"
23
- config_get_token: '/^aaa authentication login mschap enable/'
24
- config_set: "%s aaa authentication login mschap enable"
27
+ kind: boolean
28
+ get_command: "show run aaa all"
29
+ get_value: '/^aaa authentication login mschap enable/'
30
+ set_value: "%s aaa authentication login mschap enable"
25
31
  default_value: false
26
32
 
27
33
  mschapv2:
28
- config_get: "show run aaa all"
29
- config_get_token: '/^aaa authentication login mschapv2 enable/'
30
- config_set: "%s aaa authentication login mschapv2 enable"
34
+ kind: boolean
35
+ get_command: "show run aaa all"
36
+ get_value: '/^aaa authentication login mschapv2 enable/'
37
+ set_value: "%s aaa authentication login mschapv2 enable"
31
38
  default_value: false
@@ -1,22 +1,25 @@
1
1
  # aaa_authorization_service
2
2
  ---
3
+ _exclude: [ios_xr]
4
+
3
5
  groups:
4
- config_get: "show aaa authorization all"
5
- config_get_token: ["TABLE_cmd_methods", "ROW_cmd_methods"]
6
+ get_data_format: nxapi_structured
7
+ get_command: "show aaa authorization all"
8
+ get_context: ["TABLE_cmd_methods", "ROW_cmd_methods"]
6
9
  # this set is only used when there are groups to configure
7
- config_set: "%s aaa authorization %s %s group %s %s"
10
+ set_value: "%s aaa authorization %s %s group %s %s"
8
11
  default_value: []
9
12
  multiple:
10
13
 
11
14
  method:
12
15
  auto_default: false
13
- config_get: "show aaa authorization all"
14
- config_get_token: '/^\s+%s authorization for %s:.*(local) ?$/'
16
+ get_command: "show aaa authorization all"
17
+ get_value: '/^\s+%s authorization for %s:.*(local) ?$/'
15
18
  # this set is only used when there are no groups to configure
16
- config_set: "%s aaa authorization %s %s local"
19
+ set_value: "%s aaa authorization %s %s local"
17
20
  default_value: :local
18
21
 
19
22
  services:
20
- config_get: "show run aaa all"
21
- config_get_token: '/^aaa authorization (\S+) (\S+) .*(?:local)? ?$/'
23
+ get_command: "show run aaa all"
24
+ get_value: '/^aaa authorization (\S+) (\S+) .*(?:local)? ?$/'
22
25
  multiple:
@@ -4,40 +4,45 @@
4
4
  # - README_YAML.md
5
5
  #
6
6
  ---
7
+ _exclude: [ios_xr]
8
+
7
9
  _template:
8
- config_get: 'show run aclmgr'
9
- config_get_token: '/^<afi> access-list <acl_name>$/'
10
- config_set: '<afi> access-list <acl_name>'
10
+ get_command: 'show run aclmgr'
11
+ context: ['<afi> access-list <acl_name>']
11
12
 
12
13
  ace:
13
- config_get_token_append: '/^<seqno> .+$/'
14
- config_set_append: '<state> <seqno> <action> <proto> <src_addr> <src_port> <dst_addr> <dst_port>'
14
+ get_value: '/^<seqno> .+$/'
15
+ set_value: '<state> <seqno> <action> <proto> <src_addr> <src_port> <dst_addr> <dst_port> <tcp_flags> <established> <precedence> <dscp> <http_method> <time_range> <packet_length> <ttl> <tcp_option_length> <redirect> <log>'
15
16
 
16
17
  ace_destroy:
17
- config_set_append: 'no <seqno>'
18
+ set_value: 'no <seqno>'
18
19
 
19
20
  ace_remark:
20
- config_set_append: '<state> <seqno> remark <remark>'
21
+ set_value: '<state> <seqno> remark <remark>'
21
22
 
22
23
  acl:
23
- config_get_token: '/^<afi> access-list (\S+)$/'
24
- config_set: '<state> <afi> access-list <acl_name>'
25
-
24
+ context: ~
25
+ get_value: '/^<afi> access-list (\S+)$/'
26
+ set_value: '<state> <afi> access-list <acl_name>'
27
+
26
28
  all_aces:
27
29
  multiple:
28
- config_get_token_append: '/^(\d+) .+$/'
30
+ get_value: '/^(\d+) .+$/'
29
31
 
30
32
  all_acls:
31
33
  multiple:
32
- config_get_token: '/^<afi> access-list (\S+)$/'
34
+ get_context: ~
35
+ get_value: '/^<afi> access-list (\S+)$/'
33
36
 
34
37
  fragments:
35
- config_get_token_append: '/fragments (\S+)$/'
36
- config_set_append: '<state> fragments <action>'
38
+ # Note: The ACL 'fragments' keyword is independent of ACE 'fragments'
39
+ _exclude: [N5k, N6k]
40
+ get_value: '/fragments (\S+)$/'
41
+ set_value: '<state> fragments <action>'
37
42
  default_value: ~
38
43
 
39
44
  stats_per_entry:
40
45
  kind: boolean
41
- config_get_token_append: '/statistics per-entry$/'
42
- config_set_append: '<state> statistics per-entry'
46
+ get_value: '/statistics per-entry$/'
47
+ set_value: '<state> statistics per-entry'
43
48
  default_value: false
@@ -1,230 +1,358 @@
1
1
  # bgp.yaml
2
2
  ---
3
3
  _template:
4
- config_get: "show running bgp all"
5
- config_get_token: '/^router bgp <asnum>$/'
6
- config_get_token_append:
7
- - '/^vrf <vrf>$/'
8
- config_set: "router bgp <asnum>"
9
- config_set_append:
10
- - "vrf <vrf>"
4
+ ios_xr:
5
+ get_command: "show running-config router bgp"
6
+ nexus:
7
+ get_command: "show running bgp all"
8
+ context:
9
+ - "router bgp <asnum>"
10
+ - "(?)vrf <vrf>"
11
11
 
12
12
  address_family:
13
- config_set_append: '<state> address-family <afi> <safi>'
13
+ set_value: '<state> address-family <afi> <safi>'
14
14
 
15
15
  bestpath_always_compare_med:
16
16
  kind: boolean
17
- config_get_token_append: '/^bestpath always-compare-med$/'
18
- config_set_append: '<state> bestpath always-compare-med'
19
17
  default_value: false
18
+ ios_xr:
19
+ get_value: 'bgp bestpath med always'
20
+ set_value: '<state> bgp bestpath med always'
21
+ nexus:
22
+ get_value: 'bestpath always-compare-med'
23
+ set_value: '<state> bestpath always-compare-med'
20
24
 
21
25
  bestpath_aspath_multipath_relax:
22
26
  kind: boolean
23
- config_get_token_append: '/^bestpath as-path multipath-relax$/'
24
- config_set_append: '<state> bestpath as-path multipath-relax'
25
27
  default_value: false
28
+ ios_xr:
29
+ get_value: 'bgp bestpath as-path multipath-relax'
30
+ set_value: '<state> bgp bestpath as-path multipath-relax'
31
+ nexus:
32
+ get_value: 'bestpath as-path multipath-relax'
33
+ set_value: '<state> bestpath as-path multipath-relax'
26
34
 
27
35
  bestpath_compare_routerid:
28
36
  kind: boolean
29
- config_get_token_append: '/^bestpath compare-routerid$/'
30
- config_set_append: '<state> bestpath compare-routerid'
31
37
  default_value: false
38
+ ios_xr:
39
+ get_value: 'bgp bestpath compare-routerid'
40
+ set_value: '<state> bgp bestpath compare-routerid'
41
+ nexus:
42
+ get_value: 'bestpath compare-routerid'
43
+ set_value: '<state> bestpath compare-routerid'
32
44
 
33
45
  bestpath_cost_community_ignore:
34
46
  kind: boolean
35
- config_get_token_append: '/^bestpath cost-community ignore$/'
36
- config_set_append: '<state> bestpath cost-community ignore'
37
47
  default_value: false
48
+ ios_xr:
49
+ get_value: 'bgp bestpath cost-community ignore'
50
+ set_value: '<state> bgp bestpath cost-community ignore'
51
+ nexus:
52
+ get_value: 'bestpath cost-community ignore'
53
+ set_value: '<state> bestpath cost-community ignore'
38
54
 
39
55
  bestpath_med_confed:
40
56
  kind: boolean
41
- config_get_token_append: '/^bestpath med confed$/'
42
- config_set_append: '<state> bestpath med confed'
43
57
  default_value: false
58
+ ios_xr:
59
+ # Note: Only applies to global BGP; not VRF applicable
60
+ get_value: 'bgp bestpath med confed'
61
+ set_value: '<state> bgp bestpath med confed'
62
+ nexus:
63
+ get_value: 'bestpath med confed'
64
+ set_value: '<state> bestpath med confed'
44
65
 
45
66
  bestpath_med_missing_as_worst:
46
67
  kind: boolean
47
- config_get_token_append: '/^bestpath med missing-as-worst$/'
48
- config_set_append: '<state> bestpath med missing-as-worst'
49
68
  default_value: false
69
+ ios_xr:
70
+ get_value: 'bgp bestpath med missing-as-worst'
71
+ set_value: '<state> bgp bestpath med missing-as-worst'
72
+ nexus:
73
+ get_value: 'bestpath med missing-as-worst'
74
+ set_value: '<state> bestpath med missing-as-worst'
50
75
 
51
76
  bestpath_med_non_deterministic:
52
- kind: boolean
53
- config_get_token_append: '/^bestpath med non-deterministic$/'
54
- config_set_append: '<state> bestpath med non-deterministic'
55
- default_value: false
77
+ # Note: Does not exist in IOS XR
78
+ nexus:
79
+ kind: boolean
80
+ get_value: 'bestpath med non-deterministic'
81
+ set_value: '<state> bestpath med non-deterministic'
82
+ default_value: false
56
83
 
57
84
  cluster_id:
58
- config_get_token_append: '/^cluster-id (\S+)$/'
59
- config_set_append: '<state> cluster-id <id>'
60
85
  default_value: ""
86
+ ios_xr:
87
+ # Note: Only applies to global BGP; not VRF applicable
88
+ get_value: 'bgp cluster-id (\S+)'
89
+ set_value: '<state> bgp cluster-id <id>'
90
+ nexus:
91
+ get_value: 'cluster-id (\S+)'
92
+ set_value: '<state> cluster-id <id>'
61
93
 
62
94
  confederation_id:
63
- config_get_token_append: '/^confederation identifier (\d+|\d+.\d+)$/'
64
- config_set_append: '<state> confederation identifier <id>'
65
95
  default_value: ""
96
+ ios_xr:
97
+ # Note: Only applies to global BGP; not VRF applicable
98
+ get_value: 'bgp confederation identifier (\d+|\d+.\d+)'
99
+ set_value: '<state> bgp confederation identifier <id>'
100
+ nexus:
101
+ get_value: 'confederation identifier (\d+|\d+.\d+)'
102
+ set_value: '<state> confederation identifier <id>'
66
103
 
67
104
  confederation_peers:
68
- config_get_token_append: '/^confederation peers (.*)$/'
69
- config_set_append: '<state> confederation peers <peer_list>'
70
- default_value: ""
105
+ default_value: []
106
+ ios_xr:
107
+ # Note: Only applies to global BGP; not VRF applicable
108
+ multiple: true
109
+ get_context:
110
+ - 'router bgp <asnum>'
111
+ - 'bgp confederation peers'
112
+ get_value: '/(\S+)/'
113
+ set_value: '<state> bgp confederation peers <peer>'
114
+ nexus:
115
+ get_value: 'confederation peers (.*)'
116
+ set_value: '<state> confederation peers <peer>'
71
117
 
72
118
  create_destroy_neighbor:
73
- config_set_append: '<state> neighbor <nbr>'
119
+ set_value: '<state> neighbor <nbr>'
74
120
 
75
121
  disable_policy_batching:
76
- config_get_token_append: '/^disable-policy-batching$/'
77
- config_set_append: '<state> disable-policy-batching'
78
- default_value: false
122
+ _exclude: [ios_xr]
123
+ get_value: '/^disable-policy-batching$/'
124
+ set_value: '<state> disable-policy-batching'
125
+ default_value: false
79
126
 
80
127
  disable_policy_batching_ipv4:
81
- _exclude: [/N(5|6|7)/]
82
- config_get_token_append: '/^disable-policy-batching ipv4 prefix-list (\S+)$/'
83
- config_set_append: '<state> disable-policy-batching ipv4 prefix-list <prefix_list>'
128
+ _exclude: [ios_xr, N5k, N6k, N7k]
129
+ get_value: '/^disable-policy-batching ipv4 prefix-list (\S+)$/'
130
+ set_value: '<state> disable-policy-batching ipv4 prefix-list <prefix_list>'
84
131
  default_value: ""
85
132
 
86
133
  disable_policy_batching_ipv6:
87
- _exclude: [/N(5|6|7)/]
88
- config_get_token_append: '/^disable-policy-batching ipv6 prefix-list (\S+)$/'
89
- config_set_append: '<state> disable-policy-batching ipv6 prefix-list <prefix_list>'
134
+ _exclude: [ios_xr, N5k, N6k, N7k]
135
+ get_value: '/^disable-policy-batching ipv6 prefix-list (\S+)$/'
136
+ set_value: '<state> disable-policy-batching ipv6 prefix-list <prefix_list>'
90
137
  default_value: ""
91
138
 
92
139
  enforce_first_as:
93
140
  kind: boolean
94
- config_get_token_append: '/^(no )?enforce-first-as$/'
95
- config_set_append: '<state> enforce-first-as'
96
141
  default_value: true
142
+ ios_xr:
143
+ get_value: 'bgp enforce-first-as disable'
144
+ set_value: '<state> bgp enforce-first-as disable'
145
+ nexus:
146
+ get_value: '(no )?enforce-first-as'
147
+ set_value: '<state> enforce-first-as'
97
148
 
98
149
  event_history_cli:
99
- config_get_token_append: '/^(no )?event-history cli(?: size (\S+))?$/'
100
- config_set_append: '<state> event-history cli <size>'
150
+ _exclude: [ios_xr]
151
+ get_value: '/^(no )?event-history cli(?: size (\S+))?$/'
152
+ set_value: '<state> event-history cli <size>'
101
153
  default_value: 'size_small'
102
154
 
103
155
  event_history_detail:
104
- config_get_token_append: '/^(no )?event-history detail(?: size (\S+))?$/'
105
- config_set_append: '<state> event-history detail <size>'
156
+ _exclude: [ios_xr]
157
+ get_value: '/^(no )?event-history detail(?: size (\S+))?$/'
158
+ set_value: '<state> event-history detail <size>'
106
159
  auto_default: false
107
160
  default_value: 'size_disable'
108
161
 
109
162
  event_history_events:
110
- config_get_token_append: '/^(no )?event-history events(?: size (\S+))?$/'
111
- config_set_append: '<state> event-history events <size>'
163
+ _exclude: [ios_xr]
164
+ get_value: '/^(no )?event-history events(?: size (\S+))?$/'
165
+ set_value: '<state> event-history events <size>'
112
166
  default_value: 'size_small'
113
167
 
114
168
  event_history_periodic:
115
- config_get_token_append: '/^(no )?event-history periodic(?: size (\S+))?$/'
116
- config_set_append: '<state> event-history periodic <size>'
169
+ _exclude: [ios_xr]
170
+ get_value: '/^(no )?event-history periodic(?: size (\S+))?$/'
171
+ set_value: '<state> event-history periodic <size>'
117
172
  default_value: 'size_small'
118
173
 
119
174
  fast_external_fallover:
120
175
  kind: boolean
121
- config_get_token_append: '/^(no )?fast-external-fallover$/'
122
- config_set_append: '<state> fast-external-fallover'
123
176
  default_value: true
177
+ ios_xr:
178
+ get_value: 'bgp fast-external-fallover disable'
179
+ set_value: '<state> bgp fast-external-fallover disable'
180
+ nexus:
181
+ get_value: '(no )?fast-external-fallover'
182
+ set_value: '<state> fast-external-fallover'
124
183
 
125
184
  flush_routes:
185
+ _exclude: [ios_xr]
126
186
  kind: boolean
127
- config_get_token_append: '/^flush-routes$/'
128
- config_set_append: '<state> flush-routes'
187
+ get_value: 'flush-routes'
188
+ set_value: '<state> flush-routes'
129
189
  default_value: false
130
190
 
131
191
  graceful_restart:
132
192
  kind: boolean
133
- config_get_token_append: '/^(no )?graceful-restart$/'
134
- config_set_append: '<state> graceful-restart'
135
193
  default_value: true
194
+ ios_xr:
195
+ # Note: Only applies to global BGP; not VRF applicable
196
+ auto_default: false
197
+ get_value: 'bgp graceful-restart'
198
+ set_value: '<state> bgp graceful-restart'
199
+ nexus:
200
+ get_value: '(no )?graceful-restart'
201
+ set_value: '<state> graceful-restart'
136
202
 
137
203
  graceful_restart_helper:
138
- kind: boolean
139
- config_get_token_append: '/^graceful-restart-helper$/'
140
- config_set_append: '<state> graceful-restart-helper'
141
- default_value: false
204
+ # Note: Does not exist in IOS XR
205
+ nexus:
206
+ kind: boolean
207
+ get_value: 'graceful-restart-helper'
208
+ set_value: '<state> graceful-restart-helper'
209
+ default_value: false
142
210
 
143
211
  graceful_restart_timers_restart:
144
212
  kind: int
145
- config_get_token_append: '/^graceful-restart restart-time (\d+)$/'
146
- config_set_append: '<state> graceful-restart restart-time <seconds>'
147
213
  default_value: 120
214
+ ios_xr:
215
+ # Note: Only applies to global BGP; not VRF applicable
216
+ get_value: 'bgp graceful-restart restart-time (\d+)'
217
+ set_value: '<state> bgp graceful-restart restart-time <seconds>'
218
+ nexus:
219
+ get_value: 'graceful-restart restart-time (\d+)'
220
+ set_value: '<state> graceful-restart restart-time <seconds>'
148
221
 
149
222
  graceful_restart_timers_stalepath_time:
150
223
  kind: int
151
- config_get_token_append: '/^graceful-restart stalepath-time (\d+)$/'
152
- config_set_append: '<state> graceful-restart stalepath-time <seconds>'
153
224
  default_value: 300
225
+ ios_xr:
226
+ # Note: Only applies to global BGP; not VRF applicable
227
+ get_value: 'bgp graceful-restart stalepath-time (\d+)'
228
+ set_value: '<state> bgp graceful-restart stalepath-time <seconds>'
229
+ nexus:
230
+ get_value: 'graceful-restart stalepath-time (\d+)'
231
+ set_value: '<state> graceful-restart stalepath-time <seconds>'
154
232
 
155
233
  isolate:
234
+ _exclude: [ios_xr]
156
235
  kind: boolean
157
- config_get_token_append: '/^isolate$/'
158
- config_set_append: '<state> isolate'
236
+ get_value: 'isolate'
237
+ set_value: '<state> isolate'
159
238
  default_value: false
160
239
 
161
240
  log_neighbor_changes:
162
241
  kind: boolean
163
- config_get_token_append: '/^log-neighbor-changes$/'
164
- config_set_append: '<state> log-neighbor-changes'
165
- default_value: false
242
+ ios_xr:
243
+ default_value: true
244
+ get_value: 'bgp log neighbor changes disable'
245
+ set_value: '<state> bgp log neighbor changes disable'
246
+ nexus:
247
+ default_value: false
248
+ get_value: 'log-neighbor-changes'
249
+ set_value: '<state> log-neighbor-changes'
166
250
 
167
251
  maxas_limit:
168
- kind: int
169
- config_get_token_append: '/^maxas-limit (\d+)$/'
170
- config_set_append: '<state> maxas-limit <limit>'
171
- default_value: false
252
+ # Note: Does not exist in IOS XR
253
+ nexus:
254
+ kind: int
255
+ get_value: 'maxas-limit (\d+)'
256
+ set_value: '<state> maxas-limit <limit>'
257
+ default_value: false
172
258
 
173
259
  neighbor_down_fib_accelerate:
174
- _exclude: [/N(5|6|7)/]
260
+ # Note: Does not exist in IOS XR
261
+ _exclude: [ios_xr, N5k, N6k, N7k]
262
+ kind: boolean
263
+ get_value: 'neighbor-down fib-accelerate'
264
+ set_value: '<state> neighbor-down fib-accelerate'
265
+ default_value: false
266
+
267
+ nsr:
268
+ _exclude: [nexus]
175
269
  kind: boolean
176
- config_get_token_append: '/^neighbor-down fib-accelerate$/'
177
- config_set_append: '<state> neighbor-down fib-accelerate'
178
270
  default_value: false
271
+ get_value: '/^nsr$/'
272
+ set_value: '<state> nsr'
273
+
274
+ process_initialized:
275
+ _exclude: [ios_xr, N3k, N7k, N8k, N9k]
276
+ # bgp process initialization state
277
+ kind: boolean
278
+ context: ~
279
+ get_command: "show ip bgp"
280
+ get_value: '/^BGP routing table information/'
179
281
 
180
282
  reconnect_interval:
181
- _exclude: [/N(5|6|7)/]
283
+ _exclude: [ios_xr, N5k, N6k, N7k]
182
284
  kind: int
183
- config_get_token_append: '/^reconnect-interval (\d+)$/'
184
- config_set_append: '<state> reconnect-interval <seconds>'
285
+ get_value: 'reconnect-interval (\d+)'
286
+ set_value: '<state> reconnect-interval <seconds>'
185
287
  default_value: 60
186
288
 
187
289
  route_distinguisher:
188
290
  # This property is also supported by vrf.yaml
189
- config_get_token: ['/^vrf context <vrf>$/i', '/^rd (\S+)$/']
190
- config_set: ["vrf context <vrf>", "<state> rd <rd>"]
191
291
  default_value: ""
292
+ ios_xr:
293
+ get_value: 'rd (\S+)'
294
+ set_value: '<state> rd <rd>'
295
+ nexus:
296
+ context:
297
+ - "vrf context <vrf>"
298
+ get_value: 'rd (\S+)'
299
+ set_value: "<state> rd <rd>"
192
300
 
193
301
  router:
194
- config_get: "show running bgp"
195
- config_get_token: '/^router bgp ([\d.]+)$/'
196
- config_set: "<state> router bgp <asnum>"
302
+ ios_xr:
303
+ get_command: "show running router bgp"
304
+ nexus:
305
+ get_command: "show running bgp"
306
+ context: ~
307
+ get_value: 'router bgp ([\d.]+)'
308
+ set_value: "<state> router bgp <asnum>"
197
309
 
198
310
  router_id:
199
- config_get_token_append: '/^router-id (\S+)$/'
200
- config_set_append: '<state> router-id <id>'
201
311
  default_value: ""
312
+ ios_xr:
313
+ get_value: 'bgp router-id (\S+)'
314
+ set_value: '<state> bgp router-id <id>'
315
+ nexus:
316
+ get_value: 'router-id (\S+)'
317
+ set_value: '<state> router-id <id>'
202
318
 
203
319
  shutdown:
204
- # Shutdown only applies to global bgp
205
- kind: boolean
206
- config_get: "show running bgp"
207
- config_get_token: ['/^router bgp %s$/i', '/^shutdown$/']
208
- config_set: ["router bgp <asnum>", "<state> shutdown"]
209
- default_value: false
320
+ # Note: Does not exist in IOS XR
321
+ nexus:
322
+ # Shutdown only applies to global bgp
323
+ kind: boolean
324
+ get_command: "show running bgp"
325
+ get_context:
326
+ - '/^router bgp %s$/i'
327
+ get_value: 'shutdown'
328
+ set_context:
329
+ - "router bgp <asnum>"
330
+ set_value: "<state> shutdown"
331
+ default_value: false
210
332
 
211
333
  suppress_fib_pending:
212
- kind: boolean
213
- config_get_token_append: '/^suppress-fib-pending$/'
214
- config_set_append: '<state> suppress-fib-pending'
215
- default_value: false
334
+ # Note: Does not exist in IOS XR
335
+ nexus:
336
+ kind: boolean
337
+ get_value: 'suppress-fib-pending'
338
+ set_value: '<state> suppress-fib-pending'
339
+ default_value: false
216
340
 
217
341
  timer_bestpath_limit:
218
- kind: int
219
- config_get_token_append: '/^timers bestpath-limit (\d+)(?: always)?$/'
220
- config_set_append: '<state> timers bestpath-limit <seconds>'
221
- default_value: 300
342
+ # Note: Does not exist in IOS XR
343
+ nexus:
344
+ kind: int
345
+ get_value: 'timers bestpath-limit (\d+)(?: always)?'
346
+ set_value: '<state> timers bestpath-limit <seconds>'
347
+ default_value: 300
222
348
 
223
349
  timer_bestpath_limit_always:
224
- kind: boolean
225
- config_get_token_append: '/^timers bestpath-limit \d+ always$/'
226
- config_set_append: '<state> timers bestpath-limit <seconds> always'
227
- default_value: false
350
+ # Note: Does not exist in IOS XR
351
+ nexus:
352
+ kind: boolean
353
+ get_value: 'timers bestpath-limit \d+ always'
354
+ set_value: '<state> timers bestpath-limit <seconds> always'
355
+ default_value: false
228
356
 
229
357
  timer_bgp_hold:
230
358
  default_value: 180
@@ -233,10 +361,12 @@ timer_bgp_keepalive:
233
361
  default_value: 60
234
362
 
235
363
  timer_bgp_keepalive_hold:
236
- config_get_token_append: '/^timers bgp (\d+) (\d+)$/'
237
- config_set_append: '<state> timers bgp <keepalive> <hold>'
364
+ get_value: 'timers bgp (\d+) (\d+)'
365
+ set_value: '<state> timers bgp <keepalive> <hold>'
238
366
 
239
367
  vrf:
240
368
  multiple: true
241
- config_get_token_append: '/^vrf\s+(\S+)$/'
242
- config_set: ["router bgp <asnum>", "<state> vrf <vrf>", "end"]
369
+ get_value: 'vrf\s+(\S+)'
370
+ set_context:
371
+ - "router bgp <asnum>"
372
+ set_value: "<state> vrf <vrf>"