Job

Struct Job 

Source
pub struct Job {
Show 29 fields pub id: String, pub parent_id: Option<String>, pub job_type: JobType, pub stop: bool, pub region: String, pub namespace: String, pub name: String, pub priority: u32, pub all_at_once: bool, pub datacenters: Vec<String>, pub constraints: Vec<Constraint>, pub task_groups: Vec<TaskGroup>, pub update: Option<UpdateStrategy>, pub periodic: Option<PeriodicConfig>, pub parameterized_job: Option<ParameterizedJobConfig>, pub dispatched: bool, pub payload: Option<Vec<u8>>, pub reschedule: Option<ReschedulePolicy>, pub meta: Option<HashMap<String, String>>, pub consul_token: Option<String>, pub vault_token: Option<String>, pub status: Option<JobStatus>, pub status_description: Option<String>, pub stable: bool, pub version: u64, pub submit_time: i64, pub create_index: u64, pub modify_index: u64, pub job_modify_index: u64,
}
Expand description

The nomad job specification, representing a single job.

Fields§

§id: String

The ID of the current job.

§parent_id: Option<String>

The ID of the parent of the current job.

§job_type: JobType

The type of the nomad job. See JobType

§stop: bool

Whether the job should be stopped.

§region: String

The region of the job. Defaults to global.

§namespace: String

The namespace of the job. Defaults to default.

§name: String

The name of the job.

§priority: u32

The priority for the job. Valid values are between 1 and 100, both inclusive. Defaults to 50.

§all_at_once: bool

Controls whether the scheduler can make partial placements if optimistic scheduling resulted in an oversubscribed node. This does not control whether all allocations for the job, where all would be the desired count for each task group, must be placed atomically. This should only be used for special circumstances. Defaults to false.

§datacenters: Vec<String>

The nomad datacenters to place this job in.

§constraints: Vec<Constraint>

The placement constraints for this job. See also Constraint

§task_groups: Vec<TaskGroup>

The task groups for this job. See also TaskGroup

§update: Option<UpdateStrategy>

The update strategy for this job. See also UpdateStrategy

§periodic: Option<PeriodicConfig>

The periodic schedule for this job. See also PeriodicConfig

§parameterized_job: Option<ParameterizedJobConfig>

Specifies the job as a parameterized job such that it can be dispatched against a custom payload.

§dispatched: bool

Whether the job was dispatched as with a parameterized payload.

§payload: Option<Vec<u8>>

The payload may not be set when submitting a job but may appear in a dispatched job. The Payload will be a base64 encoded string containing the payload that the job was dispatched with. The payload has a maximum size of 16 KiB.

§reschedule: Option<ReschedulePolicy>

Specifies a reschedule policy to be applied to all task groups within the job. When specified both at the job level and the task group level, the reschedule blocks are merged, with the task group’s taking precedence.

§meta: Option<HashMap<String, String>>

A key-value map that annotates the task group with metadata opaque to nomad.

§consul_token: Option<String>

The consul token to use for authentication.

§vault_token: Option<String>

The vault token to authentication.

§status: Option<JobStatus>

The status of the job.

§status_description: Option<String>

The status description of the job.

§stable: bool

Specifies whether the job should be marked as stable or not.

§version: u64

Specifies the version of the job.

§submit_time: i64

The time the job was submitted as a unix timestamp.

§create_index: u64

The create index.

§modify_index: u64

The modify index.

§job_modify_index: u64

The modify index of the job.

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Job

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Job

Source§

fn default() -> Self

Return Job { id: Default::default(), parent_id: Default::default(), job_type: Default::default(), stop: Default::default(), region: ("global").into(), namespace: ("default").into(), name: Default::default(), priority: 50, all_at_once: Default::default(), datacenters: Default::default(), constraints: Default::default(), task_groups: Default::default(), update: Default::default(), periodic: Default::default(), parameterized_job: Default::default(), dispatched: Default::default(), payload: Default::default(), reschedule: Default::default(), meta: Default::default(), consul_token: Default::default(), vault_token: Default::default(), status: Default::default(), status_description: Default::default(), stable: Default::default(), version: Default::default(), submit_time: Default::default(), create_index: Default::default(), modify_index: Default::default(), job_modify_index: Default::default() }

Source§

impl<'de> Deserialize<'de> for Job

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Job

Source§

fn eq(&self, other: &Job) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Job

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Job

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnwindSafe for Job

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,