proxmox_api/generated/cluster/replication/
id.rs

1pub struct IdClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> IdClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str, id: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}/{}", parent_path, id),
13        }
14    }
15}
16impl<T> IdClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Mark replication job for removal."]
21    pub fn delete(&self, params: DeleteParams) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &params)
24    }
25}
26impl<T> IdClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Read replication job configuration."]
31    pub fn get(&self) -> Result<GetOutput, T::Error> {
32        let path = self.path.to_string();
33        self.client.get(&path, &())
34    }
35}
36impl<T> IdClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update replication job configuration."]
41    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42        let path = self.path.to_string();
43        self.client.put(&path, &params)
44    }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct DeleteParams {
48    #[serde(
49        serialize_with = "crate::types::serialize_bool_optional",
50        deserialize_with = "crate::types::deserialize_bool_optional"
51    )]
52    #[serde(skip_serializing_if = "Option::is_none", default)]
53    #[doc = "Will remove the jobconfig entry, but will not cleanup."]
54    pub force: Option<bool>,
55    #[serde(
56        serialize_with = "crate::types::serialize_bool_optional",
57        deserialize_with = "crate::types::deserialize_bool_optional"
58    )]
59    #[serde(skip_serializing_if = "Option::is_none", default)]
60    #[doc = "Keep replicated data at target (do not remove)."]
61    pub keep: Option<bool>,
62    #[serde(
63        flatten,
64        default,
65        skip_serializing_if = "::std::collections::HashMap::is_empty"
66    )]
67    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
68}
69#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
70pub struct GetOutput {
71    #[serde(
72        flatten,
73        default,
74        skip_serializing_if = "::std::collections::HashMap::is_empty"
75    )]
76    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
77}
78#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
79pub struct PutParams {
80    #[serde(skip_serializing_if = "Option::is_none", default)]
81    #[doc = "Description."]
82    pub comment: Option<String>,
83    #[serde(skip_serializing_if = "Option::is_none", default)]
84    #[doc = "A list of settings you want to delete."]
85    pub delete: Option<String>,
86    #[serde(skip_serializing_if = "Option::is_none", default)]
87    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
88    pub digest: Option<String>,
89    #[serde(
90        serialize_with = "crate::types::serialize_bool_optional",
91        deserialize_with = "crate::types::deserialize_bool_optional"
92    )]
93    #[serde(skip_serializing_if = "Option::is_none", default)]
94    #[doc = "Flag to disable/deactivate the entry."]
95    pub disable: Option<bool>,
96    #[serde(
97        serialize_with = "crate::types::serialize_number_optional",
98        deserialize_with = "crate::types::deserialize_number_optional"
99    )]
100    #[serde(skip_serializing_if = "Option::is_none", default)]
101    #[doc = "Rate limit in mbps (megabytes per second) as floating point number."]
102    pub rate: Option<f64>,
103    #[serde(skip_serializing_if = "Option::is_none", default)]
104    #[doc = "Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file."]
105    pub remove_job: Option<RemoveJob>,
106    #[serde(skip_serializing_if = "Option::is_none", default)]
107    #[doc = "Storage replication schedule. The format is a subset of `systemd` calendar events."]
108    pub schedule: Option<String>,
109    #[serde(skip_serializing_if = "Option::is_none", default)]
110    #[doc = "For internal use, to detect if the guest was stolen."]
111    pub source: Option<String>,
112    #[serde(
113        flatten,
114        default,
115        skip_serializing_if = "::std::collections::HashMap::is_empty"
116    )]
117    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
118}
119#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
120pub enum RemoveJob {
121    #[serde(rename = "full")]
122    Full,
123    #[serde(rename = "local")]
124    Local,
125}