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: StringThe ID of the current job.
parent_id: Option<String>The ID of the parent of the current job.
job_type: JobTypeThe type of the nomad job. See JobType
stop: boolWhether the job should be stopped.
region: StringThe region of the job. Defaults to global.
namespace: StringThe namespace of the job. Defaults to default.
name: StringThe name of the job.
priority: u32The priority for the job. Valid values are between 1 and 100, both inclusive. Defaults to 50.
all_at_once: boolControls 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: boolWhether 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: boolSpecifies whether the job should be marked as stable or not.
version: u64Specifies the version of the job.
submit_time: i64The time the job was submitted as a unix timestamp.
create_index: u64The create index.
modify_index: u64The modify index.
job_modify_index: u64The modify index of the job.
Trait Implementations§
Source§impl Default for Job
impl Default for Job
Source§fn default() -> Self
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() }