cisco_node_utils 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,28 +1,38 @@
1
1
  # interface_channel_group
2
2
  ---
3
3
  _template:
4
- config_get: "show running interface all"
5
- config_get_token: '/^interface <name>$/i'
6
- config_set: 'interface <name>'
4
+ context: ['interface <name>']
5
+ ios_xr:
6
+ get_command: "show running interface"
7
+ nexus:
8
+ get_command: "show running interface all"
7
9
 
8
10
  all_interfaces:
9
11
  multiple:
10
- config_get_token: '/^interface (Ethernet.*)/i'
12
+ get_context: ~
13
+ get_value: '/^interface (Ethernet.*)/i'
11
14
 
12
15
  channel_group:
13
16
  kind: int
14
- config_get_token_append: '/^channel-group (\d+)$/'
15
- config_set_append: '<state> channel-group <group> <force>'
16
17
  default_value: false
18
+ nexus:
19
+ get_value: '/^channel-group (\d+)$/'
20
+ set_value: '<state> channel-group <group> <force>'
21
+ ios_xr:
22
+ get_value: '/^bundle id (\d+).*$/'
23
+ set_value: '<state> bundle id <group>'
17
24
 
18
25
  description:
19
26
  kind: string
20
- config_get_token_append: '/^description (.*)/'
21
- config_set_append: '<state> description <desc>'
27
+ get_value: '/^description (.*)/'
28
+ set_value: '<state> description <desc>'
22
29
  default_value: ''
23
30
 
24
31
  shutdown:
25
32
  kind: boolean
26
- config_get_token_append: '/^(?:no )?shutdown$/'
27
- config_set_append: '<state> shutdown'
28
- default_value: true
33
+ get_value: '/^(?:no )?shutdown$/'
34
+ set_value: '<state> shutdown'
35
+ nexus:
36
+ default_value: true
37
+ ios_xr:
38
+ default_value: false
@@ -1,61 +1,61 @@
1
1
  # interface_ospf
2
2
  ---
3
+ _exclude: [ios_xr]
4
+
3
5
  _template:
4
- config_get: 'show running interface all'
5
- config_get_token: ['/^interface %s$/i']
6
- config_set: ["interface %s"]
6
+ get_command: 'show running interface all'
7
+ context: ["interface %s"]
7
8
 
8
9
  area:
9
- config_get_token_append: ['/^\s*ip router ospf (\S+) area (\S+)/']
10
- config_set_append: ["%s ip router ospf %s area %s"]
10
+ get_value: '/^\s*ip router ospf (\S+) area (\S+)/'
11
+ set_value: "%s ip router ospf %s area %s"
11
12
 
12
13
  cost:
13
14
  kind: int
14
- config_get_token_append: ['/^\s*ip ospf cost (\d+)/']
15
- config_set_append: ["%s ip ospf cost %s"]
15
+ get_value: '/^\s*ip ospf cost (\d+)/'
16
+ set_value: "%s ip ospf cost %s"
16
17
  default_value: 0
17
18
 
18
19
  dead_interval:
19
20
  kind: int
20
- config_get_token_append: ['/^\s*ip ospf dead-interval (\d+)/']
21
- config_set_append: ["%s ip ospf dead-interval %s"]
21
+ get_value: '/^\s*ip ospf dead-interval (\d+)/'
22
+ set_value: "%s ip ospf dead-interval %s"
22
23
  default_value: 40
23
- test_config_result: [262141]
24
24
 
25
25
  hello_interval:
26
26
  kind: int
27
- config_get_token_append: ['/^\s*ip ospf hello-interval (\d+)/']
28
- config_set_append: ["%s ip ospf hello-interval %s"]
27
+ get_value: '/^\s*ip ospf hello-interval (\d+)/'
28
+ set_value: "%s ip ospf hello-interval %s"
29
29
  default_value: 10
30
30
 
31
31
  message_digest:
32
32
  kind: boolean
33
- config_get_token_append: ['/^\s*ip ospf authentication message-digest/']
34
- config_set_append: ["%s ip ospf authentication message-digest"]
33
+ get_value: '/^\s*ip ospf authentication message-digest/'
34
+ set_value: "%s ip ospf authentication message-digest"
35
35
  default_value: false
36
36
 
37
37
  message_digest_alg_type:
38
- config_get_token_append: ['/^\s*ip ospf message-digest-key \d+ (\S+)/']
38
+ get_value: '/^\s*ip ospf message-digest-key \d+ (\S+)/'
39
39
  default_value: 'md5'
40
40
 
41
41
  message_digest_enc_type:
42
- config_get_token_append: ['/^\s*ip ospf message-digest-key \d+ \S+ (\d+)/']
42
+ get_value: '/^\s*ip ospf message-digest-key \d+ \S+ (\d+)/'
43
43
  default_value: '0'
44
44
 
45
45
  message_digest_key_id:
46
46
  kind: int
47
- config_get_token_append: ['/^\s*ip ospf message-digest-key (\d+)/']
47
+ get_value: '/^\s*ip ospf message-digest-key (\d+)/'
48
48
  default_value: 0
49
49
 
50
50
  message_digest_key_set:
51
- config_set_append: ["%s ip ospf message-digest-key %s %s %s %s"]
51
+ set_value: "%s ip ospf message-digest-key %s %s %s %s"
52
52
 
53
53
  message_digest_password:
54
54
  default_value: ~
55
- config_get_token_append: ['/^\s*ip ospf message-digest-key \d+ \S+ \d+ (\S+)/']
55
+ get_value: '/^\s*ip ospf message-digest-key \d+ \S+ \d+ (\S+)/'
56
56
 
57
57
  passive_interface:
58
58
  kind: boolean
59
- config_get_token_append: ['/^\s*ip ospf passive-interface/']
60
- config_set_append: ["%s ip ospf passive-interface"]
59
+ get_value: '/^\s*ip ospf passive-interface/'
60
+ set_value: "%s ip ospf passive-interface"
61
61
  default_value: false
@@ -1,54 +1,63 @@
1
1
  # interface_portchannel
2
2
  ---
3
+ _exclude: [ios_xr]
4
+
3
5
  _template:
4
- config_set: ["interface %s"]
5
- config_get_token: '/^interface %s$/i'
6
- config_get: "show running interface all"
6
+ get_command: "show running interface all"
7
+ get_context: ['/^interface %s$/i']
8
+ set_context: ["interface %s"]
7
9
 
8
10
  create:
9
- config_set: "interface %s"
11
+ set_context: ~
12
+ set_value: "interface %s"
10
13
 
11
14
  destroy:
12
- config_set: "no interface %s"
15
+ set_context: ~
16
+ set_value: "no interface %s"
13
17
 
14
18
  lacp_graceful_convergence:
15
19
  kind: boolean
16
20
  auto_default: false
17
- config_get_token_append: ['/^lacp graceful.convergence$/']
18
- config_set_append: ["%s lacp graceful-convergence"]
21
+ get_value: '/^lacp graceful.convergence$/'
22
+ set_value: "%s lacp graceful-convergence"
19
23
  default_value: true
20
24
 
21
25
  lacp_max_bundle:
22
26
  kind: int
23
- config_get_token_append: ['/^lacp max.bundle (\d+)$/']
24
- config_set_append: ["lacp max-bundle %s"]
25
- /N(3|9)/:
27
+ get_value: '/^lacp max.bundle (\d+)$/'
28
+ set_value: "lacp max-bundle %s"
29
+ N3k: &lacp_max_bundle_32
26
30
  default_value: 32
27
- else:
31
+ N5k: &lacp_max_bundle_16
28
32
  default_value: 16
33
+ N6k: *lacp_max_bundle_16
34
+ N7k: *lacp_max_bundle_16
35
+ N8k: *lacp_max_bundle_32
36
+ N9k: *lacp_max_bundle_32
29
37
 
30
38
  lacp_min_links:
31
39
  kind: int
32
- config_get_token_append: ['/^lacp min.links (\d+)$/']
33
- config_set_append: ["lacp min-links %s"]
40
+ get_value: '/^lacp min.links (\d+)$/'
41
+ set_value: "lacp min-links %s"
34
42
  default_value: 1
35
43
 
36
44
  lacp_suspend_individual:
37
45
  kind: boolean
38
46
  auto_default: false
39
- config_get_token_append: ['/^lacp suspend.individual$/']
40
- config_set_append: ["%s lacp suspend-individual"]
47
+ get_value: '/^lacp suspend.individual$/'
48
+ set_value: "%s lacp suspend-individual"
41
49
  default_value: true
42
50
 
43
51
  port_hash_distribution:
44
- _exclude: [/N6/, /N5/]
45
- config_get_token_append: ['/^port-channel port hash.distribution (.*)$/']
46
- config_set: ["terminal dont-ask", "interface %s", "%s port-channel port hash-distribution %s", "end"]
52
+ _exclude: [N6k, N5k]
53
+ set_context: ['terminal dont-ask', "interface %s"]
54
+ get_value: '/^port-channel port hash.distribution (.*)$/'
55
+ set_value: "%s port-channel port hash-distribution %s"
47
56
  default_value: false
48
57
 
49
58
  port_load_defer:
50
- _exclude: [/N6/, /N5/]
59
+ _exclude: [N6k, N5k]
51
60
  kind: boolean
52
- config_get_token_append: ['/^port-channel port load.defer$/']
53
- config_set_append: ["%s port-channel port load-defer"]
61
+ get_value: '/^port-channel port load.defer$/'
62
+ set_value: "%s port-channel port load-defer"
54
63
  default_value: false
@@ -1,32 +1,37 @@
1
1
  # interface_service_vni
2
2
  ---
3
+ _exclude: [N3k, N5k, N6k, N8k, N9k, ios_xr]
4
+
3
5
  _template:
4
- _exclude: [/N(3|5|6|9)/]
5
- config_get: 'show running interface all'
6
- config_get_token: '/^interface <name>$/i'
7
- config_get_token_append:
6
+ get_command: 'show running interface all'
7
+ get_context:
8
+ - '/^interface <name>$/i'
8
9
  - '/^service instance <sid> vni$/'
9
- config_set: 'interface <name>'
10
- config_set_append:
10
+ set_context:
11
+ - 'interface <name>'
11
12
  - 'service instance <sid> vni'
12
13
 
13
14
  all_service_vni_ids:
14
15
  multiple:
15
- config_get_token_append: '/^service instance (\d+) vni/'
16
+ get_context:
17
+ - '/^interface <name>$/i'
18
+ get_value: '/^service instance (\d+) vni/'
16
19
 
17
20
  create_destroy:
18
- config_set: ['interface <name>', '<state> service instance <sid> vni']
21
+ set_context:
22
+ - 'interface <name>'
23
+ set_value: '<state> service instance <sid> vni'
19
24
 
20
25
  encapsulation_profile_vni:
21
- config_get_token_append: '/encapsulation profile (\S+) default/'
22
- config_set_append: '<state> encapsulation profile <profile> default'
26
+ get_value: '/encapsulation profile (\S+) default/'
27
+ set_value: '<state> encapsulation profile <profile> default'
23
28
  default_value: ''
24
29
 
25
30
  shutdown:
26
- /N7/:
31
+ N7k:
27
32
  kind: boolean
28
- config_get_token_append: '/^(?:no )?shutdown$/'
29
- config_set_append: "<state> shutdown"
33
+ get_value: '/^(?:no )?shutdown$/'
34
+ set_value: "<state> shutdown"
30
35
  default_value: true
31
36
  else:
32
37
  default_value: false
@@ -1,45 +1,40 @@
1
1
  # inventory
2
2
  ---
3
3
  _template:
4
- cli_nexus:
5
- config_get: 'show inventory'
6
- test_config_get: 'show inventory | no-more'
4
+ get_command: 'show inventory'
5
+ ios_xr:
6
+ data_format: cli
7
+ nexus:
8
+ data_format: nxapi_structured
7
9
 
8
10
  all:
9
11
  multiple: true
10
- cli_nexus:
11
- config_get_token: ["TABLE_inv", "ROW_inv"]
12
+ nexus:
13
+ get_context: ["TABLE_inv", "ROW_inv"]
12
14
 
13
15
  chassis:
14
- cli_nexus:
15
- config_get_token: ["TABLE_inv", "ROW_inv", {'name': '"Chassis"'}]
16
-
17
- inventory:
18
- # TODO: clean this up
19
- /N7/:
20
- test_config_get_regex: [
21
- '/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\s+\nPID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/',
22
- '/.*NAME: "(.+)",\s+DESCR: "(.+)"\s+PID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/'
23
- ]
24
- /N9K/:
25
- test_config_get_regex: [
26
- '/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\s+\nPID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/',
27
- '/.*NAME: "(.+)",\s+DESCR: "(.+)"\s+PID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/'
28
- ]
29
- else:
30
- test_config_get_regex: [
31
- '/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\nPID: (\S+)\s+, VID: (.+) , SN: (.+)\n/',
32
- '/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\nPID: (\S+)\s+, VID: (.+) , SN: (.+)\n/'
33
- ]
16
+ nexus:
17
+ # Get all the inventory and we'll filter it down to the chassis
18
+ multiple: true
19
+ get_context: ["TABLE_inv", "ROW_inv"]
34
20
 
35
21
  productid:
36
- cli_nexus:
37
- config_get_token: ["TABLE_inv", "ROW_inv", 0, "productid"]
22
+ ios_xr:
23
+ get_value: '/"Rack 0".*\n.*PID: ([^ ,]+)/'
24
+ nexus:
25
+ get_context: ["TABLE_inv", "ROW_inv", '0']
26
+ get_value: "productid"
38
27
 
39
28
  serialnum:
40
- cli_nexus:
41
- config_get_token: ["TABLE_inv", "ROW_inv", 0, "serialnum"]
29
+ ios_xr:
30
+ get_value: '/"Rack 0".*\n.*SN: ([^ ,]+)/'
31
+ nexus:
32
+ get_context: ["TABLE_inv", "ROW_inv", '0']
33
+ get_value: "serialnum"
42
34
 
43
35
  versionid:
44
- cli_nexus:
45
- config_get_token: ["TABLE_inv", "ROW_inv", 0, "vendorid"]
36
+ ios_xr:
37
+ get_value: '/"Rack 0".*\n.*VID: ([^ ,]+)/'
38
+ nexus:
39
+ get_context: ["TABLE_inv", "ROW_inv", '0']
40
+ get_value: "vendorid"
@@ -0,0 +1,83 @@
1
+ # itd_device_group
2
+ ---
3
+ _exclude: [N3k, N5k, N6k, N8k, ios_xr]
4
+
5
+ _template:
6
+ get_command: "show running-config all | section itd"
7
+ get_context:
8
+ - '/^itd device-group <name>/'
9
+ - '(?)/^node <ntype> <nname>/'
10
+ set_context: ["itd device-group <name>", "(?)node <ntype> <nname>"]
11
+
12
+ all_itd_device_group_nodes:
13
+ multiple:
14
+ get_context: ['/^itd device-group <name>/']
15
+ get_value: '/^node (\S+) (\S+)/'
16
+
17
+ all_itd_device_groups:
18
+ multiple:
19
+ get_context: ~
20
+ get_value: '/^itd device-group (\S+)/'
21
+
22
+ create:
23
+ set_context: ~
24
+ set_value: "itd device-group <name>"
25
+
26
+ create_node:
27
+ set_context: ["itd device-group <name>"]
28
+ set_value: "node <ntype> <nname>"
29
+
30
+ destroy:
31
+ set_context: ~
32
+ set_value: "no itd device-group <name>"
33
+
34
+ destroy_node:
35
+ set_context: ["itd device-group <name>"]
36
+ set_value: "no node <ntype> <nname>"
37
+
38
+ hot_standby:
39
+ kind: boolean
40
+ get_value: '/^mode hot-standby/'
41
+ set_value: "<state> mode hot-standby"
42
+ default_value: false
43
+
44
+ probe:
45
+ get_value: '/^probe .+$/'
46
+ set_value: "probe <type> <dns_host> <port> <control> <frequency> <timeout> <retry_down_count> <retry_up_count>"
47
+
48
+ probe_control:
49
+ kind: boolean
50
+ default_value: false
51
+
52
+ probe_dns_host:
53
+ kind: string
54
+
55
+ probe_frequency:
56
+ kind: int
57
+ default_value: 10
58
+
59
+ probe_port:
60
+ kind: int
61
+
62
+ probe_retry_down:
63
+ kind: int
64
+ default_value: 3
65
+
66
+ probe_retry_up:
67
+ kind: int
68
+ default_value: 3
69
+
70
+ probe_timeout:
71
+ kind: int
72
+ default_value: 5
73
+
74
+ probe_type:
75
+ kind: string
76
+ set_value: "<state> probe icmp"
77
+ default_value: false
78
+
79
+ weight:
80
+ kind: int
81
+ get_value: '/^weight (\d+)/'
82
+ set_value: "<state> weight <weight>"
83
+ default_value: 1
@@ -0,0 +1,119 @@
1
+ # itd_service
2
+ ---
3
+ _exclude: [N3k, N5k, N6k, N8k, ios_xr]
4
+
5
+ _template:
6
+ get_command: "show running-config all | section itd"
7
+ get_context: ['/^itd <name>/']
8
+ set_context: ["itd <name>"]
9
+
10
+ access_list:
11
+ kind: string
12
+ get_value: '/^access-list (\S+)$/'
13
+ set_value: "<state> access-list <al>"
14
+ default_value: ''
15
+
16
+ all_itds:
17
+ multiple:
18
+ get_context: ~
19
+ get_value: '/^itd (\S+)/'
20
+
21
+ create:
22
+ set_context: ~
23
+ set_value: "itd <name>"
24
+
25
+ destroy:
26
+ set_context: ~
27
+ set_value: "no itd <name>"
28
+
29
+ device_group:
30
+ kind: string
31
+ get_value: '/^device-group (\S+)$/'
32
+ set_value: "<state> device-group <dg>"
33
+ default_value: ''
34
+
35
+ exclude_access_list:
36
+ kind: string
37
+ get_value: '/^exclude access-list (\S+)$/'
38
+ set_value: "<state> exclude access-list <al>"
39
+ default_value: ''
40
+
41
+ fail_action:
42
+ kind: boolean
43
+ get_value: '/^failaction node reassign/'
44
+ set_value: "<state> failaction node reassign"
45
+ default_value: false
46
+
47
+ ingress_interface:
48
+ multiple:
49
+ get_value: '/^ingress interface (\S+)(?: next-hop (\S+))*/'
50
+ set_value: "<state> ingress interface <interface> <next> <nhop>"
51
+ default_value: []
52
+
53
+ load_bal_buckets:
54
+ kind: int
55
+ default_value: false
56
+
57
+ load_bal_enable:
58
+ kind: boolean
59
+ default_value: false
60
+
61
+ load_bal_mask_pos:
62
+ kind: int
63
+ default_value: false
64
+
65
+ load_bal_method_bundle_hash:
66
+ kind: string
67
+ default_value: ''
68
+
69
+ load_bal_method_bundle_select:
70
+ kind: string
71
+ default_value: ''
72
+
73
+ load_bal_method_end_port:
74
+ kind: int
75
+ default_value: false
76
+
77
+ load_bal_method_proto:
78
+ kind: string
79
+ default_value: ''
80
+
81
+ load_bal_method_start_port:
82
+ kind: int
83
+ default_value: false
84
+
85
+ load_balance:
86
+ get_value: '/^load-balance .+$/'
87
+ set_value: "<state> load-balance <bundle_select> <bundle_hash> <proto> <start_port> <endPort> <buckets> <mask>"
88
+
89
+ nat_destination:
90
+ _exclude: [N9k]
91
+ kind: boolean
92
+ get_value: '/^nat destination$/'
93
+ set_value: "<state> nat destination"
94
+ default_value: false
95
+
96
+ peer_local:
97
+ _exclude: [N7k]
98
+ get_value: '/^peer local service (\S+)$/'
99
+ set_value: "<state> peer local service <service>"
100
+ default_value: ''
101
+
102
+ peer_vdc:
103
+ _exclude: [N9k]
104
+ get_value: '/^peer vdc (\S+) service (\S+)$/'
105
+ set_value: "<state> peer vdc <vdc> service <service>"
106
+ default_value: []
107
+
108
+ shutdown:
109
+ kind: boolean
110
+ auto_default: true
111
+ get_value: '/^no shut$/'
112
+ set_value: "<state> shutdown"
113
+ default_value: true
114
+
115
+ virtual_ip:
116
+ multiple:
117
+ get_value: '/^virtual (.*)/'
118
+ set_value : "<state> virtual <string>"
119
+ default_value: []