Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
add periodic stanza
Browse files Browse the repository at this point in the history
  • Loading branch information
nrdxp committed May 4, 2021
1 parent 04ad94b commit aab0d54
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
16 changes: 15 additions & 1 deletion iogo/src/nomad_event.rs
Expand Up @@ -603,7 +603,7 @@ pub struct Job {
#[serde(rename = "Multiregion")]
pub multiregion: Option<serde_json::Value>,
#[serde(rename = "Periodic")]
pub periodic: Option<serde_json::Value>,
pub periodic: Option<Periodic>,
#[serde(rename = "ParameterizedJob")]
pub parameterized_job: Option<serde_json::Value>,
#[serde(rename = "Dispatched")]
Expand Down Expand Up @@ -939,6 +939,20 @@ pub struct Vault {
pub change_signal: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Periodic {
#[serde(rename = "Enabled")]
pub enabled: bool,
#[serde(rename = "TimeZone")]
pub time_zone: String,
#[serde(rename = "SpecType")]
pub spec_type: String,
#[serde(rename = "Spec")]
pub spec: String,
#[serde(rename = "ProhibitOverlap")]
pub prohibit_overlap: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Update {
#[serde(rename = "Stagger")]
Expand Down
16 changes: 15 additions & 1 deletion lib/src/nomad.rs
Expand Up @@ -687,7 +687,7 @@ pub struct Job {
#[serde(rename = "Multiregion")]
pub multiregion: Option<serde_json::Value>,
#[serde(rename = "Periodic")]
pub periodic: Option<serde_json::Value>,
pub periodic: Option<Periodic>,
#[serde(rename = "ParameterizedJob")]
pub parameterized_job: Option<serde_json::Value>,
#[serde(rename = "Dispatched")]
Expand Down Expand Up @@ -904,6 +904,20 @@ pub struct CheckRestart {
pub ignore_warnings: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Periodic {
#[serde(rename = "Enabled")]
pub enabled: bool,
#[serde(rename = "TimeZone")]
pub time_zone: String,
#[serde(rename = "SpecType")]
pub spec_type: String,
#[serde(rename = "Spec")]
pub spec: String,
#[serde(rename = "ProhibitOverlap")]
pub prohibit_overlap: bool,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TaskElement {
#[serde(rename = "Name")]
Expand Down
16 changes: 16 additions & 0 deletions lib/src/types.rs
Expand Up @@ -397,6 +397,8 @@ pub struct Job {
pub job_type: String,
#[serde(rename = "Priority")]
pub priority: i64,
#[serde(rename = "Periodic")]
pub periodic: Option<Periodic>,
#[serde(rename = "Datacenters")]
pub datacenters: Vec<String>,
#[serde(rename = "TaskGroups")]
Expand All @@ -417,6 +419,20 @@ pub struct Job {
pub update: Option<serde_json::Value>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Periodic {
#[serde(rename = "Enabled")]
pub enabled: bool,
#[serde(rename = "TimeZone")]
pub time_zone: String,
#[serde(rename = "SpecType")]
pub spec_type: String,
#[serde(rename = "Spec")]
pub spec: String,
#[serde(rename = "ProhibitOverlap")]
pub prohibit_overlap: bool,
}

#[derive(Deserialize)]
pub struct ConsulAclTokenRead {
#[serde(rename = "SecretID")]
Expand Down

0 comments on commit aab0d54

Please sign in to comment.