Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Install Junos Snapshot Administrator in Python

SUMMARY Install Junos Snapshot Administrator in Python (JSNAPy) on a remote network management system.

You install Junos Snapshot Administrator in Python (JSNAPy) on a remote network management system. Prior to installing JSNAPy, ensure that the server is running an OS that supports Python 3.8 or later. This includes, but is not limited to:

  • Linux (CentOS, Debian, Fedora, FreeBSD, and Ubuntu)

  • macOS

Note:

Windows does not support installing JSNAPy.

To install JSNAPy, first install the prerequisite software and then install JSNAPy as described in the following sections:

To upgrade an existing JSNAPy installation, see the following section:

Install Prerequisite Software

Before you install JSNAPy, ensure that the server has the following software installed:

  • Python 3.8 or later

  • All prerequisite software for the given operating system, which is outlined in Table 1

Table 1: jsnapy Dependencies

OS

Dependencies

CentOS

  • gcc

  • libffi-devel

  • libxml2-devel

  • libxslt-devel

  • openssl

  • python3-devel

  • python3-pip

Debian

  • libffi-dev

  • libssl-dev

  • libxml2-dev

  • libxslt1-dev

  • python3-dev

  • python3-pip

Fedora

  • gcc

  • libffi-devel

  • libxml2-devel

  • libxslt-devel

  • openssl

  • python3-devel

  • python3-pip

FreeBSD

  • py3xx-pip (e.g. py-311-pip)

  • libxml2

  • libxslt

OSX

  • pip

  • xcode

  • xquartz

Ubuntu

  • libffi-dev

  • libssl-dev

  • libxml2-dev

  • libxslt1-dev

  • python3-dev

  • python3-pip

Install the JSNAPy Library

You can install JSNAPy under the system-installed Python or in a Python virtual environment. You can use the Python package manager, pip, to install JSNAPy from the following locations:

The following sections outline the JSNAPy installation tasks and results:

Install JSNAPy Under the System-Installed Python

To install JSNAPy under the system-installed Python on the remote server:

  1. Install JSNAPy using pip.

    • To install the latest JSNAPy release from PyPI:

      • On Ubuntu, include the following options:

      • Otherwise, use the following command:

    • To install the latest JSNAPy development code from GitHub:

      • On Ubuntu, include the following options:

      • Otherwise, use the following command.

      Note:

      The latest code in the GitHub source repository is under active development and might not be stable.

  2. Create the JSNAPy snapshots and testfiles directories. Specify the paths to the default directory locations in the user's home directory.

    Note:

    Alternatively, you can update the JSNAPy configuration file (jsnapy.cfg) to specify alternate locations for the snapshots and testfiles directories.

Install JSNAPy in a Python Virtual Environment

To install JSNAPy in an existing Python virtual environment:

  1. Navigate to your virtual environment and activate it. For example:

  2. Install JSNAPy using pip.

    • To install the latest JSNAPy release from PyPI:

      • On Ubuntu and macOS, include the following options:

      • Otherwise, use the following command:

    • To install the latest JSNAPy development code from GitHub:

      • On Ubuntu and macOS, include the following options:

      • Otherwise, use the following command:

    Note:

    The latest code in the GitHub source repository is under active development and might not be stable.

JSNAPy Directories and Files

JSNAPy uses the directories and files listed in Table 2.

Table 2: JSNAPy Directories and Files

Directory or File Name

Purpose

jsnapy.cfg

File that specifies the default paths for configuration files, snapshot files, and test files.

logging.yml

File that specifies the settings for logging JSNAPy events and messages.

snapshots/

Default directory for the storage of JSNAPy snapshot files. The snapshot filenames include the device name and the test.

testfiles/

Default directory for JSNAPy test files.

Table 3 outlines the default locations for the JSNAPy files and directories for the given environment. The table also indicates whether the JSNAPy installer automatically generates the file or directory during the installation.

Table 3: Default Locations for JSNAPy Files and Directories

Files

Environment

Default Location

JSNAPY Creates
the File or Directory
During Installation

jsnapy.cfg

Non-virtual

/etc/jsnapy/

Yes

Virtual

/etc/jsnapy/ directory inside the virtual environment

Yes

logging.yml

Non-virtual

/var/log/jsnapy/

Yes

Virtual

/var/log/jsnapy/ directory inside the virtual environment

Yes

Configuration and test files

Non-virtual

~/jsnapy/testfiles

No

Virtual

/etc/jsnapy/testfiles directory inside the virtual environment

Yes

Snapshots

Non-virtual

~/jsnapy/snapshots

No

Virtual

/etc/jsnapy/snapshots directory inside the virtual environment

Yes

Upgrade JSNAPy

Juniper Networks periodically updates the JSNAPy code in GitHub for improvements and bug fixes. You can upgrade your JSNAPy installation at any time to the latest release posted on https://pypi.org/ or to the latest development code in the Juniper/jsnapy GitHub repository. You can use the pip command with the upgrade flag (-U or --upgrade) to update the existing installation as described in the following sections:

Upgrade JSNAPy Under the System-Installed Python

To update JSNAPy after you have installed it under the system-installed Python:

  • To update JSNAPy to the latest released code in PyPI, use the following command:

  • To update jsnapy to the latest development code in GitHub, use the following command:

    Note:

    The latest code in the GitHub source repository is under active development and might not be stable.

Upgrade JSNAPy in a Python Virtual Environment

To update JSNAPy after you have installed it in a Python virtual environment:

  • To update JSNAPy to the latest released code in PyPI, use the following command:

  • To update JSNAPy to the latest development code in GitHub, use the following command:

    Note:

    The latest code in the GitHub source repository is under active development and might not be stable.