Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Importing Scripts to Junos Space

Using Junos Space Network Management Platform, you can import a single script or multiple scripts at a time to the Junos Space server from the Scripts page of the Images and Scripts workspace. Junos Space Platform enables you to import commit, operation (op), or event scripts in the .slax or .xsl format from your computer or from an external Git repository.

Prior to Junos OS 9.0, event scripts and op scripts are saved in the op directory and enabled under the system scripts op hierarchy. However, from Junos OS 9.0 onward, event scripts are saved in the event directory and enabled under the event-options event-script hierarchy.

Note:

If you want to import multiple scripts at a time, use the Mozilla Firefox or Google Chrome Web browser. Currently, Internet Explorer does not support the selection of multiple files. In addition, note that two scripts with the same name cannot be imported into the Junos Space server.

Junos Space Platform provides the following options to import scripts:

Importing Scripts from Files

You can import scripts in the .slax or .xsl format from your computer by using the Import from files option on the Import Scripts page. Starting with Junos Space Network Management Platform Release 15.2R1, multiple scripts can also be imported to the Junos Space server as .tar files.

To import scripts from files:

  1. On the Junos Space Platform UI, select Images and Scripts > Scripts.

    The Scripts page appears.

  2. Click the Import Script icon.

    The Import Scripts page appears.

  3. Select Import from files, if the option is not already selected.
  4. Click Browse.

    The File Upload dialog box displays the directories and folders on your local file system.

  5. Select the file or files that you want to import and click Open.

    The selected filenames appear in the box beside the Browse button.

  6. Click Next.

    If the selected scripts are valid, they are displayed on the Import Scripts page.

    Note:
    • If the selected scripts are not valid, an error message is displayed. Click OK to return to the Import Scripts page.

    • If some of the scripts are valid and others are not, a warning message indicating that some of the scripts are not valid is displayed. Click OK to import the valid scripts.

      To determine which scripts are imported and which are not, view the job details from the Job Management page.

    • If you have selected multiple scripts of the same name, an error message indicating the presence of duplicate scripts is displayed and the duplicate scripts are not imported.

    Details of the scripts selected for import, such as information about whether the scripts already exist in Junos Space Platform and whether conflicts exist, are displayed in a tabular format. Table 1 describes the fields displayed on the page.

  7. (Optional) Select the Exclude Conflicting Scripts From Import check box to select only those scripts for which there are no conflicts with the script versions that exist in Junos Space Platform.

    The scripts for which conflicts exist are removed from the list of scripts on the Import Scripts page.

  8. Click Finish to import the listed scripts or click Cancel to go back to the Scripts page.

    If you have not selected the Exclude Conflicting Scripts From Import check box and the script files already exist in Junos Space Platform, a warning message indicating that conflicts exist and that the scripts will be overwritten is displayed. Click OK to proceed with the import or click Cancel to return to the Import Scripts page.

    The scripts are imported to the domain that you are currently logged in to. If a script with the same name already exists in the domain or any of the subdomains, and you choose to override any conflicts that might exist, the script is imported to the domain and subdomains where the script exists, with the version number incremented. This ensures that the script that exists in Junos Space is not overwritten and can be retrieved if required.

    The imported scripts are displayed on the Scripts page.

Importing Scripts from a Git Repository

You can import scripts in the .slax or .xsl format from external Git repositories. Before you import scripts from a Git repository, the repository must be added to Junos Space and marked as the active Git repository for scripts, from the Git Repositories page. When you import scripts from Git repositories, all scripts in the selected branch of the repository are imported to Junos Space.

To import scripts from a Git repository:

  1. On the Junos Space Platform UI, select Images and Scripts > Scripts.

    The Scripts page appears.

  2. Click the Import Script icon.

    The Import Scripts page appears.

  3. Select Import from Git.

    This option is displayed only if an active Git repository of the Scripts type exists in Junos Space.

  4. Select the branch of the repository from the Git Branch list.
  5. (Optional) Click Sync Now to synchronize the Git repository clone on the Junos Space server with the external Git repository.

    The date and time of the last sync is displayed above the Sync Now button.

  6. Click Next.

    If the scripts in the selected Git repository branch are valid, they are displayed on the Import Scripts page.

    Note:
    • If the selected scripts are not valid, an error message is displayed. Click OK to return to the Import Scripts page.

    • If some of the scripts are valid and others are not, a warning message indicating that some of the scripts are not valid is displayed. Click OK to import the valid scripts.

      To determine which scripts are imported and which are not, view the job details from the Job Management page.

    • If you have selected multiple scripts of the same name, an error message indicating the presence of duplicate scripts is displayed and the duplicate scripts are not imported.

    Details of the scripts selected for import, such as information about whether the scripts already exist in Junos Space Platform and whether conflicts exist, are displayed in a tabular format. Table 1 describes the fields displayed on the page.

  7. (Optional) Select the Exclude Conflicting Scripts From Import check box to import only those scripts for which there are no conflicts with the script versions that exist in Junos Space Platform.

    The scripts for which conflicts exist are removed from the list of scripts on the Import Scripts page.

  8. Click Finish to import the listed scripts or click Cancel to go back to the Scripts page.

    If you have not selected the Exclude Conflicting Scripts From Import check box and conflicts exist, a warning message indicating that conflicts exist and that the scripts will be overwritten is displayed. Click OK to proceed with the import or click Cancel to return to the Import Scripts page.

    The scripts are imported to the domain that you are currently logged in to. If a script with the same name already exists in the domain or any of the subdomains, and you choose to override any conflicts that might exist, the script is imported to the domain and subdomains where the script exists, with the version number incremented. This ensures that the script that exists in Junos Space is not overwritten and can be retrieved if required.

    The imported scripts are displayed on the Scripts page.

Table 1: Import Scripts Page Fields

Fields

Description

Script

Name of the script

Conflict State

Whether a conflict exists between the selected script and a script with the same name in Junos Space Platform. Value can be NEW, NO CONFLICT, or CONFLICT.

Note:

When scripts are imported using the Import from File option, the two possible states are NEW and CONFLICT. If the script does not exist in Junos Space Platform, the state is NEW; if a script of the same name exists in Junos Space Platform, the state is CONFLICT.

Value is NEW when the script is imported to Junos Space Platform for the first time.

Value is NO CONFLICT when there is no conflict between the script selected for import from the Git repository and the scripts that exist in Junos Space Platform.

Value is CONFLICT when:

  • You are importing scripts from your computer and a script of the same name exists in Junos Space Platform.

  • A script of the same name exists in Junos Space Platform and the script is being imported for the first time from the Git repository.

  • The selected script is already imported from the Git repository and is modified in Junos Space Platform.

  • The script present in Junos Space Platform is from a different branch of the Git repository.

Domain

Domain to which the existing script in Junos Space Platform is assigned

The column is empty if the script does not exist in Junos Space Platform.

Latest Version

Latest version of the script in Junos Space Platform

The column is empty if the script does not exist in Junos Space Platform.

Git Version

Commit ID of the script that was previously imported to Junos Space Platform. A warning icon is displayed if the script was later modified in Junos Space Platform.

The column is empty if the script does not exist in Junos Space Platform or if no version of the script in Junos Space Platform is imported from a Git repository.

Git Branch

Git repository branch from which the existing script was last imported

The column is empty if the script does not exist in Junos Space Platform or if no version of the script in Junos Space Platform is imported from a Git repository.

Last Commit

Commit ID of the last commit of the script in the selected branch of the Git repository

The column is empty if the script is being imported from your computer.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
15.2R1
Starting with Junos Space Network Management Platform Release 15.2R1, multiple scripts can also be imported to the Junos Space server as .tar files.