You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+81-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,80 @@
1
1
Changelog
2
2
=========
3
3
4
+
## [v1.3.0]
5
+
6
+
### New feature support
7
+
8
+
#### Cisco Resources
9
+
* Itd
10
+
* itd_device_group (@saichint)
11
+
* itd_device_group_node (@saichint)
12
+
* itd_service (@saichint)
13
+
* Spanning Tree
14
+
* stp_global (@saichint)
15
+
* Bridge Domain
16
+
* bridge_domain (@rkorlepa)
17
+
* bridge_domain_vni (@rkorlepa)
18
+
* Encapsulation Profile
19
+
* vni_encapsulation_profile (@rkorlepa)
20
+
21
+
#### NetDev Resources
22
+
*
23
+
24
+
### Added
25
+
26
+
* Added a new property fabric-control for vlan MT-FULL fabricpath
27
+
* Added support for bdi interfaces to interface provider.
28
+
* Added a new node util to handle bridge domain range cli for member vni
29
+
* Added Bridge Domain, VNI and encapsulation profile node utils for MT-FULL on Nexus 7k.
30
+
* Minitests can declare the YAML feature they are exercising, and if the feature is `_exclude`d on the node under test, the test case will automatically be skipped in full.
31
+
* CliErrors raised by any `NodeUtil` subclass or instance will automatically prepend the `to_s` method output to make troubleshooting easier.
* Extend Feature class with a class method to list feature compatible interfaces
43
+
* Extend vdc with interface_membership methods
44
+
* Extend vpc with vpc+ attributes on Nexus 5k/6k/7k:
45
+
*`fabricpath_emulated_switch_id`
46
+
*`fabricpath_multicast_load_balance` (only on Nexus 7k)
47
+
*`port_channel_limit` (only on Nexus 7k)
48
+
* Extend vlan with attributes:
49
+
*`private_vlan_association`, `private_vlan_type`
50
+
* Added N3k native support for portchannel_global
51
+
52
+
### Changed
53
+
54
+
* Major refactor and enhancement of `CommandReference` YAML files:
55
+
- Filtering by platform is now by platform name only.
56
+
- Replaced `config_get(_token)?(_append)?` with `get_command`, `get_context`, and `get_value`
57
+
- Replaced `config_set(_append)?` with `set_context`, and `set_value`
58
+
- Individual token values can be explicitly marked as optional (e.g., VRF context); tokens not marked as optional are mandatory.
59
+
- Data format (CLI, NXAPI structured) is now assumed to be CLI unless explicitly specified otherwise using the new `(get_|set_)?data_format` YAML key. No more guessing based on whether a key looks like a hash key or a Regexp.
60
+
*`cisco_nxapi` Gem is no longer a dependency as the NXAPI client code has been merged into this Gem under the `Cisco::Client` namespace.
* Client connectivity is now specified in `/etc/cisco_node_utils.yaml` or `~/cisco_node_utils.yaml` instead of environment variables or command-line arguments to minitest.
65
+
-`ruby test_foo.rb -e <node name defined in YAML>`
66
+
-`rake test TESTOPTS='--environment=default'`
67
+
68
+
### Fixed
69
+
70
+
* Interface:
71
+
- Correctly restore IP address when changing VRF membership
72
+
- MTU is not supported on loopback interfaces
73
+
74
+
### Removed
75
+
* Removed `Node.lazy_connect` internal API.
76
+
* Removed `vni` node util class
77
+
4
78
## [v1.2.0]
5
79
6
80
### New feature support
@@ -40,7 +114,7 @@ Changelog
40
114
* vxlan_vtep (@dcheriancisco)
41
115
* vxlan_vtep_vni (@mikewiebe)
42
116
43
-
117
+
44
118
### Additional platform support added to existing classes
45
119
#### Cisco Nexus 56xx, 60xx and 7xxx
46
120
* AAA
@@ -110,7 +184,11 @@ Changelog
110
184
*`vpc_id`, `vpc_peer_link`
111
185
* switchport mode `fabricpath`
112
186
* Extend vrf with attributes:
187
+
*`mhost_ipv4`
188
+
*`mhost_ipv6`
189
+
*`remote_route_filtering`
113
190
*`vni`
191
+
*`vpn_id`
114
192
* Extend vlan with attribute:
115
193
*`mode`
116
194
@@ -119,7 +197,7 @@ Changelog
119
197
* Major refactor and enhancement of `CommandReference` YAML files:
120
198
- Added support for `auto_default`, `default_only`, `kind`, and `multiple`
121
199
- Added filtering by product ID (`/N7K/`) and by client type (`cli_nexus`)
122
-
-`CommandReference` methods that do key-value style wildcard substitution now raise an `ArgumentError` if the result is empty (because not enough parameters were supplied).
200
+
-`CommandReference` methods that do key-value style wildcard substitution now raise an `ArgumentError` if the result is empty (because not enough parameters were supplied).
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+2-17
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,13 @@ Cisco Network Elements support a rich set of features to make networks robust, e
9
9
## Making Changes
10
10
11
11
* Fork and clone the repository
12
-
* Run the `bin/git/update-hooks` script to install our recommended Git hooks into your local repository.
12
+
* Run the `bin/git/update-hooks` script to install our recommended Git hooks into your local repository. (Note: some of the hooks require additional tools, such as the `rubocop` ruby gem, be installed and available in your `$PATH`. See [Ruby Prerequisites](docs/README-develop-node-utils-APIs.md#prereq_ruby) for a list of recommended ruby gems.)
13
13
* Pull a branch under the "develop" branch for your changes.
14
14
* Follow all guidelines documented in [README-develop-node_utils-APIs](docs/README-develop-node-utils-APIs.md)
15
15
* Make changes in your branch.
16
16
* Testing
17
17
* Create a minitest script for any new APIs or new functionality
18
-
* Run all the tests to ensure there was no collateral damage to existing code. There are two ways you can specify the Nexus switch (virtual or physical) to test against when running the full test suite:
19
-
1. Use the NODE environment variable to specify the address, username, and password:
20
-
21
-
```bash
22
-
export NODE="192.168.100.1 user password"
23
-
rake test
24
-
```
25
-
26
-
2. Enter the connection information at runtime:
27
-
28
-
```
29
-
rake test
30
-
Enter address or hostname of node under test: 192.168.100.1
31
-
Enter username for node under test: user
32
-
Enter password for node under test: password
33
-
```
18
+
* Run all the tests to ensure there was no collateral damage to existing code. See [README-test-execution](docs/README-test-execution.md) for details.
34
19
35
20
* Committing
36
21
* Check for unnecessary whitespace with `git diff --check` before committing.
Please note: For Cisco Nexus 3k and 9k platforms, a virtual Nexus N9000/N3000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can obtain a copy of a virtual Nexus N9000/N3000 by sending their [cisco.com](http://cisco.com) user ID in an email to <[email protected]>. 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)
55
52
@@ -64,53 +61,41 @@ To install the CiscoNodeUtils, use the following command:
64
61
Alternatively, if you've checked the source out directly, you can call
65
62
`rake install` from the root project directory.
66
63
67
-
## <aname="examples">Examples</a>
64
+
## Configuration
68
65
66
+
This gem may require configuration in order to be used. Two configuration file locations are supported:
69
67
70
-
These utilities can be used directly on a Cisco device (as used by Puppet
71
-
and Chef) or can run on a workstation and point to a Cisco device (as used
72
-
by the included minitest suite).
68
+
*`/etc/cisco_node_utils.yaml` (system and/or root user configuration)
If both files exist and are readable, configuration in the user-specific file will take precedence over the system configuration.
75
72
76
-
```ruby
77
-
require'cisco_node_utils'
73
+
This file specifies the host, port, username, and/or password to be used to connect to one or more nodes.
78
74
79
-
# get a connection to the local device
80
-
node =Cisco::Node.instance()
81
-
82
-
version = node.config_get("show_version", "system_image")
83
-
84
-
node.config_set("vtp", "domain", "mycompany.com")
85
-
```
86
-
87
-
### Remote usage
88
-
89
-
```ruby
90
-
require'cisco_node_utils'
75
+
* When developing for or testing this gem, this file can specify one or more NX-OS nodes to run tests against. In this case:
76
+
- A node labeled as `default` will be the default node to test against.
77
+
- Nodes with other names can be selected at test execution time.
78
+
- NX-OS nodes must be defined with a `host` (hostname or IP address), `username`, and `password`.
91
79
92
-
Cisco::Node.lazy_connect =true
80
+
An example configuration file (illustrating each of the above scenarios) is provided with this gem at [`docs/cisco_node_utils.yaml.example`](docs/cisco_node_utils.yaml.example).
version = node.config_get("show_version", "system_image")
84
+
### Client
98
85
99
-
node.config_set("vtp", "domain", "mycompany.com")
100
-
```
86
+
The `Client` class provides a low-level interface for communicating with the Cisco network node. It provides the base APIs `create`, `get`, and `set`.
101
87
102
-
## <aname="documentation">Documentation</a>
88
+
*`Cisco::Client::NXAPI` - client for communicating with NX-OS 7.0(3)I2(1) and later, using NX-API.
103
89
90
+
For a greater level of abstraction, the `Node` class is generally used, but the `Client` classes can be invoked directly if desired.
104
91
105
92
### Node
106
93
107
-
The `Node` class is a singleton which provides for management of a given Cisco
108
-
network node. It provides the base APIs `config_set`, `config_get`, and
109
-
`config_get_default`.
94
+
The `Node` class is a singleton which wraps around the `Client` class to provide for management of a given Cisco network node. It provides the base APIs `config_set`, `config_get`, and `config_get_default`.
110
95
111
96
### CommandReference
112
97
113
-
The `CommandReference` class abstracts away the differences between various supported `Node` types, be that API differences (CLI vs. YANG), platform differences (NX-OS vs. IOS XR), or hardware differences (Nexus 9xxx vs. Nexus 3xxx). A series of YAML files describe various `feature` groupings. Each file describes a set of `attributes` of the given feature and the specifics of how to inspect and manage these attributes for any supported `Node` types. When a `Node` is connected, the platform identification of the Node is used to construct a `CommandReference` instance containing a set of `CmdRef` objects specific to this `Node`. The `Node` APIs `config_set`, `config_get`, and `config_get_default` all rely on the `CmdRef`.
98
+
The `CommandReference` class abstracts away the differences between various supported `Node` types, be that API differences (CLI vs. YANG)or hardware differences (Nexus N9k vs. Nexus N3k). A series of YAML files describe various `feature` groupings. Each file describes a set of `attributes` of the given feature and the specifics of how to inspect and manage these attributes for any supported `Node` types. When a `Node` is connected, the platform identification of the Node is used to construct a `CommandReference` instance containing a set of `CmdRef` objects specific to this `Node`. The `Node` APIs `config_set`, `config_get`, and `config_get_default` all rely on the `CmdRef`.
114
99
115
100
See also [README_YAML](lib/cisco_node_utils/cmd_ref/README_YAML.md).
116
101
@@ -132,6 +117,66 @@ code duplication between the Cisco Puppet modules and the Cisco Chef cookbooks.
132
117
Generally speaking, Puppet and Chef should only interact with the feature
133
118
provider classes, and not directly call into `CommandReference` or `Node`.
134
119
120
+
## <aname="examples">Examples</a>
121
+
122
+
123
+
These utilities can be used directly on a Cisco device (as used by Puppet
124
+
and Chef) or can run on a workstation and point to a Cisco device (as used
125
+
by the included minitest suite).
126
+
127
+
### Usage on a Cisco device
128
+
129
+
#### Low-level Client API
130
+
131
+
```ruby
132
+
require'cisco_node_utils'
133
+
134
+
# get a connection to the local device
135
+
client =Cisco::Client.create()
136
+
137
+
client.get(command:'show version')
138
+
client.set(values:'vtp domain mycompany.com')
139
+
```
140
+
141
+
#### High-level Node API
142
+
143
+
```ruby
144
+
require'cisco_node_utils'
145
+
146
+
# get a connection to the local device
147
+
node =Cisco::Node.instance()
148
+
149
+
version = node.config_get("show_version", "system_image")
0 commit comments