IngestClient#
- pub struct IngestClient#
Client for uploading files and managing ingest jobs.
Implementations#
- impl IngestClient
- pub async fn upload_csv(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: CsvIngest) -> Result<(IngestJob, String)>#
Upload a CSV file and ingest it into the given dataset.
The target accepts anything that converts to
DatasetTarget:&str/Stringfor an existing dataset RID, or aDatasetCreatefor a new dataset (created atomically with the ingest).Returns
(job, dataset_rid): the newly-created ingest job (useSelf::wait_for_ingest_jobto block until it reaches a terminal state) and the RID of the dataset the data is landing in (the existing one, or the freshly-created one).
- pub async fn upload_parquet(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: ParquetIngest) -> Result<(IngestJob, String)>#
Upload a Parquet file and ingest it into the given dataset.
The target accepts anything that converts to
DatasetTarget:&str/Stringfor an existing dataset RID, or aDatasetCreatefor a new dataset (created atomically with the ingest).Returns
(job, dataset_rid).
- pub async fn upload_mcap(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: McapIngest) -> Result<(IngestJob, String)>#
Upload an MCAP file and ingest its protobuf timeseries data into the given dataset.
Returns
(job, dataset_rid).
- pub async fn upload_journal_json(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: JournalJsonIngest) -> Result<(IngestJob, String)>#
Upload a journald JSON file (
.jsonlor.jsonl.gz) and ingest it into the given dataset.Returns
(job, dataset_rid).
- pub async fn upload_avro_stream(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: AvroStreamIngest) -> Result<(IngestJob, String)>#
Upload a Nominal Avro-stream file and ingest it into the given dataset.
Returns
(job, dataset_rid).
- pub async fn upload_ardupilot_dataflash(&self, path: impl AsRef<Path>, target: impl Into<DatasetTarget>, ingest: DataflashIngest) -> Result<(IngestJob, String)>#
Upload an ArduPilot DataFlash (
.bin) file and ingest it into the given dataset.Returns
(job, dataset_rid).
- pub async fn upload_video(&self, path: impl AsRef<Path>, target: impl Into<VideoTarget>, ingest: VideoIngest) -> Result<(IngestJob, String)>#
Upload a video file (
.mp4/.mkv/.avi/.ts) or an MCAP file containing a video stream and ingest it into the given video resource.Build the
ingestargument withVideoIngest::starting_atfor a plain video file, orVideoIngest::mcap_topicto extract a single stream out of an MCAP.Returns
(job, video_rid).
- pub async fn get_ingest_job(&self, rid: &str) -> Result<IngestJob>#
Fetch the current state of an ingest job.
- pub async fn wait_for_ingest_job(&self, rid: &str) -> Result<IngestJob>#
Poll an ingest job until it reaches a terminal state.
Returns
OkonCompleted. ReturnsErr(Error::Ingest { .. })onFailedorCancelled. Polls every 2 seconds; useSelf::wait_for_ingest_job_with_intervalto override.
- pub async fn wait_for_ingest_job_with_interval(&self, rid: &str, interval: Duration) -> Result<IngestJob>#
Like
Self::wait_for_ingest_jobbut polls on the given interval.
Trait implementations#
Auto traits: Send, Sync, Unpin, !UnwindSafe, !RefUnwindSafe