pub struct Client { /* private fields */ }
Expand description
Provides methods to work with Axiom datasets, including ingesting and querying.
Implementations
sourceimpl Client
impl Client
sourcepub async fn apl_query<S, O>(&self, apl: S, opts: O) -> Result<AplQueryResult> where
S: Into<String>,
O: Into<Option<AplOptions>>,
pub async fn apl_query<S, O>(&self, apl: S, opts: O) -> Result<AplQueryResult> where
S: Into<String>,
O: Into<Option<AplOptions>>,
Executes the given query specified using the Axiom Processing Language (APL).
sourcepub async fn create<N, D>(
&self,
dataset_name: N,
description: D
) -> Result<Dataset> where
N: Into<String>,
D: Into<String>,
pub async fn create<N, D>(
&self,
dataset_name: N,
description: D
) -> Result<Dataset> where
N: Into<String>,
D: Into<String>,
Create a dataset with the given name and description.
sourcepub async fn delete<N: Into<String>>(&self, dataset_name: N) -> Result<()>
pub async fn delete<N: Into<String>>(&self, dataset_name: N) -> Result<()>
Delete the dataset with the given ID.
sourcepub async fn get<N: Into<String>>(&self, dataset_name: N) -> Result<Dataset>
pub async fn get<N: Into<String>>(&self, dataset_name: N) -> Result<Dataset>
Get a dataset by its id.
sourcepub async fn history<I: Into<String>>(&self, query_id: I) -> Result<HistoryQuery>
pub async fn history<I: Into<String>>(&self, query_id: I) -> Result<HistoryQuery>
Retrieve the query stored inside the query history dataset identified by its id.
sourcepub async fn info<N: Into<String>>(&self, dataset_name: N) -> Result<Info>
pub async fn info<N: Into<String>>(&self, dataset_name: N) -> Result<Info>
Retrieve the information of the dataset identified by its id.
sourcepub async fn ingest<N, I, E>(
&self,
dataset_name: N,
events: I
) -> Result<IngestStatus> where
N: Into<String>,
I: IntoIterator<Item = E>,
E: Serialize,
pub async fn ingest<N, I, E>(
&self,
dataset_name: N,
events: I
) -> Result<IngestStatus> where
N: Into<String>,
I: IntoIterator<Item = E>,
E: Serialize,
Ingest events into the dataset identified by its id. Restrictions for field names (JSON object keys) can be reviewed here: https://www.axiom.co/docs/usage/field-restrictions.
sourcepub async fn ingest_raw<N, P>(
&self,
dataset_name: N,
payload: P,
content_type: ContentType,
content_encoding: ContentEncoding
) -> Result<IngestStatus> where
N: Into<String>,
P: Into<Bytes>,
pub async fn ingest_raw<N, P>(
&self,
dataset_name: N,
payload: P,
content_type: ContentType,
content_encoding: ContentEncoding
) -> Result<IngestStatus> where
N: Into<String>,
P: Into<Bytes>,
Ingest data into the dataset identified by its id. Restrictions for field names (JSON object keys) can be reviewed here: https://www.axiom.co/docs/usage/field-restrictions.
sourcepub async fn ingest_stream<N, S, E>(
&self,
dataset_name: N,
stream: S
) -> Result<IngestStatus> where
N: Into<String>,
S: Stream<Item = E> + Send + Sync + 'static,
E: Serialize,
pub async fn ingest_stream<N, S, E>(
&self,
dataset_name: N,
stream: S
) -> Result<IngestStatus> where
N: Into<String>,
S: Stream<Item = E> + Send + Sync + 'static,
E: Serialize,
Restrictions for field names (JSON object keys) can be reviewed here: https://www.axiom.co/docs/usage/field-restrictions.
sourcepub async fn query<N, O>(
&self,
dataset_name: N,
query: Query,
opts: O
) -> Result<QueryResult> where
N: Into<String>,
O: Into<Option<QueryOptions>>,
pub async fn query<N, O>(
&self,
dataset_name: N,
query: Query,
opts: O
) -> Result<QueryResult> where
N: Into<String>,
O: Into<Option<QueryOptions>>,
Execute the given query on the dataset identified by its id.
sourcepub async fn trim<N, D>(&self, dataset_name: N, duration: D) -> Result<TrimResult> where
N: Into<String>,
D: TryInto<Duration, Error = Error>,
pub async fn trim<N, D>(&self, dataset_name: N, duration: D) -> Result<TrimResult> where
N: Into<String>,
D: TryInto<Duration, Error = Error>,
Trim the dataset identified by its id to a given length.
The max duration given will mark the oldest timestamp an event can have.
Older ones will be deleted from the dataset.
The duration can either be a std::time::Duration
or a
chrono::Duration
.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more