RunsClient#
- pub struct RunsClient#
Client for run collection operations (list, get).
Implementations#
- impl RunsClient
- pub async fn create(&self, create: RunCreate) -> Result<Run>#
Create a new run.
Example
use chrono::Utc; use nominal::core::RunCreate; let run = client.runs() .create( RunCreate::new("orbit-raise-burn", Utc::now()) .description("Three-impulse burn to GTO") .labels(["orbit", "production"]) .assets(["ri.scout.cerulean-staging.asset.<uuid>"]), ) .await?;
- pub async fn get_batch<I, S>(&self, rids: I) -> Result<HashMap<String, Run>> where I: IntoIterator<Item = S>, S: AsRef<str>#
Get multiple runs by RID.
Returns a map from RID string to Run. RIDs not found in Nominal are omitted.
- pub async fn search(&self, query: RunQuery) -> Result<Vec<Run>>#
Search runs with a query, collecting all pages eagerly.
Example
use nominal::core::RunQuery; let runs = client.runs() .search(RunQuery::and([ RunQuery::label("production"), RunQuery::property("vehicle", "rocket"), ])) .await?;
- pub async fn update(&self, rid: &str, update: RunUpdate) -> Result<Run>#
Update run metadata. Returns the updated run.
Only fields set on the update will be changed; the rest remain untouched.
Example
let run = client.runs() .update("ri.scout.cerulean-staging.run.<uuid>", RunUpdate::new().name("New Name").labels(["tag1", "tag2"])) .await?;
- pub async fn add_data_sources<I, N>(&self, rid: &str, sources: I) -> Result<Run> where I: IntoIterator<Item = (N, DataSource)>, N: Into<String>#
Attach data sources to a run under the given ref names.
Ref names should be stable across runs of the same type, since checklists and templates use them to reference data sources. Returns the updated run.
Example
use nominal::core::DataSource; client.runs().add_data_sources("ri.scout.cerulean-staging.run.<uuid>", [ ("flight-data", DataSource::dataset("ri.catalog.cerulean-staging.dataset.<uuid>")), ("cockpit-cam", DataSource::video("ri.catalog.cerulean-staging.video.<uuid>")), ]).await?;
- pub async fn add_dataset(&self, rid: &str, ref_name: &str, dataset_rid: &str) -> Result<Run>#
Attach a dataset to a run under the given ref name. See
add_data_sources.
- pub async fn add_video(&self, rid: &str, ref_name: &str, video_rid: &str) -> Result<Run>#
Attach a video to a run under the given ref name. See
add_data_sources.
- pub async fn add_connection(&self, rid: &str, ref_name: &str, connection_rid: &str) -> Result<Run>#
Attach a connection to a run under the given ref name. See
add_data_sources.
- pub async fn add_attachments<I, S>(&self, rid: &str, attachment_rids: I) -> Result<()> where I: IntoIterator<Item = S>, S: AsRef<str>#
Add attachments (by RID) that have already been uploaded to a run.
- pub async fn remove_attachments<I, S>(&self, rid: &str, attachment_rids: I) -> Result<()> where I: IntoIterator<Item = S>, S: AsRef<str>#
Remove attachments from a run. Does not delete them from Nominal.
Trait implementations#
Auto traits: Send, Sync, Unpin, !UnwindSafe, !RefUnwindSafe