nomad_api_types/types/
deployment.rs

1/*
2 * This is an auto-generated file.
3 * Any manual changes may be overwritten without notice!
4 */
5
6use derive_builder::Builder;
7use serde::{Deserialize, Serialize};
8
9/// Deployment is used to serialize an deployment.
10///
11/// This struct was generated based on the Go types of the official Nomad API client.
12#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Builder, Default)]
13pub struct Deployment {
14    /// ID is a generated UUID for the deployment
15    #[serde(rename = "ID")]
16    #[builder(default)]
17    pub id: String,
18
19    /// Namespace is the namespace the deployment is created in
20    #[serde(rename = "Namespace")]
21    #[builder(default)]
22    pub namespace: String,
23
24    /// JobID is the job the deployment is created for
25    #[serde(rename = "JobID")]
26    #[builder(default)]
27    pub job_id: String,
28
29    /// JobVersion is the version of the job at which the deployment is tracking
30    #[serde(rename = "JobVersion")]
31    #[builder(default)]
32    pub job_version: u64,
33
34    /// JobModifyIndex is the ModifyIndex of the job which the deployment is
35    /// tracking.
36    #[serde(rename = "JobModifyIndex")]
37    #[builder(default)]
38    pub job_modify_index: u64,
39
40    /// JobSpecModifyIndex is the JobModifyIndex of the job which the
41    /// deployment is tracking.
42    #[serde(rename = "JobSpecModifyIndex")]
43    #[builder(default)]
44    pub job_spec_modify_index: u64,
45
46    /// JobCreateIndex is the create index of the job which the deployment is
47    /// tracking. It is needed so that if the job gets stopped and reran we can
48    /// present the correct list of deployments for the job and not old ones.
49    #[serde(rename = "JobCreateIndex")]
50    #[builder(default)]
51    pub job_create_index: u64,
52
53    /// IsMultiregion specifies if this deployment is part of a multi-region deployment
54    #[serde(rename = "IsMultiregion")]
55    #[builder(default)]
56    pub is_multiregion: bool,
57
58    /// TaskGroups is the set of task groups effected by the deployment and their
59    /// current deployment status.
60    #[serde(
61        rename = "TaskGroups",
62        deserialize_with = "crate::deserialize_null_as_default"
63    )]
64    #[builder(default)]
65    pub task_groups: std::collections::HashMap<String, super::DeploymentState>,
66
67    /// The status of the deployment
68    #[serde(rename = "Status")]
69    #[builder(default)]
70    pub status: String,
71
72    /// StatusDescription allows a human readable description of the deployment
73    /// status.
74    #[serde(rename = "StatusDescription")]
75    #[builder(default)]
76    pub status_description: String,
77
78    #[serde(rename = "CreateIndex")]
79    #[builder(default)]
80    pub create_index: u64,
81
82    #[serde(rename = "ModifyIndex")]
83    #[builder(default)]
84    pub modify_index: u64,
85
86    /// Creation and modification times, stored as UnixNano
87    #[serde(rename = "CreateTime")]
88    #[builder(default)]
89    pub create_time: i64,
90
91    #[serde(rename = "ModifyTime")]
92    #[builder(default)]
93    pub modify_time: i64,
94}
95impl Deployment {
96    pub fn builder() -> DeploymentBuilder {
97        DeploymentBuilder::default()
98    }
99}