9. Skip to content

9. User-Defined Report Generator Setup

Specification Compliance Manager (SCM) enables users to define custom formats of reports to generate from SCM. To utilize this, you need to create Jupyter notebooks that get data from SCM and create a report file in the desired format. Refer to the following instructions to learn how to set up and deploy the user-defined report notebooks in the server.

9.1 Managing dependencies

9.1.1 Getting the list of modules installed in the server environment

  1. Open the command line in the server PC and navigate to the following location using the cd command: >C:\Program Files\National Instruments\Shared\Skyline\Python\3.8

  2. Run the command: python -m pip freeze >> server_requirements.txt

    The server_requirements.txt file is created in the previous folder. This file contains the list of dependencies with versions.

  3. Use the server_requirements.txt file to refer to the list of libraries that are installed in the server. In case you need any new libraries to be installed, follow the instructions in the next section.

9.1.2 Updating or installing new python modules in the server

If there is a need to install any new library that is not present in the development environment as well as in the server’s environment, then the library has to be installed in both the development and the server’s environment.

  1. To install a library in server environment, open the command line as admin in the server PC. Navigate to the following location using the cd command: >C:\Program Files\National Instruments\Shared\Skyline\Python\3.8

  2. Run the command: **python -m pip install \<library_name>==\** >For example, “python -m pip install polars==0.16.9”

9.2 Generating Private API Key value

The SCM private APIs follow API key based authentication. To test the functioning of these APIs (used in the notebook) in the development environment, the users will have to generate a private API key to be used as the x-ni-api-key header value in API calls.

9.2.1 Steps to generate private API key

  1. Go to the following link in browser: https:///scm/user-settings/manage-api-tokens?ff-private-api-keys=true (Ex: https://192.168.0.30/scm/user-settings/manage-api-tokens?ff-private-api-keys=true)
  2. Select Manage Private API Keys option in User Settings pane.
  3. Click on CREATE PRIVATE API KEY and generate a private API key value after providing a name.
  4. Use the generated value as the x-ni-api-key header value in SCM API calls. Save this value elsewhere for future reference.

Note: The APIs for which, the route starts with niscm/public follow token based authentication and will NOT work with API key authentication.

9.3 Deploying the user-defined report notebook to the server

9.3.1 Copying the notebooks to the server

After a custom report notebook has been tested and is ready for deployment, users can upload it to the server by placing the .ipynb file inside the following directory in the server PC:

C:\ProgramData\National Instruments\Skyline\JupyterHub\notebooks\shared\reports\SpecManagement\UserDefinedReports


Last update: May 8, 2023