Add Logs to an Asset
To use this guide, install the Nominal Python library with pip3 install nominal
.
See Quickstart for more details.
Please contact us if you’re not sure whether your organization has access to Nominal.
Log files are a standard output from Assets such as aircraft, land vehicles, manufacturing equipment, and practically any present-day machine with an on-board computer.
Nominal makes it simple to upload log files to a Nominal Asset for collaborative inspection, root-cause analysis, and automated alerting.
In Nominal, Assets are containers of multimodal test data - including Datasets, Videos, Logs, and database connections.
To see your organization’s latest Assets, head over to the Assets page
Connect to Nominal
Concepts
- Base URL: The URL through which the Nominal API is accessed (typically
https://api.gov.nominal.io/api
; shown under Settings → API keys). - Workspace: A mechanism by which to isolate datasets; each user has one or more workspace, and data in one cannot be seen from another. Note that a token / API key is attached to a user, and may access multiple workspaces.
- Profile: A combination of base URL, API key, and workspace.
There are two primary ways of authenticating the Nominal Client. The first is to use a profile stored on disk, and the second is to use a token directly.
Storing credentials to disk
Run the following in a terminal and follow on-screen prompts to set up a connection profile:
Here, “default” can be any name chosen to represent this profile (reminder: a profile represents a base URL, API key, and workspace).
The profile will be stored in ~/.config/nominal/config.yml
, and can then be used to create a client:
If you have previously used nom
to store credentials, prior to the availability of profiles, you will need to migrate your old configuration file (~/.nominal.yml
) to the new format (~/.config/nominal/config.yml
).
You can do this with the following command:
Directly using credentials in your scripts
NOTE: you should never share your Nominal API key with anyone. We therefore recommend that you not save it in your code and/or scripts.
Create an Asset
First, we’ll create an empty asset to upload our log file:
If you navigate to your organization’s Assets page, you’ll see an Asset at the top called “‘Frosty Flight.”
Generate a log file
We’ll generate a demo log file to add to our Asset.
To make the demo log file visually interesting and distinct, we’ll add a random sparkline chart to each log file line:
Nominal log files are defined in Python as a list of tuples:
Finally, add the log file to uav_drone_asset
:
If you visit the Datasets tab of the ‘Frosty Flight’ Assets page, you’ll see “Sparkline Logs” in the datasets table.
To inspect “Sparkline Logs”, open the Asset in an empty Workbook and click on the “Logs” pane at the bottom of the window.
Retrieve log files
To retrieve a log file, use the get_log_set()
and stream_logs()
convenience functions.
You can find the resource ID (“RID”) for log files under the “Data sources” tab of any Run that has an associated log file.