In this lesson, we will cover:
- What is Genie Conf?
- Using Genie Conf to configure an interface.
- Validating the generated Genie Conf configuration commands.
- Pushing configuration from Genie Conf.
- Rolling back configuration via Genie Conf.
The scripts and code for this lesson can be found within the pyATS repo under the directory:
What is Genie Conf?
In addition to using Genie to Parse, Learn and Diff our network, we can also use Genie to configure our network devices in a vendor-agnostic manner. This is done directly with Python using a set of common methods. The available conf methods and the conf structure are all located within the Genie models; these are the models we previously discussed that also contain the structures used by Ops aka Genie Learn.
Note: The Op/Conf models support the IOS-XR, IOS-XE and NX-OS device types only.
Genie Conf Examples
The documentation for this model can be located here: https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/_models/interface.pdf
First, let's jump into our Genie shell like so and connect to our device.
$ export $(cat .env) $ pyats shell --testbed-file testbeds/testbed.yml ... device_leaf1 = testbed.devices["leaf1-ios"] device_leaf1.connect(log_stdout=False)