pub struct RunListQuery { /* private fields */ }Expand description
Which runs RunsApi::list returns. Only the settings given a value
are sent, except since and only_tasks, which are always sent.
use std::time::{Duration, SystemTime};
use hatchet_rest::{RunListQuery, TaskStatus};
let query = RunListQuery::new()
.since(SystemTime::now() - Duration::from_secs(3600))
.statuses([TaskStatus::Failed])
.additional_metadata([("customer", "acme")])
.limit(20);Implementations§
Source§impl RunListQuery
impl RunListQuery
Sourcepub fn new() -> Self
pub fn new() -> Self
Every run, DAG rows and task rows alike (only_tasks=false, as in
the official Python SDK).
Without since the query asks for runs since
1970-01-01 — v0.107.0 refuses a run list without since (400),
so it is always sent.
Sourcepub fn since(self, since: SystemTime) -> Self
pub fn since(self, since: SystemTime) -> Self
Runs created at or after since.
Sourcepub fn until(self, until: SystemTime) -> Self
pub fn until(self, until: SystemTime) -> Self
Runs created before until.
Sourcepub fn statuses(self, statuses: impl IntoIterator<Item = TaskStatus>) -> Self
pub fn statuses(self, statuses: impl IntoIterator<Item = TaskStatus>) -> Self
Only these statuses.
Sourcepub fn workflow_ids(
self,
ids: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn workflow_ids( self, ids: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Only these workflows (by id).
Sourcepub fn only_tasks(self, only_tasks: bool) -> Self
pub fn only_tasks(self, only_tasks: bool) -> Self
Task rows only, no DAG rows.
Sourcepub fn parent_task_external_id(self, id: impl Into<String>) -> Self
pub fn parent_task_external_id(self, id: impl Into<String>) -> Self
Only children of this task run.
Sourcepub fn triggering_event_external_id(self, id: impl Into<String>) -> Self
pub fn triggering_event_external_id(self, id: impl Into<String>) -> Self
Only runs this event triggered.
Sourcepub fn additional_metadata<K: AsRef<str>, V: AsRef<str>>(
self,
pairs: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn additional_metadata<K: AsRef<str>, V: AsRef<str>>( self, pairs: impl IntoIterator<Item = (K, V)>, ) -> Self
Only runs carrying these metadata pairs, sent as "key:value".
How several pairs combine is the engine’s default unless
metadata_operator says otherwise.
Sourcepub fn metadata_operator(self, operator: MetadataOperator) -> Self
pub fn metadata_operator(self, operator: MetadataOperator) -> Self
How several metadata pairs combine. Not in the v0.80.0 spec.
Sourcepub fn include_payloads(self, include: bool) -> Self
pub fn include_payloads(self, include: bool) -> Self
Whether rows carry inputs and outputs.
Sourcepub fn running_filter(self, filter: RunningFilter) -> Self
pub fn running_filter(self, filter: RunningFilter) -> Self
Which running tasks to return.
Sourcepub fn idempotency_keys(
self,
keys: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn idempotency_keys( self, keys: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Only runs with these idempotency keys. Not in the v0.80.0 spec, and a v0.80.0 engine was observed to ignore it (every run is listed).