pub struct NomadClient { /* private fields */ }Expand description
Nomad API client
Implementations§
Source§impl NomadClient
impl NomadClient
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Set ACL token
Sourcepub fn with_namespace(self, namespace: impl Into<String>) -> Self
pub fn with_namespace(self, namespace: impl Into<String>) -> Self
Set namespace
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
Set region
Sourcepub async fn list_jobs(&self) -> Result<Vec<JobListStub>>
pub async fn list_jobs(&self) -> Result<Vec<JobListStub>>
List all jobs
Sourcepub async fn submit_job(&self, job: &Job) -> Result<JobSubmitResponse>
pub async fn submit_job(&self, job: &Job) -> Result<JobSubmitResponse>
Submit a job
Sourcepub async fn stop_job(
&self,
job_id: &str,
purge: bool,
) -> Result<JobSubmitResponse>
pub async fn stop_job( &self, job_id: &str, purge: bool, ) -> Result<JobSubmitResponse>
Stop a job
Sourcepub async fn scale_job(
&self,
job_id: &str,
group: &str,
count: u32,
reason: Option<&str>,
) -> Result<ScaleResponse>
pub async fn scale_job( &self, job_id: &str, group: &str, count: u32, reason: Option<&str>, ) -> Result<ScaleResponse>
Scale a job’s task group
Sourcepub async fn get_allocations(
&self,
job_id: &str,
) -> Result<Vec<AllocationListStub>>
pub async fn get_allocations( &self, job_id: &str, ) -> Result<Vec<AllocationListStub>>
Get job allocations
Sourcepub async fn list_nodes(&self) -> Result<Vec<NodeListStub>>
pub async fn list_nodes(&self) -> Result<Vec<NodeListStub>>
List nodes
Trait Implementations§
Source§impl Clone for NomadClient
impl Clone for NomadClient
Source§fn clone(&self) -> NomadClient
fn clone(&self) -> NomadClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NomadClient
impl !RefUnwindSafe for NomadClient
impl Send for NomadClient
impl Sync for NomadClient
impl Unpin for NomadClient
impl !UnwindSafe for NomadClient
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
Mutably borrows from an owned value. Read more
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more