1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* Proxmox Virtual Environment API
*
* Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
*
* The version of the OpenAPI document: 9.x
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClusterHaReadGetResourcesResponseData {
/// HA resource may be migrated during automatic rebalancing.
#[serde(rename = "auto-rebalance", skip_serializing_if = "Option::is_none")]
pub auto_rebalance: Option<models::PveBoolean>,
/// Description.
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
/// Can be used to prevent concurrent modifications.
#[serde(rename = "digest")]
pub digest: String,
/// The HA resource is automatically migrated to the node with the highest priority according to their node affinity rule, if a node with a higher priority than the current node comes online.
#[serde(rename = "failback", skip_serializing_if = "Option::is_none")]
pub failback: Option<models::PveBoolean>,
/// The HA group identifier.
#[serde(rename = "group", skip_serializing_if = "Option::is_none")]
pub group: Option<String>,
/// Maximal number of service relocate tries when a service fails to start.
#[serde(rename = "max_relocate", skip_serializing_if = "Option::is_none")]
pub max_relocate: Option<i64>,
/// Maximal number of tries to restart the service on a node after its start failed.
#[serde(rename = "max_restart", skip_serializing_if = "Option::is_none")]
pub max_restart: Option<i64>,
/// HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).
#[serde(rename = "sid")]
pub sid: String,
/// Requested resource state.
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
pub state: Option<models::PveStateEnum>,
/// The type of the resources.
#[serde(rename = "type")]
pub r#type: String,
}
impl ClusterHaReadGetResourcesResponseData {
pub fn new(digest: String, sid: String, r#type: String) -> ClusterHaReadGetResourcesResponseData {
ClusterHaReadGetResourcesResponseData {
auto_rebalance: None,
comment: None,
digest,
failback: None,
group: None,
max_relocate: None,
max_restart: None,
sid,
state: None,
r#type,
}
}
}