ON THIS PAGE
Adding Missing DMI Schemas by Using the View/Install Missing Schema Action
Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using the Get Latest Action
Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using REST APIs
Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using the Update Schema Menu
Adding Missing DMI Schemas or Updating Outdated DMI Schemas in Junos Space Network Management Platform
When a new device is added to your network, you need to add the DMI schema for that device to Junos Space Platform to configure and manage the device. You can view whether the schema for a device series is installed or not on Junos Space Platform from the DMI Schemas page. A value of No in the Schema Installed column indicates that the schema for a Junos OS version on a device series is not present in Junos Space Platform.
You can download DMI schema from the configured Juniper Networks DMI schema repository to Junos Space Platform in one of the following ways:
Adding Missing DMI Schemas by Using the View/Install Missing Schema Action
Junos Space Platform provides the View/install Missing Schema action to view and install DMI schemas that are missing from Junos Space Platform.
To add missing schemas by using the View/Install Missing schemas action:
Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using the Get Latest Action
The Get Latest action downloads missing schemas and updates outdated schemas in Junos Space Platform. The Get Latest action is enabled only after the DMI schema repository is configured.
To add or update schemas by using the Get Latest action:
Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using REST APIs
Junos Space Platform provides an option to download missing schemas or update outdated schemas by using REST APIs for situations where the Junos Space Platform is not connected to the Web.
To generate the APIs, Junos Space Platform has the schemaInstall.py script stored in the /var/log/space-debug/debug-utilities/schemaManagement location. When Junos Space Platform is not connected to the Web, download the script to a local system from which you can connect to the Web. The information for using the schemaInstall.py script to manage DMI schemas is documented in this section and is also present in the ReadMe.txt file located at /var/log/space-debug/debug-utilities/schemaManagement.
To run the schemaInstall.py script on a local system, the local system should meet the following requirements:
Python 3.6 (https://www.python.org/ftp/python/3.6.1/python-3.6.1.exe)
SVN client such as Tortoise SVN (https://tortoisesvn.net/downloads.html )
Python Installation Package (PIP) Version 3.6 installed on the local system
You can obtain help for the schemaInstall.py script by using the python schemaInstall.py --help
command.
You can run the schemaInstall.py script as follows to add missing schemas or update outdated schemas in Junos Space Platform depending on connectivity of the local system to Junos Space Platform and the DMI schema repository:
Before you run the script, copy the script to a local system that is connected to the Web.
The following variables are used by the schemaInstall.py script:
svnurl is the link to DMI Schema repository (https://xml.juniper.net/dmi/repository/trunk/).
spaceuser is the username for logging in to Junos Space Platform.
svnuser is the username for logging in to the DMI Schema repository.
spaceurl is the link to Junos Space Platform.
Situation 1: When your local system is connected to both Junos Space Platform and the DMI schema repository, you can execute the script to perform the following tasks:
Add missing DMI schemas in Junos Space Platform by executing the following command on the local system:
python schemaInstall.py -o install-missing-schemas --svnurl="<svnurl>" --spaceuser="<spaceuser>" --svnuser="<svnuser>" --spaceurl="<spaceurl>"
Add specific schemas on Junos Space platform by executing the following command on the local system:
python schemaInstall.py -o install-schemas --svnurl="<svnurl>" --spaceuser="<spaceuser>" --svnuser="<svnuser>" --spaceurl="<spaceurl>" --file="schema.xml"
Where, schema.xml is the file containing specific schemas that you want to install.
~~ Structure of sample schema.xml file ~~ <dmi-schema-infos uri="/api/space/schema-service/dmi-schemas-with-missing-schemas"> <dmi-schema-info> <os-version>3.0R1</os-version> <dev-family>ive-ic</dev-family> </dmi-schema-info> <dmi-schema-info> <os-version>11.3X30.10</os-version> <dev-family>junos-qf</dev-family> </dmi-schema-info> </dmi-schema-infos>
You can obtain the schema.xml file by one of the following means:
Create the schema file manually.
Obtain the list of all schemas present in Junos Space Platform by executing the following command:
python schemaInstall.py -o get-schemas --spaceurl="<spaceurl>" --spaceuser="<spaceuser>" --file="schema.xml"
Obtain the list of schemas missing in Junos Space Platform by executing the following commands:
python schemaInstall.py -o checkout-missing-schemas --svnurl="<svnurl>" --spaceuser="<spaceuser>" --svnuser="<svnuser>" --spaceurl="<spaceurl>"
The schema.xml file obtained by using the
get-schemas
and thecheckout-missing-schemas
methods can be used for installing schemas on Junos Space Platform and checking out schemas on the DMI Schema repository.Find the schemas missing in Junos Space Platform and obtain those schemas from the DMI schema repository in a *.tgz file by executing the following command:
python schemaInstall.py -o checkout-missing-schemas --svnurl="<svnurl>" --spaceuser="<spaceuser>" --svnuser="<svnuser>" --spaceurl="<spaceurl>"
This command outputs the upload-tgz-schema-file.tgz local file. You can upload the local file later by using the Update Schema menu; see Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using the Update Schema Menu for details.
Situation 2: When the local system has connectivity to the DMI schema repository but not to the Junos Space platform, you can execute the script to download specific schemas in local format (*.tgz) from the repository. You can later add the schemas to Junos Space Platform by using the Update Schema menu; see Adding Missing DMI Schemas or Updating Outdated DMI Schemas by Using the Update Schema Menu for details.
python schemaInstall.py -o checkout-schemas --svnurl="<svnurl>" --svnuser="<svnuser>" --file="schema.xml"
Situation 3: When the local system is connected to Junos Space Platform, but not to the DMI Schema repository, you can do the following:
Upload local schema to Junos Space Platform by executing the following command:
script python schemaInstall.py -o install-schemas --spaceuser="<spaceuser>" --spaceurl="<spaceurl>" --archivefile="upload-tgz-schema-file.tgz"
where, upload-tgz-schema-file.tgz is the name of the local schema file uploaded to Junos Space Platform.
Note:You can obtain the upload-tgz-schema-file.tgz file by downloading it from the DMI repository and copying it to the local system.