Cheat sheet#

NominalClient has a client for each area of Nominal, such as client.assets() for assets and client.catalog() for datasets and channels.

This project setup command and associated imports will prepare you to call any of the functions listed on this page.

cargo new nominal-cheatsheet
cd nominal-cheatsheet
cargo add nominal chrono
cargo add tokio --features full
use chrono::Utc; // chrono is the time library used by the nominal crate
use nominal::core::*; // AssetCreate, RunQuery and the other types below

let client = nominal::NominalClient::from_profile("default")?;

Assets#

Action

Ref

Rust

Create an asset

πŸ“„

client.assets().create(AssetCreate::new("Engine 1").labels(["prototype"])).await?

Get an asset by RID

πŸ“„

client.assets().get("<rid>").await?

Search by label

πŸ“„

client.assets().search(AssetQuery::label("prototype")).await?

Add a dataset under a ref name

πŸ“„

client.assets().add_dataset(asset.rid(), "telemetry", dataset.rid()).await?

Replace labels

πŸ“„

client.assets().update(asset.rid(), AssetUpdate::new().labels(["prototype", "flight"])).await?

Archive

πŸ“„

client.assets().archive(asset.rid()).await?

Runs#

Action

Ref

Rust

Start a run on an asset now

πŸ“„

client.runs().create(RunCreate::new("Engine test 1", Utc::now()).assets([asset.rid()])).await?

End an open run

πŸ“„

client.runs().update(run.rid(), RunUpdate::new().end(Utc::now())).await?

Get a run by RID

πŸ“„

client.runs().get("<rid>").await?

Search by label

πŸ“„

client.runs().search(RunQuery::label("acceptance")).await?

Add a dataset to a run with no assets

πŸ“„

client.runs().add_dataset(run.rid(), "telemetry", dataset.rid()).await?

Archive

πŸ“„

client.runs().archive(run.rid()).await?

Datasets and channels#

Action

Ref

Rust

Create a dataset

πŸ“„

client.catalog().create_dataset(DatasetCreate::new("Engine test 1")).await?

Get a dataset by RID

πŸ“„

client.catalog().get_dataset("<rid>").await?

Search by part of the name

πŸ“„

client.catalog().search_datasets(DatasetQuery::substring_match("Engine")).await?

List a dataset’s channels

πŸ“„

client.catalog().list_channels(dataset.rid()).await?

Archive

πŸ“„

client.catalog().archive_dataset(dataset.rid()).await?

Files and drives#

Action

Ref

Rust

Upload a CSV into a new dataset

πŸ“„

client.ingest().upload_csv("test.csv", DatasetCreate::new("Engine test 1"), CsvIngest::new(Timestamp::iso8601("timestamp"))).await?

Wait for the upload’s ingest job

πŸ“„

client.ingest().wait_for_ingest_job(job.rid()).await?

Get a drive by name

πŸ“„

client.drives().get_by_id("test-reports").await?

List a drive folder

πŸ“„

client.files(drive.rid()).list("reports", false).await?

Workbooks#

Action

Ref

Rust

Get a template by RID

πŸ“„

client.templates().get("<rid>").await?

Create a workbook for a run

πŸ“„

client.workbooks().create_from_template(&template, WorkbookDataScope::runs([run.rid()]), WorkbookCreate::new()).await?

Beyond NominalClient#