pub struct AdminClient { /* private fields */ }Expand description
A high-level client for interacting with the Ora server admin endpoints.
Implementations§
Source§impl AdminClient
impl AdminClient
Sourcepub fn new(client: AdminServiceClient<Channel>) -> Self
pub fn new(client: AdminServiceClient<Channel>) -> Self
Create a new admin client from a gRPC client.
Sourcepub async fn add_job<J>(
&self,
definition: TypedJobDefinition<J>,
) -> Result<JobHandle<J>, AdminClientError>
pub async fn add_job<J>( &self, definition: TypedJobDefinition<J>, ) -> Result<JobHandle<J>, AdminClientError>
Add a new job to be executed.
Sourcepub async fn add_jobs<J>(
&self,
definitions: impl IntoIterator<Item = TypedJobDefinition<J>>,
) -> Result<Vec<JobHandle<J>>, AdminClientError>
pub async fn add_jobs<J>( &self, definitions: impl IntoIterator<Item = TypedJobDefinition<J>>, ) -> Result<Vec<JobHandle<J>>, AdminClientError>
Add multiple new jobs to be executed.
Sourcepub fn job(&self, job_id: Uuid) -> JobHandle
pub fn job(&self, job_id: Uuid) -> JobHandle
Create a job handle for a specific job.
Note that this method does not check if the job exists.
Sourcepub fn jobs_of_type<J>(
&self,
filter: JobFilter,
order_by: JobOrder,
) -> impl Stream<Item = Result<JobHandle<J>, AdminClientError>> + Send + Unpin + 'staticwhere
J: JobType,
pub fn jobs_of_type<J>(
&self,
filter: JobFilter,
order_by: JobOrder,
) -> impl Stream<Item = Result<JobHandle<J>, AdminClientError>> + Send + Unpin + 'staticwhere
J: JobType,
Retrieve a list of jobs of a specific type with a specific filter and order.
The returned job handles will have their details pre-fetched.
Sourcepub fn jobs(
&self,
filter: JobFilter,
order_by: JobOrder,
) -> impl Stream<Item = Result<JobHandle, AdminClientError>> + Send + Unpin + 'static
pub fn jobs( &self, filter: JobFilter, order_by: JobOrder, ) -> impl Stream<Item = Result<JobHandle, AdminClientError>> + Send + Unpin + 'static
Retrieve a list of jobs with a specific filter and order.
The returned job handles will have their details pre-fetched.
Sourcepub async fn job_count(
&self,
filter: JobFilter,
) -> Result<u64, AdminClientError>
pub async fn job_count( &self, filter: JobFilter, ) -> Result<u64, AdminClientError>
Count the number of jobs with a specific filter.
Sourcepub async fn job_count_of_type<J>(
&self,
filter: JobFilter,
) -> Result<u64, AdminClientError>where
J: JobType,
pub async fn job_count_of_type<J>(
&self,
filter: JobFilter,
) -> Result<u64, AdminClientError>where
J: JobType,
Count the number of jobs of a specific type with a specific filter.
Sourcepub async fn cancel_jobs(
&self,
filter: JobFilter,
) -> Result<Vec<JobHandle>, AdminClientError>
pub async fn cancel_jobs( &self, filter: JobFilter, ) -> Result<Vec<JobHandle>, AdminClientError>
Cancel jobs with a specific filter.
Returns handles to jobs that were successfully cancelled.
Sourcepub async fn delete_inactive_jobs(
&self,
filter: JobFilter,
) -> Result<Vec<Uuid>, AdminClientError>
pub async fn delete_inactive_jobs( &self, filter: JobFilter, ) -> Result<Vec<Uuid>, AdminClientError>
Delete inactive jobs and associated with a specific filter, returning the deleted job IDs.
Sourcepub async fn add_schedule(
&self,
schedule: ScheduleDefinition,
) -> Result<ScheduleHandle, AdminClientError>
pub async fn add_schedule( &self, schedule: ScheduleDefinition, ) -> Result<ScheduleHandle, AdminClientError>
Add a new schedule.
Sourcepub async fn add_schedules(
&self,
schedules: impl IntoIterator<Item = ScheduleDefinition>,
) -> Result<Vec<ScheduleHandle>, AdminClientError>
pub async fn add_schedules( &self, schedules: impl IntoIterator<Item = ScheduleDefinition>, ) -> Result<Vec<ScheduleHandle>, AdminClientError>
Add multiple new schedules.
Returns handles to the created schedules.
Sourcepub fn schedule(&self, schedule_id: Uuid) -> ScheduleHandle
pub fn schedule(&self, schedule_id: Uuid) -> ScheduleHandle
Create a new schedule handle for a specific schedule.
Note that this method does not check if the schedule exists.
Sourcepub fn schedules(
&self,
filter: ScheduleFilter,
order: ScheduleOrder,
) -> impl Stream<Item = Result<ScheduleHandle, AdminClientError>> + Send + Unpin + 'static
pub fn schedules( &self, filter: ScheduleFilter, order: ScheduleOrder, ) -> impl Stream<Item = Result<ScheduleHandle, AdminClientError>> + Send + Unpin + 'static
Retrieve a list of schedules with a specific filter and order.
The returned schedule handles will have their details pre-fetched.
Sourcepub async fn schedule_count(
&self,
filter: ScheduleFilter,
) -> Result<u64, AdminClientError>
pub async fn schedule_count( &self, filter: ScheduleFilter, ) -> Result<u64, AdminClientError>
Return the number of schedules that match a specific filter.
Sourcepub async fn cancel_schedules(
&self,
filter: ScheduleFilter,
cancel_jobs: bool,
) -> Result<ScheduleCancellationResult, AdminClientError>
pub async fn cancel_schedules( &self, filter: ScheduleFilter, cancel_jobs: bool, ) -> Result<ScheduleCancellationResult, AdminClientError>
Cancel schedules with a specific filter, optionally cancelling the jobs associated with them.
Trait Implementations§
Source§impl Clone for AdminClient
impl Clone for AdminClient
Source§fn clone(&self) -> AdminClient
fn clone(&self) -> AdminClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AdminClient
impl Debug for AdminClient
Source§impl From<AdminServiceClient<Channel>> for AdminClient
impl From<AdminServiceClient<Channel>> for AdminClient
Source§fn from(client: AdminServiceClient<Channel>) -> Self
fn from(client: AdminServiceClient<Channel>) -> Self
Auto Trait Implementations§
impl !Freeze for AdminClient
impl !RefUnwindSafe for AdminClient
impl Send for AdminClient
impl Sync for AdminClient
impl Unpin for AdminClient
impl !UnwindSafe for AdminClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<W> IntoExecutionHandler for W
impl<W> IntoExecutionHandler for W
Source§fn handler<J>(self) -> Arc<dyn ExecutionHandlerRaw + Send + Sync>where
Self: ExecutionHandler<J>,
J: JobType,
fn handler<J>(self) -> Arc<dyn ExecutionHandlerRaw + Send + Sync>where
Self: ExecutionHandler<J>,
J: JobType,
self into a [RawHandler] that can be registered
in workers.Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request