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> + FmtDebug,
O: Into<Option<AplOptions>>,
pub async fn apl_query<S, O>(&self, apl: S, opts: O) -> Result<AplQueryResult> where
S: Into<String> + FmtDebug,
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> + FmtDebug,
D: Into<String> + FmtDebug,
pub async fn create<N, D>(
&self,
dataset_name: N,
description: D
) -> Result<Dataset> where
N: Into<String> + FmtDebug,
D: Into<String> + FmtDebug,
Create a dataset with the given name and description.
sourcepub async fn delete<N>(&self, dataset_name: N) -> Result<()> where
N: Into<String> + FmtDebug,
pub async fn delete<N>(&self, dataset_name: N) -> Result<()> where
N: Into<String> + FmtDebug,
Delete the dataset with the given ID.
sourcepub async fn get<N>(&self, dataset_name: N) -> Result<Dataset> where
N: Into<String> + FmtDebug,
pub async fn get<N>(&self, dataset_name: N) -> Result<Dataset> where
N: Into<String> + FmtDebug,
Get a dataset by its id.
sourcepub async fn info<N>(&self, dataset_name: N) -> Result<Info> where
N: Into<String> + FmtDebug,
pub async fn info<N>(&self, dataset_name: N) -> Result<Info> where
N: Into<String> + FmtDebug,
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> + FmtDebug,
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> + FmtDebug,
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> + FmtDebug,
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> + FmtDebug,
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> + FmtDebug,
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> + FmtDebug,
S: Stream<Item = E> + Send + Sync + 'static,
E: Serialize,
Ingest a stream of events into a dataset. Events will be ingested in chunks of 1000 items. If ingestion of a chunk fails, it will be retried with a backoff. Restrictions for field names (JSON object keys) can be reviewed here: https://www.axiom.co/docs/usage/field-restrictions.
sourcepub async fn try_ingest_stream<N, S, I, E>(
&self,
dataset_name: N,
stream: S
) -> Result<IngestStatus> where
N: Into<String> + FmtDebug,
S: Stream<Item = StdResult<I, E>> + Send + Sync + 'static,
I: Serialize,
E: Error + Send + Sync + 'static,
pub async fn try_ingest_stream<N, S, I, E>(
&self,
dataset_name: N,
stream: S
) -> Result<IngestStatus> where
N: Into<String> + FmtDebug,
S: Stream<Item = StdResult<I, E>> + Send + Sync + 'static,
I: Serialize,
E: Error + Send + Sync + 'static,
Like Client::ingest_stream
, but takes a stream that contains results.
sourcepub async fn query<N, O>(
&self,
dataset_name: N,
query: Query,
opts: O
) -> Result<QueryResult> where
N: Into<String> + FmtDebug,
O: Into<Option<QueryOptions>>,
pub async fn query<N, O>(
&self,
dataset_name: N,
query: Query,
opts: O
) -> Result<QueryResult> where
N: Into<String> + FmtDebug,
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> + FmtDebug,
D: TryInto<Duration, Error = Error> + FmtDebug,
pub async fn trim<N, D>(&self, dataset_name: N, duration: D) -> Result<TrimResult> where
N: Into<String> + FmtDebug,
D: TryInto<Duration, Error = Error> + FmtDebug,
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
.
Trait Implementations
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