In this lesson, we will cover:
- What is Genie Learn?
- How to run Genie learn the command line.
- How to run Genie learn using Python.
The scripts and code for this lesson can be found within the pyATS repo under the directory: 003_genie/learn/
.
What is Genie Learn?
Genie learn
:
provides a representation of the current operational state of a device, per feature (protocol). It "learns" the operational state by executing a series of commands and parsing the output into a common data structure across different operating systems.
For example, let’s say we want to learn
about OSPF on a Cisco IOS-based device. Genie would collect output from the device (for the following commands), parse the outputs, and aggregate them into a single data structure.
show ip protocols
show ip ospf
show ip ospf mpls ldp interface
show ip ospf mpls trafficeng link
show ip ospf virtuallinks
show ip ospf shamlinks
show ip ospf interface
show ip ospf database topology
show ip ospf database router
show ip ospf database network
show ip ospf database summary
show ip ospf database external
show ip ospf database opaquearea
show ip ospf database opaqueas
show ip ospf database opaquelink
show ip ospf neighbor detail
How does Genie know what commands to use when we perform a learn for a given protocol/feature? Also, what defines how Genie constructs the single data structure from the output of all of the commands? This is achieved via the Genie Ops models. These models map which commands to run for a given protocol/feature and define the Ops structure.