Topic: tech juniper ijaut prev next
tech juniper ijaut > 03: Junos Automation API Overview
Automation has been part of Junos since the beginning. Junos supports multiple methods of automation.
All Junos automation is processed by the management process (mgd) or the Juniper Extension Toolkit (JET) service process (jsd).
The mgd process handles automation requests using: * Junos XML * Yet Another Next Generation (YANG) * Representational State Transfer (REST) API’s
Ansible executes Python modules and sends NETCONF and XML to Junos. Junos forwards this to mgd. jsd handles requests using JET API.
Junos works well in DevOps environments because it supports many API’s and has transactional configuration updates. On-box scripts and applications are also supported.
NETCONF (RFC 6241) is used to access the Junos XML API over the network.
On-box scripts customise Junos behaviour. Scripts can be written in XSLT, SLAX (Stylesheet Language Alternative Syntax, which compiles to XSLT) or Python (starting with Junos 16.1). The Junos PyEZ library is also supported on-box.
On-box scripts can be commit scripts, run at commit time. Operation scripts, run from the command line. Event scripts, initiated by an event policy (for example, BGP or interface state changes). SNMP scripts, triggered when the SNMP manager requests information for an SNMP OID.
Automates all aspects of Junos device management using Python. Load and commit configuration, carry out filesystem maintenance, read and upload configuration in text, XML, JSON, Junos ‘set’ commands. It parses XMLRPC command output automatically.
Provide a declarative approach to managing the network. Generally support configuration templating, rendering templates to create the actual configuration. All automation management systems use XMLRPC over NETCONF.
Ansible does not require an agent on the system being managed. It uses YAML files. It uses NETCONF and the Junos XML API. It can upgrade software, reboot devices, etc..
Salt enables you to define the desired state of a device and then deploy it. It utilises a Salt ‘proxy minion’ to connect to Junos devices.
Puppet performs device configuration management. The Puppet agent runs on each of the managed resources. The Puppet server compiles a manifest into catalogs. The agent, running on the managed device, retrieves and applies the catalog. To run on Junos, the Junos device must be running the jpuppet module.
Chef automates provisioning and management. It converts code into infrastructure. Chef is supported on selected Junos devices using a Chef client, which is installed on the device.
Junos Extension Toolkit (JET) provides an interface for developers of third party applications. It could be used to make, for example, a Twitter client responding to specific events. It can open customised MIB’s without waiting for Juniper to implement them.
JET features multiple programming languages for off-box development, such as Python, C, C++. JET uses gRPC. Fast programmatic configuration database, up to 1000 commits per second, without validating commits.
JSNAPy captures and audits runtime environments of network devices.
Juniper ZTP automates setup of new devices. The device attempts to use DHCP to obtain instructions. If the DHCP server is not configured to provide additional Junos ZTP information, the switch boots with the default configuration.