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,164 +1,223 @@
1
1
  # bgp_af.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
- - '/^address-family <afi> <safi>$/'
9
- config_set: "router bgp <asnum>"
10
- config_set_append:
11
- - 'vrf <vrf>'
4
+ context:
5
+ - "router bgp <asnum>"
6
+ - '(?)vrf <vrf>'
12
7
  - 'address-family <afi> <safi>'
8
+ nexus:
9
+ get_command: 'show running bgp all'
10
+ ios_xr:
11
+ get_command: 'show running-config router bgp'
13
12
 
14
13
  additional_paths_install:
14
+ _exclude: [ios_xr, N3k, N8k, N9k]
15
15
  kind: boolean
16
- config_get_token_append: '/^additional-paths install backup$/'
17
- config_set_append: '<state> additional-paths install backup'
16
+ get_value: '/^additional-paths install backup$/'
17
+ set_value: '<state> additional-paths install backup'
18
18
  default_value: false
19
19
 
20
20
  additional_paths_receive:
21
21
  kind: boolean
22
- config_get_token_append: '/^additional-paths receive$/'
23
- config_set_append: '<state> additional-paths receive'
22
+ get_value: '/^additional-paths receive$/'
23
+ set_value: '<state> additional-paths receive'
24
24
  default_value: false
25
25
 
26
26
  additional_paths_selection:
27
27
  kind: string
28
- config_get_token_append: '/^additional-paths selection route-map (.*)$/'
29
- config_set_append: '<state> additional-paths selection route-map <route_map>'
28
+ nexus:
29
+ get_value: '/^additional-paths selection route-map (.*)$/'
30
+ set_value: '<state> additional-paths selection route-map <route_map>'
31
+ ios_xr:
32
+ get_value: '/^additional-paths selection route-policy (.*)$/'
33
+ set_value: '<state> additional-paths selection route-policy <route_policy>'
30
34
  default_value: ""
31
35
 
32
36
  additional_paths_send:
33
37
  kind: boolean
34
- config_get_token_append: '/^additional-paths send$/'
35
- config_set_append: '<state> additional-paths send'
38
+ get_value: '/^additional-paths send$/'
39
+ set_value: '<state> additional-paths send'
36
40
  default_value: false
37
41
 
38
42
  advertise_l2vpn_evpn:
39
- _exclude: [/N(3|6)/]
43
+ _exclude: [ios_xr, N3k, N6k]
40
44
  kind: boolean
41
- config_get_token_append: '/^advertise l2vpn evpn$/'
42
- config_set_append: '<state> advertise l2vpn evpn'
45
+ get_value: '/^advertise l2vpn evpn$/'
46
+ set_value: '<state> advertise l2vpn evpn'
43
47
  default_value: false
44
48
 
45
49
  all_afs:
46
50
  multiple: true
47
- config_get_token_append: '/^address-family (\S+) (\S+)$/'
51
+ context:
52
+ - "router bgp <asnum>"
53
+ - '(?)vrf <vrf>'
54
+ get_value: '/^address-family (\S+) (\S+)$/'
48
55
 
49
56
  client_to_client:
50
57
  kind: boolean
51
- config_get_token_append: '/^(no )?client-to-client reflection$/'
52
- config_set_append: '<state> client-to-client reflection'
53
58
  default_value: true
59
+ nexus:
60
+ get_value: '/^(no )?client-to-client reflection$/'
61
+ set_value: '<state> client-to-client reflection'
62
+ ios_xr:
63
+ get_value: '/^bgp client-to-client reflection disable$/'
64
+ set_value: '<state> bgp client-to-client reflection disable'
54
65
 
55
66
  dampen_igp_metric:
56
- config_get_token_append: '/^(no )?dampen-igp-metric *(\d+)?$/'
57
- config_set_append: '<state> dampen-igp-metric <num>'
67
+ _exclude: [ios_xr]
68
+ get_value: '/^(no )?dampen-igp-metric *(\d+)?$/'
69
+ set_value: '<state> dampen-igp-metric <num>'
58
70
  default_value: 600
59
71
 
60
72
  dampening:
61
73
  auto_default: false
62
- config_get_token_append: '/^dampening(?: (?:(\d+) (\d+) (\d+) (\d+)|route-map (.*)))?$/'
63
- config_set_append: '<state> dampening <route_map> <decay> <reuse> <suppress> <suppress_max>'
64
- default_value: ""
74
+ default_value: ['15', '750', '2000', '45']
75
+ nexus:
76
+ get_value: '/^dampening(?: (?:(\d+) (\d+) (\d+) (\d+)|route-map (.*)))?$/'
77
+ set_value: '<state> dampening <route_map> <decay> <reuse> <suppress> <suppress_max>'
78
+ ios_xr:
79
+ get_value: '/^bgp dampening(?: (?:(\d+) (\d+) (\d+) (\d+)|route-policy (.*)))?$/'
80
+ set_value: '<state> bgp dampening <route_map> <decay> <reuse> <suppress> <suppress_max>'
65
81
 
66
82
  dampening_half_time:
83
+ kind: int
67
84
  default_value: 15
68
85
 
69
86
  dampening_max_suppress_time:
87
+ kind: int
70
88
  default_value: 45
71
89
 
72
90
  dampening_reuse_time:
91
+ kind: int
73
92
  default_value: 750
74
93
 
75
94
  dampening_routemap:
76
95
  default_value: ""
77
96
 
97
+ dampening_routepolicy:
98
+ default_value: ""
99
+
78
100
  dampening_state:
101
+ kind: boolean
79
102
  default_value: true
80
103
 
81
104
  dampening_suppress_time:
105
+ kind: int
82
106
  default_value: 2000
83
107
 
84
- default_information:
108
+ default_information_originate:
109
+ _exclude: [ios_xr]
85
110
  kind: boolean
86
- config_get_token_append: '/^default-information originate$/'
87
- config_set_append: '<state> default-information originate'
88
111
  default_value: false
112
+ get_value: '/^default-information originate$/'
113
+ set_value: '<state> default-information originate'
89
114
 
90
115
  default_metric:
116
+ _exclude: [ios_xr]
91
117
  kind: int
92
- config_get_token_append: '/^default-metric (\d+)$/'
93
- config_set_append: '<state> default-metric <num>'
118
+ get_value: '/^default-metric (\d+)$/'
119
+ set_value: '<state> default-metric <num>'
94
120
  default_value: false
95
121
 
96
122
  distance:
97
- config_get_token_append: '/^distance (\d+) (\d+) (\d+)$/'
98
- config_set_append: '<state> distance <ebgp> <ibgp> <local>'
123
+ default_value: ['20', '200', '220']
124
+ nexus:
125
+ get_value: '/^distance (\d+) (\d+) (\d+)$/'
126
+ set_value: '<state> distance <ebgp> <ibgp> <local>'
127
+ ios_xr:
128
+ get_value: '/^distance bgp (\d+) (\d+) (\d+)$/'
129
+ set_value: '<state> distance bgp <ebgp> <ibgp> <local>'
99
130
 
100
131
  distance_ebgp:
132
+ kind: int
101
133
  default_value: 20
102
134
 
103
135
  distance_ibgp:
136
+ kind: int
104
137
  default_value: 200
105
138
 
106
139
  distance_local:
140
+ kind: int
107
141
  default_value: 220
108
142
 
109
143
  inject_map:
144
+ _exclude: [ios_xr]
110
145
  multiple: true
111
- config_get_token_append: '/^inject-map (\S+) exist-map (\S+) *(copy-attributes)?$/'
112
- config_set_append: '<state> inject-map <inject> exist-map <exist> <copy>'
146
+ get_value: '/^inject-map (\S+) exist-map (\S+) *(copy-attributes)?$/'
147
+ set_value: '<state> inject-map <inject> exist-map <exist> <copy>'
113
148
  default_value: []
114
149
 
115
150
  maximum_paths:
116
151
  kind: int
117
- config_get_token_append: '/^maximum-paths (\d+)$/'
118
- config_set_append: '<state> maximum-paths <num>'
152
+ nexus:
153
+ get_value: '/^maximum-paths (\d+)$/'
154
+ set_value: '<state> maximum-paths <num>'
155
+ ios_xr:
156
+ get_value: '/^maximum-paths ebgp (\d+)$/'
157
+ set_value: '<state> maximum-paths ebgp <num>'
119
158
  default_value: 1
120
159
 
121
160
  maximum_paths_ibgp:
122
161
  kind: int
123
- config_get_token_append: '/^maximum-paths ibgp (\d+)$/'
124
- config_set_append: '<state> maximum-paths ibgp <num>'
162
+ get_value: '/^maximum-paths ibgp (\d+)$/'
163
+ set_value: '<state> maximum-paths ibgp <num>'
125
164
  default_value: 1
126
165
 
127
- network:
166
+ networks:
128
167
  multiple: true
129
- config_get_token_append: '/^network (\S+) ?(?:route-map )?(\S+)?$/'
130
- config_set_append: '<state> network <network> <route_map>'
168
+ nexus:
169
+ get_value: '/^network (\S+) ?(?:route-map )?(\S+)?$/'
170
+ set_value: '<state> network <network> <route_map>'
171
+ ios_xr:
172
+ get_value: '/^network (\S+) ?(?:route-policy )?(\S+)?$/'
173
+ set_value: '<state> network <network> <route_policy>'
131
174
  default_value: []
132
175
 
133
176
  next_hop_route_map:
134
- config_get_token_append: '/^nexthop route-map (.*)$/'
135
- config_set_append: '<state> nexthop route-map <route_map>'
177
+ kind: string
136
178
  default_value: ""
179
+ nexus:
180
+ get_value: '/^nexthop route-map (.*)$/'
181
+ set_value: '<state> nexthop route-map <route_map>'
182
+ ios_xr:
183
+ get_value: '/nexthop route-policy (.*)$/'
184
+ set_value: '<state> nexthop route-policy <route_map>'
137
185
 
138
186
  redistribute:
139
187
  multiple: true
140
- config_get_token_append: '/^redistribute (\S+ ?\S+?) ?(?:route-map (\S+))?$/'
141
- config_set_append: '<state> redistribute <protocol>'
188
+ set_value: '<state> redistribute <protocol>'
189
+ nexus:
190
+ get_value: '/^redistribute (\S+ ?\S+?) ?(?:route-map (\S+))?$/'
191
+ ios_xr:
192
+ get_value: '/^redistribute (\S+ ?\S+?) ?(?:route-policy (\S+))?$/'
142
193
  default_value: []
143
194
 
144
195
  redistribute_policy:
145
- # route-map/policy is optional on some platforms, required on others
146
- config_set_append: '<state> redistribute <protocol> route-map <policy>'
196
+ nexus:
197
+ set_value: '<state> redistribute <protocol> route-map <policy>'
198
+ ios_xr:
199
+ set_value: '<state> redistribute <protocol> route-policy <policy>'
147
200
 
148
201
  suppress_inactive:
202
+ _exclude: [ios_xr]
149
203
  kind: boolean
150
- config_get_token_append: '/^suppress-inactive$/'
151
- config_set_append: '<state> suppress-inactive'
152
204
  default_value: false
205
+ get_value: '/^suppress-inactive$/'
206
+ set_value: '<state> suppress-inactive'
153
207
 
154
208
  table_map:
155
209
  kind: string
156
- config_get_token_append: '/^table-map (\S+)(?: filter)?$/'
157
- config_set_append: '<state> table-map <map>'
158
210
  default_value: ""
211
+ nexus:
212
+ get_value: '/^table-map (\S+)(?: filter)?$/'
213
+ set_value: '<state> table-map <map>'
214
+ ios_xr:
215
+ get_value: '/^table-policy (\S+)$/'
216
+ set_value: '<state> table-policy <map>'
159
217
 
160
218
  table_map_filter:
219
+ _exclude: [ios_xr]
161
220
  kind: boolean
162
- config_get_token_append: '/^table-map \S+ filter$/'
163
- config_set_append: '<state> table-map <map> filter'
164
221
  default_value: false
222
+ get_value: '/^table-map \S+ filter$/'
223
+ set_value: '<state> table-map <map> filter'
@@ -1,112 +1,130 @@
1
1
  # bgp_neighbor.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
- - '/^neighbor <nbr>$/'
9
- config_set: "router bgp <asnum>"
10
- config_set_append:
11
- - "vrf <vrf>"
4
+ ios_xr:
5
+ get_command: "show running router bgp"
6
+ nexus:
7
+ get_command: "show running bgp all"
8
+ context:
9
+ - "router bgp <asnum>"
10
+ - "(?)vrf <vrf>"
12
11
  - "neighbor <nbr>"
13
12
 
14
13
  af:
15
- config_set_append: '<state> address-family <afi> <safi>'
14
+ set_value: '<state> address-family <afi> <safi>'
16
15
 
17
16
  all_neighbors:
18
17
  multiple: true
19
- config_get_token_append: '/^neighbor (\S+)$/'
18
+ context:
19
+ - "router bgp <asnum>"
20
+ - "(?)vrf <vrf>"
21
+ get_value: '/^neighbor (\S+)$/'
20
22
 
21
23
  capability_negotiation:
24
+ _exclude: [ios_xr]
22
25
  auto_default: false
23
26
  kind: boolean
24
- config_get_token_append: '/^dont-capability-negotiate$/'
25
- config_set_append: '<state> dont-capability-negotiate'
27
+ get_value: '/^dont-capability-negotiate$/'
28
+ set_value: '<state> dont-capability-negotiate'
26
29
  default_value: true
27
30
 
28
31
  connected_check:
29
32
  auto_default: false
30
33
  kind: boolean
31
- config_get_token_append: '/^disable-connected-check$/'
32
- config_set_append: '<state> disable-connected-check'
34
+ ios_xr:
35
+ get_value: '/^ignore-connected-check$/'
36
+ set_value: '<state> ignore-connected-check'
37
+ nexus:
38
+ get_value: '/^disable-connected-check$/'
39
+ set_value: '<state> disable-connected-check'
33
40
  default_value: true
34
41
 
35
42
  description:
36
43
  kind: string
37
- config_get_token_append: '/^description (.*)/'
38
- config_set_append: '<state> description <desc>'
44
+ get_value: '/^description (.*)/'
45
+ set_value: '<state> description <desc>'
39
46
  default_value: ""
40
47
 
41
48
  dynamic_capability:
49
+ _exclude: [ios_xr]
42
50
  kind: boolean
43
- config_get_token_append: '/^(no )?dynamic-capability$/'
44
- config_set_append: '<state> dynamic-capability'
51
+ get_value: '/^(no )?dynamic-capability$/'
52
+ set_value: '<state> dynamic-capability'
45
53
  default_value: true
46
54
 
47
55
  ebgp_multihop:
48
56
  auto_default: false
49
- config_get_token_append: '/^ebgp-multihop (\d+)$/'
50
- config_set_append: '<state> ebgp-multihop <ttl>'
57
+ get_value: '/^ebgp-multihop (\d+)$/'
58
+ set_value: '<state> ebgp-multihop <ttl>'
51
59
  default_value: false
52
60
 
53
61
  local_as:
54
- config_get_token_append: '/^local-as (\d*?.?\d+?)$/'
55
- config_set_append: '<state> local-as <local_as>'
62
+ get_value: '/^local-as (\d*?.?\d+?)$/'
63
+ set_value: '<state> local-as <local_as>'
56
64
  default_value: 0
57
65
 
58
66
  log_neighbor_changes:
59
- _exclude: [/N(5|6|7)/]
67
+ _exclude: [ios_xr, N5k, N6k, N7k]
60
68
  multiple: true # not actually, but we get an array of matches
61
69
  auto_default: false
62
- config_get_token_append: '/^log-neighbor-changes\s+??(\S+)?\s+??$/'
63
- config_set_append: '<state> log-neighbor-changes <disable>'
70
+ get_value: '/^log-neighbor-changes\s+??(\S+)?\s+??$/'
71
+ set_value: '<state> log-neighbor-changes <disable>'
64
72
  default_value: "inherit"
65
73
 
66
74
  low_memory_exempt:
75
+ _exclude: [ios_xr]
67
76
  kind: boolean
68
- config_get_token_append: '/^low-memory exempt$/'
69
- config_set_append: '<state> low-memory exempt'
77
+ get_value: '/^low-memory exempt$/'
78
+ set_value: '<state> low-memory exempt'
70
79
  default_value: false
71
80
 
72
81
  maximum_peers:
82
+ _exclude: [ios_xr]
73
83
  kind: int
74
- config_get_token_append: '/^maximum-peers (\d+)$/'
75
- config_set_append: '<state> maximum-peers <num>'
84
+ get_value: '/^maximum-peers (\d+)$/'
85
+ set_value: '<state> maximum-peers <num>'
76
86
  default_value: 0
77
87
 
78
88
  password:
79
- config_get_token_append: '/^password \d+ (\S+)$/'
80
- config_set_append: '<state> password <type> <passwd>'
89
+ ios_xr:
90
+ get_value: '/^password [a-z]+ (\S+)$/'
91
+ nexus:
92
+ get_value: '/^password \d+ (\S+)$/'
93
+ set_value: '<state> password <type> <passwd>'
81
94
  default_value: ""
82
95
 
83
96
  password_type:
84
- kind: int
85
- config_get_token_append: '/^password (\d+)/'
86
- default_value: 0
97
+ kind: string
98
+ ios_xr:
99
+ get_value: '/^password ([a-z]+)/'
100
+ default_value: "clear"
101
+ nexus:
102
+ get_value: '/^password (\d+)/'
103
+ default_value: 0
87
104
 
88
105
  remote_as:
89
- config_get_token_append: '/^remote-as (\d*?.?\d+?)$/'
90
- config_set_append: '<state> remote-as <remote_as>'
106
+ get_value: '/^remote-as (\d*?.?\d+?)$/'
107
+ set_value: '<state> remote-as <remote_as>'
91
108
  default_value: 0
92
109
 
93
110
  remove_private_as:
111
+ _exclude: [ios_xr]
94
112
  multiple: true # not actually, but we get an array of matches
95
113
  auto_default: false
96
- config_get_token_append: '/^remove-private-as\s+??(\S+)?\s+??$/'
97
- config_set_append: '<state> remove-private-as <option>'
114
+ get_value: '/^remove-private-as\s+??(\S+)?\s+??$/'
115
+ set_value: '<state> remove-private-as <option>'
98
116
  default_value: "disable"
99
117
 
100
118
  shutdown:
101
119
  kind: boolean
102
- config_get_token_append: '/^shutdown$/'
103
- config_set_append: '<state> shutdown'
120
+ get_value: '/^shutdown$/'
121
+ set_value: '<state> shutdown'
104
122
  default_value: false
105
123
 
106
124
  suppress_4_byte_as:
107
125
  kind: boolean
108
- config_get_token_append: '/^capability suppress 4-byte-as$/'
109
- config_set_append: '<state> capability suppress 4-byte-as'
126
+ get_value: '/^capability suppress 4-byte-as$/'
127
+ set_value: '<state> capability suppress 4-byte-as'
110
128
  default_value: false
111
129
 
112
130
  timers_holdtime:
@@ -116,16 +134,22 @@ timers_keepalive:
116
134
  default_value: 60
117
135
 
118
136
  timers_keepalive_hold:
119
- config_get_token_append: '/^timers (\d+) (\d+)$/'
120
- config_set_append: '<state> timers <keepalive> <hold>'
121
-
122
- transport_passive_only:
123
- kind: boolean
124
- config_get_token_append: '/^transport connection-mode passive$/'
125
- config_set_append: '<state> transport connection-mode passive'
126
- default_value: false
137
+ get_value: '/^timers (\d+) (\d+)$/'
138
+ set_value: '<state> timers <keepalive> <hold>'
139
+
140
+ transport_passive_mode:
141
+ ios_xr:
142
+ kind: string
143
+ get_value: '/^session-open-mode ([a-z-]+)$/'
144
+ set_value: '<state> session-open-mode <mode>'
145
+ default_value: ''
146
+ nexus:
147
+ kind: boolean
148
+ get_value: '/^transport connection-mode passive$/'
149
+ set_value: '<state> transport connection-mode passive'
150
+ default_value: false
127
151
 
128
152
  update_source:
129
- config_get_token_append: '/^update-source (\S+)$/'
130
- config_set_append: '<state> update-source <interface>'
153
+ get_value: '/^update-source (\S+)$/'
154
+ set_value: '<state> update-source <interface>'
131
155
  default_value: ""