cisco_node_utils 1.7.0 → 1.8.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +2 -1
- data/cisco_node_utils.gemspec +1 -0
- data/docs/README-develop-node-utils-APIs.md +2 -1
- data/lib/cisco_node_utils/aaa_authentication_login_service.rb +2 -2
- data/lib/cisco_node_utils/ace.rb +2 -0
- data/lib/cisco_node_utils/bgp.rb +34 -91
- data/lib/cisco_node_utils/bridge_domain.rb +8 -13
- data/lib/cisco_node_utils/client/nxapi/client.rb +10 -3
- data/lib/cisco_node_utils/cmd_ref/DEPRECATED.yaml +12 -12
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +2 -1
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +3 -3
- data/lib/cisco_node_utils/cmd_ref/bgp.yaml +5 -15
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +14 -36
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +5 -3
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +3 -3
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +25 -15
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +5 -0
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +6 -0
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/object_group.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +9 -7
- data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/route_map.yaml +26 -25
- data/lib/cisco_node_utils/cmd_ref/show_version.yaml +11 -3
- data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +4 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +5 -1
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +8 -8
- data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +3 -2
- data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +21 -1
- data/lib/cisco_node_utils/cmd_ref/tacacs_global.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +5 -4
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +9 -9
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +3 -5
- data/lib/cisco_node_utils/command_reference.rb +11 -1
- data/lib/cisco_node_utils/interface.rb +46 -8
- data/lib/cisco_node_utils/interface_ospf.rb +2 -2
- data/lib/cisco_node_utils/interface_portchannel.rb +2 -2
- data/lib/cisco_node_utils/node.rb +9 -0
- data/lib/cisco_node_utils/ntp_auth_key.rb +1 -1
- data/lib/cisco_node_utils/object_group.rb +75 -0
- data/lib/cisco_node_utils/object_group_entry.rb +143 -0
- data/lib/cisco_node_utils/portchannel_global.rb +2 -2
- data/lib/cisco_node_utils/radius_global.rb +25 -1
- data/lib/cisco_node_utils/router_ospf.rb +3 -3
- data/lib/cisco_node_utils/syslog_server.rb +38 -42
- data/lib/cisco_node_utils/syslog_settings.rb +74 -3
- data/lib/cisco_node_utils/tacacs_global.rb +47 -14
- data/lib/cisco_node_utils/tacacs_server.rb +1 -5
- data/lib/cisco_node_utils/version.rb +1 -1
- data/lib/cisco_node_utils/vpc.rb +1 -4
- data/lib/cisco_node_utils/vtp.rb +4 -2
- data/spec/schema.yaml +3 -0
- data/tests/ciscotest.rb +16 -9
- data/tests/test_ace.rb +2 -0
- data/tests/test_bgp_af.rb +10 -2
- data/tests/test_bgp_neighbor_af.rb +6 -2
- data/tests/test_bridge_domain.rb +7 -0
- data/tests/test_feature.rb +2 -2
- data/tests/test_interface.rb +30 -4
- data/tests/test_node_ext.rb +2 -2
- data/tests/test_object_group.rb +122 -0
- data/tests/test_platform.rb +1 -1
- data/tests/test_portchannel_global.rb +1 -0
- data/tests/test_radius_global.rb +22 -2
- data/tests/test_route_map.rb +11 -8
- data/tests/test_router_bgp.rb +7 -132
- data/tests/test_router_ospf_area.rb +6 -6
- data/tests/test_snmpuser.rb +19 -11
- data/tests/test_syslog_server.rb +11 -31
- data/tests/test_syslog_settings.rb +46 -5
- data/tests/test_tacacs_global.rb +42 -18
- data/tests/test_vpc.rb +3 -0
- data/tests/test_vxlan_vtep_vni.rb +0 -3
- data/tests/yum_package.yaml +5 -0
- metadata +21 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 860be08b4fe2ad44a4d30cdb948b67eb57c1c169
|
|
4
|
+
data.tar.gz: a3ba4f0c7e0a365cb084ce05ad9d904d8c2f32d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f83cde3f3b6b2d45059cf3f164d908b4a35b08897589e7a171b31d072907e9b34b0667be9888bacc625ff533b2c4abb0b77c294c6b9802aa53ef6505e71933c5
|
|
7
|
+
data.tar.gz: 104ad9a0af48d17a0bef176f49d8e1c16d86d0f6e902fb98885a9678f8fc917889a6de18f5519a1b3cc834b5872323250ed30bafd57d5e588fef6e663347c653
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [v1.8.0]
|
|
5
|
+
|
|
6
|
+
#### Cisco Resources
|
|
7
|
+
* ObjectGroup
|
|
8
|
+
* object_group (@saichint)
|
|
9
|
+
* object_group_entry (@saichint)
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
* Extend syslog_server with attributes:
|
|
13
|
+
* `port`
|
|
14
|
+
* Extend syslog_settings with attributes:
|
|
15
|
+
* `console`
|
|
16
|
+
* `monitor`
|
|
17
|
+
* `source_interface`
|
|
18
|
+
* Extend radius_global with attributes:
|
|
19
|
+
* `source_interface`
|
|
20
|
+
* Extend tacacs_global with attributes:
|
|
21
|
+
* `source_interface`
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
* syslog_server initialize now uses options hash
|
|
25
|
+
* Prior to this release syslog_server accepted positional arguments for name,
|
|
26
|
+
level, and vrf. New behavior is to pass attributes as a hash.
|
|
27
|
+
|
|
28
|
+
Example:
|
|
29
|
+
```
|
|
30
|
+
options = { 'name' => '1.1.1.1', 'level' => '4', 'port' => '2154',
|
|
31
|
+
'vrf' => 'red' }
|
|
32
|
+
Cisco::SyslogServer.new(options, true)
|
|
33
|
+
```
|
|
34
|
+
* tacacs_global key removal fixed
|
|
35
|
+
* Prior to this release key removal was done by passing in a value of 8. A
|
|
36
|
+
nil value is now used. Added intelligence to determine key format
|
|
37
|
+
automatically for removal.
|
|
38
|
+
|
|
4
39
|
## [v1.7.0]
|
|
5
40
|
|
|
6
41
|
### New feature support
|
|
@@ -478,6 +513,7 @@ Changelog
|
|
|
478
513
|
[git-flow]: https://github.com/petervanderdoes/gitflow-avh
|
|
479
514
|
[SimpleCov]: https://github.com/colszowka/simplecov
|
|
480
515
|
|
|
516
|
+
[v1.8.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.7.0...v1.8.0
|
|
481
517
|
[v1.7.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.6.0...v1.7.0
|
|
482
518
|
[v1.6.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.5.0...v1.6.0
|
|
483
519
|
[v1.5.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.4.1...v1.5.0
|
data/CONTRIBUTING.md
CHANGED
|
@@ -4,7 +4,7 @@ Cisco Network Elements support a rich set of features to make networks robust, e
|
|
|
4
4
|
## Getting Started
|
|
5
5
|
|
|
6
6
|
* Create a [GitHub account](https://github.com/signup/free)
|
|
7
|
-
*
|
|
7
|
+
* Please note: For Cisco Nexus 9k platforms, a virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
|
|
8
8
|
|
|
9
9
|
## Making Changes
|
|
10
10
|
|
|
@@ -40,4 +40,4 @@ git config --global user.email johndoe@example.com
|
|
|
40
40
|
# Additional Resources
|
|
41
41
|
|
|
42
42
|
* [General GitHub documentation](http://help.github.com/)
|
|
43
|
-
* [GitHub pull request documentation](
|
|
43
|
+
* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
|
data/README.md
CHANGED
|
@@ -44,12 +44,13 @@ Platform | OS | OS Version |
|
|
|
44
44
|
------------------|--------|----------------------|
|
|
45
45
|
Cisco Nexus N9k | NX-OS | 7.0(3)I2(1) and later
|
|
46
46
|
Cisco Nexus N3k | NX-OS | 7.0(3)I2(1) and later
|
|
47
|
+
Cisco Nexus N3K-F | NX-OS | 7.0(3)F3(2) and later
|
|
47
48
|
Cisco Nexus N5k | NX-OS | 7.3(0)N1(1) and later
|
|
48
49
|
Cisco Nexus N6k | NX-OS | 7.3(0)N1(1) and later
|
|
49
50
|
Cisco Nexus N7k | NX-OS | 7.3(0)D1(1) and later
|
|
50
51
|
Cisco Nexus N9K-F | NX-OS | 7.0(3)F1(1) and later
|
|
51
52
|
|
|
52
|
-
Please note: For Cisco Nexus
|
|
53
|
+
Please note: For Cisco Nexus 9k platforms, a virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
|
|
53
54
|
|
|
54
55
|
## <a name="installation">Installation</a>
|
|
55
56
|
|
data/cisco_node_utils.gemspec
CHANGED
|
@@ -31,6 +31,7 @@ Currently supports NX-OS nodes.
|
|
|
31
31
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
|
32
32
|
spec.add_development_dependency 'kwalify', '~> 0.7.2'
|
|
33
33
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
|
34
|
+
spec.add_development_dependency 'net-telnet', '~> 0.1.1'
|
|
34
35
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
35
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
36
37
|
spec.add_development_dependency 'rubocop', '= 0.35.1'
|
|
@@ -70,7 +70,8 @@ fi
|
|
|
70
70
|
|
|
71
71
|
### <a name="prereq_vm">Nexus VM (optional)</a>
|
|
72
72
|
|
|
73
|
-
A virtual Nexus N9000
|
|
73
|
+
A virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
|
|
74
|
+
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
## <a name="clone">Start here: Fork and Clone the Repo</a>
|
|
@@ -58,8 +58,8 @@ module Cisco
|
|
|
58
58
|
if g_str.empty?
|
|
59
59
|
# cannot remove default local, so do nothing in this case
|
|
60
60
|
unless m == :local
|
|
61
|
-
unless node.product_id[/
|
|
62
|
-
# TBD: These 'no' commands currently error on
|
|
61
|
+
unless node.product_id[/N(3|9)K-F/]
|
|
62
|
+
# TBD: These 'no' commands currently error on N(3|9)K-F
|
|
63
63
|
# no aaa authentication login console local
|
|
64
64
|
# no aaa authentication login console none
|
|
65
65
|
config_set('aaa_auth_login_service', 'method',
|
data/lib/cisco_node_utils/ace.rb
CHANGED
|
@@ -235,6 +235,7 @@ module Cisco
|
|
|
235
235
|
|
|
236
236
|
def established
|
|
237
237
|
match = ace_get
|
|
238
|
+
return nil unless remark.nil?
|
|
238
239
|
return false if match.nil?
|
|
239
240
|
return false unless match.names.include?('established')
|
|
240
241
|
match[:established] == 'established' ? true : false
|
|
@@ -318,6 +319,7 @@ module Cisco
|
|
|
318
319
|
|
|
319
320
|
def log
|
|
320
321
|
match = ace_get
|
|
322
|
+
return nil unless remark.nil?
|
|
321
323
|
return false if match.nil?
|
|
322
324
|
return false unless match.names.include?('log')
|
|
323
325
|
match[:log] == 'log' ? true : false
|
data/lib/cisco_node_utils/bgp.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# June 2015, Michael G Wiebe
|
|
2
2
|
#
|
|
3
|
-
# Copyright (c) 2015-
|
|
3
|
+
# Copyright (c) 2015-2017 Cisco and/or its affiliates.
|
|
4
4
|
#
|
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
# you may not use this file except in compliance with the License.
|
|
@@ -56,9 +56,9 @@ module Cisco
|
|
|
56
56
|
end
|
|
57
57
|
hash_final.merge!(hash_tmp)
|
|
58
58
|
return hash_final
|
|
59
|
-
rescue Cisco::CliError
|
|
60
|
-
# cmd will
|
|
61
|
-
raise
|
|
59
|
+
rescue Cisco::CliError
|
|
60
|
+
# cmd will error when feature 'bgp' is not enabled
|
|
61
|
+
raise if Feature.bgp_enabled?
|
|
62
62
|
return {}
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -414,14 +414,11 @@ module Cisco
|
|
|
414
414
|
# Nvgen as True With optional 'size <size>
|
|
415
415
|
def event_history_cli
|
|
416
416
|
match = config_get('bgp', 'event_history_cli', @get_args)
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
end
|
|
423
|
-
end
|
|
424
|
-
default_event_history_cli
|
|
417
|
+
return unless match.is_a?(Array)
|
|
418
|
+
return 'false' if match[0] == 'no '
|
|
419
|
+
return unless match[1]
|
|
420
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
421
|
+
'size_' + match[1]
|
|
425
422
|
end
|
|
426
423
|
|
|
427
424
|
def event_history_cli=(val)
|
|
@@ -432,23 +429,15 @@ module Cisco
|
|
|
432
429
|
set_args_keys_default
|
|
433
430
|
end
|
|
434
431
|
|
|
435
|
-
def default_event_history_cli
|
|
436
|
-
config_get_default('bgp', 'event_history_cli')
|
|
437
|
-
end
|
|
438
|
-
|
|
439
432
|
# event-history detail [ size <size> ]
|
|
440
433
|
# Nvgen as True With optional 'size <size>
|
|
441
434
|
def event_history_detail
|
|
442
435
|
match = config_get('bgp', 'event_history_detail', @get_args)
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
end
|
|
449
|
-
return 'true'
|
|
450
|
-
end
|
|
451
|
-
default_event_history_detail
|
|
436
|
+
return unless match.is_a?(Array)
|
|
437
|
+
return 'false' if match[0] == 'no '
|
|
438
|
+
return 'true' unless match[1]
|
|
439
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
440
|
+
'size_' + match[1]
|
|
452
441
|
end
|
|
453
442
|
|
|
454
443
|
def event_history_detail=(val)
|
|
@@ -459,22 +448,15 @@ module Cisco
|
|
|
459
448
|
set_args_keys_default
|
|
460
449
|
end
|
|
461
450
|
|
|
462
|
-
def default_event_history_detail
|
|
463
|
-
config_get_default('bgp', 'event_history_detail')
|
|
464
|
-
end
|
|
465
|
-
|
|
466
451
|
# event-history errors [ size <size> ]
|
|
467
452
|
# Nvgen as True With optional 'size <size>
|
|
468
453
|
def event_history_errors
|
|
469
454
|
match = config_get('bgp', 'event_history_errors', @get_args)
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
end
|
|
476
|
-
end
|
|
477
|
-
default_event_history_errors
|
|
455
|
+
return unless match.is_a?(Array)
|
|
456
|
+
return 'false' if match[0] == 'no '
|
|
457
|
+
return unless match[1]
|
|
458
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
459
|
+
'size_' + match[1]
|
|
478
460
|
end
|
|
479
461
|
|
|
480
462
|
def event_history_errors=(val)
|
|
@@ -485,22 +467,15 @@ module Cisco
|
|
|
485
467
|
set_args_keys_default
|
|
486
468
|
end
|
|
487
469
|
|
|
488
|
-
def default_event_history_errors
|
|
489
|
-
config_get_default('bgp', 'event_history_errors')
|
|
490
|
-
end
|
|
491
|
-
|
|
492
470
|
# event-history events [ size <size> ]
|
|
493
471
|
# Nvgen as True With optional 'size <size>
|
|
494
472
|
def event_history_events
|
|
495
473
|
match = config_get('bgp', 'event_history_events', @get_args)
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
end
|
|
502
|
-
end
|
|
503
|
-
default_event_history_events
|
|
474
|
+
return unless match.is_a?(Array)
|
|
475
|
+
return 'false' if match[0] == 'no '
|
|
476
|
+
return unless match[1]
|
|
477
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
478
|
+
'size_' + match[1]
|
|
504
479
|
end
|
|
505
480
|
|
|
506
481
|
def event_history_events=(val)
|
|
@@ -511,28 +486,15 @@ module Cisco
|
|
|
511
486
|
set_args_keys_default
|
|
512
487
|
end
|
|
513
488
|
|
|
514
|
-
def default_event_history_events
|
|
515
|
-
if Utils.image_version?(/7.0.3.I2|I3|I4/) ||
|
|
516
|
-
node.product_id[/(N5|N6|N7|N9.*-F)/]
|
|
517
|
-
config_get_default('bgp', 'event_history_events')
|
|
518
|
-
else
|
|
519
|
-
config_get('bgp', 'event_history_events_bytes', @get_args)
|
|
520
|
-
end
|
|
521
|
-
end
|
|
522
|
-
|
|
523
489
|
# event-history objstore [ size <size> ]
|
|
524
490
|
# Nvgen as True With optional 'size <size>
|
|
525
491
|
def event_history_objstore
|
|
526
492
|
match = config_get('bgp', 'event_history_objstore', @get_args)
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
end
|
|
533
|
-
return 'true'
|
|
534
|
-
end
|
|
535
|
-
default_event_history_objstore
|
|
493
|
+
return unless match.is_a?(Array)
|
|
494
|
+
return 'false' if match[0] == 'no '
|
|
495
|
+
return 'true' unless match[1]
|
|
496
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
497
|
+
'size_' + match[1]
|
|
536
498
|
end
|
|
537
499
|
|
|
538
500
|
def event_history_objstore=(val)
|
|
@@ -543,25 +505,15 @@ module Cisco
|
|
|
543
505
|
set_args_keys_default
|
|
544
506
|
end
|
|
545
507
|
|
|
546
|
-
def default_event_history_objstore
|
|
547
|
-
config_get_default('bgp', 'event_history_objstore')
|
|
548
|
-
end
|
|
549
|
-
|
|
550
508
|
# event-history periodic [ size <size> ]
|
|
551
509
|
# Nvgen as True With optional 'size <size>
|
|
552
510
|
def event_history_periodic
|
|
553
511
|
match = config_get('bgp', 'event_history_periodic', @get_args)
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
end
|
|
560
|
-
else
|
|
561
|
-
return default_event_history_periodic
|
|
562
|
-
end
|
|
563
|
-
return 'true' unless default_event_history_periodic[/size/]
|
|
564
|
-
default_event_history_periodic
|
|
512
|
+
return unless match.is_a?(Array)
|
|
513
|
+
return 'false' if match[0] == 'no '
|
|
514
|
+
return unless match[1]
|
|
515
|
+
return match[1] if match[1][/\A\d+\z/]
|
|
516
|
+
'size_' + match[1]
|
|
565
517
|
end
|
|
566
518
|
|
|
567
519
|
def event_history_periodic=(val)
|
|
@@ -572,15 +524,6 @@ module Cisco
|
|
|
572
524
|
set_args_keys_default
|
|
573
525
|
end
|
|
574
526
|
|
|
575
|
-
def default_event_history_periodic
|
|
576
|
-
if Utils.image_version?(/7.0.3.I2|I3|I4/) ||
|
|
577
|
-
node.product_id[/(N5|N6|N7|N9.*-F)/]
|
|
578
|
-
config_get_default('bgp', 'event_history_periodic')
|
|
579
|
-
else
|
|
580
|
-
config_get('bgp', 'event_history_periodic_bytes', @get_args)
|
|
581
|
-
end
|
|
582
|
-
end
|
|
583
|
-
|
|
584
527
|
# Fast External fallover (Getter/Setter/Default)
|
|
585
528
|
def fast_external_fallover
|
|
586
529
|
config_get('bgp', 'fast_external_fallover', @get_args)
|
|
@@ -124,30 +124,27 @@ module Cisco
|
|
|
124
124
|
# PROPERTIES #
|
|
125
125
|
########################################################
|
|
126
126
|
|
|
127
|
-
# Bridge-Domain name assigning case
|
|
128
|
-
# bridge-domain 100
|
|
129
|
-
# name bd100
|
|
130
127
|
def bd_name
|
|
131
128
|
config_get('bridge_domain', 'bd_name', bd: @bd_ids)
|
|
132
129
|
end
|
|
133
130
|
|
|
134
131
|
def bd_name=(str)
|
|
135
|
-
str = str.to_s
|
|
136
132
|
state = str.empty? ? 'no' : ''
|
|
137
133
|
config_set('bridge_domain', 'bd_name', bd: @bd_ids, state: state,
|
|
138
134
|
name: str)
|
|
139
135
|
end
|
|
140
136
|
|
|
137
|
+
# This default getter is a bit different them most. When a brige-domain
|
|
138
|
+
# gets created it gets a default name assigned that follows the pattern
|
|
139
|
+
# 'Bridge-DomainX' where X is the bridge domain id (@bd_ids).
|
|
141
140
|
def default_bd_name
|
|
142
|
-
|
|
141
|
+
'Bridge-Domain' + @bd_ids
|
|
143
142
|
end
|
|
144
143
|
|
|
145
|
-
# Bridge-Domain type change to fabric-control
|
|
146
|
-
# bridge-domain 100
|
|
147
|
-
# fabric-control
|
|
148
144
|
# This type property can be defined only for one bd
|
|
149
145
|
def fabric_control
|
|
150
|
-
config_get('bridge_domain', 'fabric_control', bd: @bd_ids)
|
|
146
|
+
match = config_get('bridge_domain', 'fabric_control', bd: @bd_ids)
|
|
147
|
+
match == @bd_ids ? true : false
|
|
151
148
|
end
|
|
152
149
|
|
|
153
150
|
def fabric_control=(val)
|
|
@@ -159,11 +156,9 @@ module Cisco
|
|
|
159
156
|
config_get_default('bridge_domain', 'fabric_control')
|
|
160
157
|
end
|
|
161
158
|
|
|
162
|
-
# Bridge-Domain Shutdown case
|
|
163
|
-
# bridge-domain 100
|
|
164
|
-
# shutdown
|
|
165
159
|
def shutdown
|
|
166
|
-
config_get('bridge_domain', 'shutdown', bd: @bd_ids)
|
|
160
|
+
match = config_get('bridge_domain', 'shutdown', bd: @bd_ids)
|
|
161
|
+
match == 'Noshutdown' ? false : true
|
|
167
162
|
end
|
|
168
163
|
|
|
169
164
|
def shutdown=(val)
|
|
@@ -67,9 +67,6 @@ class Cisco::Client::NXAPI < Cisco::Client
|
|
|
67
67
|
# also used as the default config by firefox.
|
|
68
68
|
@http.read_timeout = 300
|
|
69
69
|
@address = @http.address
|
|
70
|
-
|
|
71
|
-
# Make sure we can actually connect to the socket
|
|
72
|
-
get(command: 'show hostname')
|
|
73
70
|
end
|
|
74
71
|
|
|
75
72
|
def self.validate_args(**kwargs)
|
|
@@ -167,6 +164,15 @@ class Cisco::Client::NXAPI < Cisco::Client
|
|
|
167
164
|
end
|
|
168
165
|
end
|
|
169
166
|
|
|
167
|
+
# Helper method to increase the default @http.read_timeout value from
|
|
168
|
+
# the default value of 300 to accomodate commands that are known to
|
|
169
|
+
# require more time to complete.
|
|
170
|
+
def read_timeout_check(request)
|
|
171
|
+
return unless request.body[/install all|install force-all/]
|
|
172
|
+
debug("Increasing http read_timeout to 1000 for 'install all' command")
|
|
173
|
+
@http.read_timeout = 1000
|
|
174
|
+
end
|
|
175
|
+
|
|
170
176
|
# Sends a request to the NX API and returns the body of the request or
|
|
171
177
|
# handles errors that happen.
|
|
172
178
|
# @raise Cisco::ConnectionRefused if NXAPI is disabled
|
|
@@ -201,6 +207,7 @@ class Cisco::Client::NXAPI < Cisco::Client
|
|
|
201
207
|
# send the request and get the response
|
|
202
208
|
debug("Sending HTTP request to NX-API at #{@http.address}:\n" \
|
|
203
209
|
"#{request.to_hash}\n#{request.body}")
|
|
210
|
+
read_timeout_check(request)
|
|
204
211
|
tries = 2
|
|
205
212
|
begin
|
|
206
213
|
# Explicitly use http to avoid EOFError
|
|
@@ -17,7 +17,7 @@ private_vlan_any:
|
|
|
17
17
|
|
|
18
18
|
private_vlan_association:
|
|
19
19
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'pvlan_association'
|
|
20
|
-
_exclude: [N9k-F]
|
|
20
|
+
_exclude: [N3k-F, N9k-F]
|
|
21
21
|
multiple: true
|
|
22
22
|
get_command: "show vlan private-vlan"
|
|
23
23
|
get_context: ~
|
|
@@ -28,7 +28,7 @@ private_vlan_association:
|
|
|
28
28
|
|
|
29
29
|
private_vlan_mapping:
|
|
30
30
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'pvlan_mapping'
|
|
31
|
-
_exclude: [ios_xr, N9k-F]
|
|
31
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
32
32
|
multiple: true
|
|
33
33
|
get_value: '/^private-vlan mapping (.*)$/'
|
|
34
34
|
set_value: "<state> private-vlan mapping <vlans>"
|
|
@@ -36,7 +36,7 @@ private_vlan_mapping:
|
|
|
36
36
|
|
|
37
37
|
private_vlan_type:
|
|
38
38
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'pvlan_type'
|
|
39
|
-
_exclude: [N9k-F]
|
|
39
|
+
_exclude: [N3k-F, N9k-F]
|
|
40
40
|
kind: string
|
|
41
41
|
get_command: 'show vlan private-vlan type'
|
|
42
42
|
get_context: ~
|
|
@@ -47,14 +47,14 @@ private_vlan_type:
|
|
|
47
47
|
|
|
48
48
|
switchport_mode_private_vlan_host:
|
|
49
49
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_host'
|
|
50
|
-
_exclude: [ios_xr, N9k-F]
|
|
50
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
51
51
|
get_value: '/^switchport mode private-vlan (.*)$/'
|
|
52
52
|
set_value: "<state> switchport mode private-vlan <mode>"
|
|
53
53
|
default_value: :disabled
|
|
54
54
|
|
|
55
55
|
switchport_mode_private_vlan_host_association:
|
|
56
56
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_host_association'
|
|
57
|
-
_exclude: [ios_xr, N9k-F]
|
|
57
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
58
58
|
multiple: true
|
|
59
59
|
get_value: '/^switchport private-vlan host-association (.*)$/'
|
|
60
60
|
set_value: "<state> switchport private-vlan host-association <vlan_pr> <vlan_sec>"
|
|
@@ -62,7 +62,7 @@ switchport_mode_private_vlan_host_association:
|
|
|
62
62
|
|
|
63
63
|
switchport_mode_private_vlan_host_promiscous:
|
|
64
64
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_promiscuous'
|
|
65
|
-
_exclude: [ios_xr, N9k-F]
|
|
65
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
66
66
|
multiple: true
|
|
67
67
|
get_value: '/^switchport private-vlan mapping (\d+.*)$/'
|
|
68
68
|
set_value: "<state> switchport private-vlan mapping <vlan_pr> <vlans>"
|
|
@@ -70,7 +70,7 @@ switchport_mode_private_vlan_host_promiscous:
|
|
|
70
70
|
|
|
71
71
|
switchport_mode_private_vlan_trunk_promiscuous:
|
|
72
72
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_trunk_promiscuous'
|
|
73
|
-
_exclude: [ios_xr, N3k, N9k-F]
|
|
73
|
+
_exclude: [ios_xr, N3k, N3k-F, N9k-F]
|
|
74
74
|
kind: boolean
|
|
75
75
|
get_value: '/^switchport mode private-vlan trunk promiscuous$/'
|
|
76
76
|
set_value: "<state> switchport mode private-vlan trunk promiscuous"
|
|
@@ -78,7 +78,7 @@ switchport_mode_private_vlan_trunk_promiscuous:
|
|
|
78
78
|
|
|
79
79
|
switchport_mode_private_vlan_trunk_secondary:
|
|
80
80
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_trunk_secondary'
|
|
81
|
-
_exclude: [ios_xr, N3k, N9k-F]
|
|
81
|
+
_exclude: [ios_xr, N3k, N3k-F, N9k-F]
|
|
82
82
|
kind: boolean
|
|
83
83
|
get_value: '/^switchport mode private-vlan trunk secondary$/'
|
|
84
84
|
set_value: "<state> switchport mode private-vlan trunk secondary"
|
|
@@ -86,7 +86,7 @@ switchport_mode_private_vlan_trunk_secondary:
|
|
|
86
86
|
|
|
87
87
|
switchport_private_vlan_association_trunk:
|
|
88
88
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_trunk_association'
|
|
89
|
-
_exclude: [ios_xr, N3k, N9k-F]
|
|
89
|
+
_exclude: [ios_xr, N3k, N3k-F, N9k-F]
|
|
90
90
|
multiple: true
|
|
91
91
|
#get_value: '/^switchport private-vlan association trunk (.*) (.*)$/'
|
|
92
92
|
get_value: '/^switchport private-vlan association trunk (.*)$/'
|
|
@@ -95,7 +95,7 @@ switchport_private_vlan_association_trunk:
|
|
|
95
95
|
|
|
96
96
|
switchport_private_vlan_mapping_trunk:
|
|
97
97
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_mapping_trunk'
|
|
98
|
-
_exclude: [ios_xr, N3k, N9k-F]
|
|
98
|
+
_exclude: [ios_xr, N3k, N3k-F, N9k-F]
|
|
99
99
|
multiple: true
|
|
100
100
|
get_value: '/^switchport private-vlan mapping trunk (.*)$/'
|
|
101
101
|
set_value: "<state> switchport private-vlan mapping trunk <vlan_pr> <vlans>"
|
|
@@ -103,7 +103,7 @@ switchport_private_vlan_mapping_trunk:
|
|
|
103
103
|
|
|
104
104
|
switchport_private_vlan_trunk_allowed_vlan:
|
|
105
105
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_trunk_allowed_vlan'
|
|
106
|
-
_exclude: [ios_xr, N9k-F]
|
|
106
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
107
107
|
multiple: true
|
|
108
108
|
get_value: '/^switchport private-vlan trunk allowed vlan (.*)$/'
|
|
109
109
|
set_value: "<state> switchport private-vlan trunk allowed vlan <oper> <vlans>"
|
|
@@ -111,7 +111,7 @@ switchport_private_vlan_trunk_allowed_vlan:
|
|
|
111
111
|
|
|
112
112
|
switchport_private_vlan_trunk_native_vlan:
|
|
113
113
|
# DEPRECATED (REMOVING WITH RELEASE 2.0.0). USE 'switchport_pvlan_trunk_native_vlan'
|
|
114
|
-
_exclude: [ios_xr, N9k-F]
|
|
114
|
+
_exclude: [ios_xr, N3k-F, N9k-F]
|
|
115
115
|
kind: int
|
|
116
116
|
get_value: '/^switchport private-vlan trunk native vlan (.*)$/'
|
|
117
117
|
set_value: "<state> switchport private-vlan trunk native vlan <vlan>"
|