CatalogClient#
- pub struct CatalogClient#
Client for catalog operations: datasets, videos, connections, and channels.
Implementations#
- impl CatalogClient
- pub async fn create_dataset(&self, create: DatasetCreate) -> Result<Dataset>#
Create a new dataset.
- pub async fn get_dataset_batch<I, S>(&self, rids: I) -> Result<HashMap<String, Dataset>> where I: IntoIterator<Item = S>, S: AsRef<str>#
Get multiple datasets by RID.
Returns a map from RID string to Dataset. RIDs not found in Nominal are omitted.
- pub async fn list_datasets(&self) -> Result<Vec<Dataset>>#
List datasets, sorted by ingest date descending.
- pub async fn search_datasets(&self, query: DatasetQuery) -> Result<Vec<Dataset>>#
Search datasets with a query, collecting all pages eagerly.
Example
use nominal::core::DatasetQuery; let datasets = client.catalog() .search_datasets(DatasetQuery::and([ DatasetQuery::label("production"), DatasetQuery::property("vehicle", "rocket"), ])) .await?;
- pub async fn update_dataset(&self, rid: &str, update: DatasetUpdate) -> Result<Dataset>#
Update dataset metadata. Returns the updated dataset.
Only fields set on the update will be changed; the rest remain untouched.
- pub async fn archive_dataset(&self, rid: &str) -> Result<()>#
Archive a dataset. Archived datasets are hidden from the UI but not deleted.
- pub async fn unarchive_dataset(&self, rid: &str) -> Result<()>#
Unarchive a dataset, restoring its visibility in the UI.
- pub async fn create_video(&self, create: VideoCreate) -> Result<Video>#
Create a new video.
- pub async fn get_video_batch<I, S>(&self, rids: I) -> Result<HashMap<String, Video>> where I: IntoIterator<Item = S>, S: AsRef<str>#
Get multiple videos by RID.
Returns a map from RID string to Video. RIDs not found in Nominal are omitted.
- pub async fn list_videos(&self) -> Result<Vec<Video>>#
List videos, sorted by creation date descending.
- pub async fn search_videos(&self, query: VideoQuery) -> Result<Vec<Video>>#
Search videos with a query, collecting all pages eagerly.
Example
use nominal::core::VideoQuery; let videos = client.catalog() .search_videos(VideoQuery::and([ VideoQuery::label("flight"), VideoQuery::property("vehicle", "rocket"), ])) .await?;
- pub async fn update_video(&self, rid: &str, update: VideoUpdate) -> Result<Video>#
Update video metadata. Returns the updated video.
Only fields set on the update will be changed; the rest remain untouched.
- pub async fn archive_video(&self, rid: &str) -> Result<()>#
Archive a video. Archived videos are hidden from the UI but not deleted.
- pub async fn unarchive_video(&self, rid: &str) -> Result<()>#
Unarchive a video, restoring its visibility in the UI.
- pub async fn get_connection(&self, rid: &str) -> Result<Connection>#
Get a connection by RID.
- pub async fn get_connection_batch<I, S>(&self, rids: I) -> Result<HashMap<String, Connection>> where I: IntoIterator<Item = S>, S: AsRef<str>#
Get multiple connections by RID.
Returns a map from RID string to Connection. RIDs not found in Nominal are omitted.
- pub async fn list_connections(&self) -> Result<Vec<Connection>>#
List all connections.
- pub async fn update_connection(&self, rid: &str, update: ConnectionUpdate) -> Result<Connection>#
Update connection metadata. Returns the updated connection.
Only fields set on the update will be changed; the rest remain untouched.
- pub async fn archive_connection(&self, rid: &str) -> Result<()>#
Archive a connection. Archived connections are hidden from the UI but not deleted.
- pub async fn unarchive_connection(&self, rid: &str) -> Result<()>#
Unarchive a connection, restoring its visibility in the UI.
- pub async fn list_channels(&self, data_source_rid: &str) -> Result<Vec<Channel>>#
List every channel on a data source.
data_source_ridcan be any data source (dataset, video, connection, etc.). Paginates internally and returns all results.
- pub async fn search_channels(&self, query: ChannelQuery) -> Result<Vec<Channel>>#
Search channels with a query, collecting all pages eagerly.
Accepts any data source RID — datasets, videos, connections.
Example
use nominal::core::ChannelQuery; let channels = client.catalog() .search_channels( ChannelQuery::new() .substring_match("temperature") .data_source("ri.catalog.gov-staging.dataset.abc"), ) .await?;
- pub async fn get_channel(&self, data_source_rid: &str, name: &str) -> Result<Channel>#
Get a single channel’s metadata.
- pub async fn set_channel_metadata(&self, data_source_rid: &str, name: &str, update: ChannelUpdate) -> Result<Channel>#
Set a channel’s metadata (description and/or unit). Only fields set on the update are written; the rest remain untouched.
Uses the series metadata upsert endpoint, so metadata can be seeded before streamed data has created the channel. The update must specify a data type because the upsert endpoint needs it when creating metadata.
Trait implementations#
Auto traits: Send, Sync, Unpin, !UnwindSafe, !RefUnwindSafe