3. Managing CLI plug-ins
This chapter contains procedures for installing, modifying, and removing a CLI plug-in on the SR Linux.
3.1. Install a CLI plug-in
To install a CLI plug-in, perform the following steps:
Open an SSH session.
Save the CLI plug-in Python code to a file; for example, my_cli.py.
Copy the CLI plug-in file to the /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux/mgmt/cli/plugins/reports directory.
Edit the file /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux-0.1-py3.6.egg-info/entry_points.txt and add an entry for the new CLI plug-in. For example:
my_cli = srlinux.mgmt.cli.plugins.reports.my_cli:Plugin
Restart the SR Linux CLI by closing the SSH session and reconnecting via SSH as the admin user.
3.2. Modify a CLI plug-in
To modify an existing CLI plug-in, perform the following steps:
Open an SSH session.
Modify and save the CLI plug-in file in the /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux/mgmt/cli/plugins/reports directory.
Restart the SR Linux CLI by closing the current SSH session and reconnecting via SSH as the admin user.
3.3. Remove a CLI plug-in
To remove an existing plug-in from the SR Linux CLI, perform the following steps:
Open an SSH session.
Open the file /opt/srlinux/python/virtual-env/lib/python3.6/site-packages/srlinux-0.1-py3.6.egg-info/entry_points.txt
Delete the entry for the CLI plug-in you are removing. Save the file.
Restart the SR Linux CLI by closing the current SSH session and reconnecting via SSH as the admin user.