My-process-app test_process.py Yes Running On Failure No Name Executable Activated Status Restart Policy Config Pending Step 3: Activate the registered applicationĪppmgr process-script activate name my-process-app
Step 2: Register the application with Appmgr Step 1: Add and configure script as shown in README.MD Any exec script can be used as a process script. This snippet to create your own custom process script.
SAVAGE XR SCRPT COMMANDS CODE
Test_exec() Process Script Use the following sample code snippet to trigger a process script and perform various actions on the script. Xr.register_validate_callback(,check_config) Exec Script Use this sample code snippet in your exec script to import Python libraries to connect to NETCONF client and also to generate Syslog = xrlog.getSysLogger('Add script name here') To validate configuration and also generate syslogs.
Use this snippet in your script to import the libraries required For more information, see the workflow for the config, exec, process and eem scripts.Ĭonfig Script The following example shows a code snippet for config script. $ git clone Ĭopy the Python files to the router's harddisk or a remote repository.Īdd the scripts to the script management repository.
SAVAGE XR SCRPT COMMANDS DOWNLOAD
Follow these instructions to download the sample scripts from the Github repository to your router, and run the scripts:Ĭlone the Github repository. Use these sample script templates based on script type to build your custom script. # To run native xr cli and config commands Syslog = xrlog.getSysLogger('template_exec')įrom _lib import NetconfClient
SAVAGE XR SCRPT COMMANDS SOFTWARE
Makes working with XML feel like you are working with JSON.Ĭisco IOS XR software provides support for the following SDK libraries and standard protocols. Spawns new processes, connects to input/output/error pipes, and obtain return codes. Includes protocols PDUs definition (SNMP, LDAPĮtc.) and various data structures (X.509, PKCS).Īllows sending HTTP/1.1 requests using Python.ĭefines the function that returns a shell-escaped version of a Python string. Provides a collection of ASN.1 modules expressed in form of pyasn1 classes. Provides library to retrieve information on running processes and system utilization such as CPU, memory, disks, sensors and Provides runtime facilities for finding, introspecting, activating and using installed distributions. Implements a text object that escapes characters so it is safe to use in HTML and XML.Įnables system-independent network address manipulation and processing of Layer 3 network addresses.ĭefines an interactive source code debugger for Python programs. Provides a lightweight data interchange format. Supports adding functionality useful for templating environments. Provides capability to create, manipulate and operate on IPv4 and IPv6 addresses and networks. Supports language-neutral, platform-neutral, extensible mechanism for serializing structured data. Key), sign messages, and verify the signatures.Įnumerates symbolic names (members) bound to unique, constant values. Implements Elliptic Curve Digital Signature Algorithm (ECDSA) cryptography library to create keypairs (signing key and verifying Provides a high-level interface for asynchronously executing callables. Universal character encoding auto-detector. Parses and serializes Abstract Syntax Notation One (ASN.1) data structures. The following Python third party application packages are supported by the scripting infrastructure and can be used to createĬhooses the appropriate platform-specific directories for user data.ĭefines an object type that can compactly represent an array of basic values: characters, integers, floating point numbers. This functionality, Cisco IOS XR software provides contextual support using SDK libraries and standard protocols. With on-box Python scripting, automation scripts that was run from an external controller is now run on the router. To run the same actions using NETCONF RPCs, see Manage Automation Scripts Using YANG RPCs.Ĭisco IOS XR, Release 7.3.2 supports creating scripts using Python version 3.5. Scripts using CLI commands, see Explore the Types of Automation Scripts.
For more informtion about the script types and to run the Python packages, libraries and dictionaries in the software image. You can create Python scripts and execute the scripts on routers running Cisco IOS XR software.
This context, programmed in the script, uses Cisco IOS XR Python packages, modules,ĭetect events in the network and trigger an appropriate action IOS XR software, and the external servers. When you create and run Python scripts on the router, this feature enables a contextual interaction between the scripts, the Script Infrastructure and Sample Templates Table 1.