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
/*
* 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 ClusterHaCreateRuleRequest {
/// Describes whether the HA resources are supposed to be kept on the same node ('positive'), or are supposed to be kept on separate nodes ('negative').
#[serde(rename = "affinity", skip_serializing_if = "Option::is_none")]
pub affinity: Option<models::PveAffinityEnum>,
/// HA rule description.
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
/// Whether the HA rule is disabled.
#[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
pub disable: Option<models::PveBoolean>,
/// List of cluster node members, where a priority can be given to each node. A resource will run on the available nodes with the highest priority. If there are more nodes in the highest priority class, the resources will get distributed to those nodes. The priorities have a relative meaning only. The higher the number, the higher the priority.
#[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
pub nodes: Option<String>,
/// List of HA resource IDs. This consists of a list of resource types followed by a resource specific name separated with a colon (example: vm:100,ct:101).
#[serde(rename = "resources")]
pub resources: String,
/// HA rule identifier.
#[serde(rename = "rule")]
pub rule: String,
/// Describes whether the node affinity rule is strict or non-strict. A non-strict node affinity rule makes resources prefer to be on the defined nodes. If none of the defined nodes are available, the resource may run on any other node. A strict node affinity rule makes resources be restricted to the defined nodes. If none of the defined nodes are available, the resource will be stopped.
#[serde(rename = "strict", skip_serializing_if = "Option::is_none")]
pub strict: Option<models::PveBoolean>,
/// HA rule type.
#[serde(rename = "type")]
pub r#type: models::PveCauseEnum,
}
impl ClusterHaCreateRuleRequest {
pub fn new(resources: String, rule: String, r#type: models::PveCauseEnum) -> ClusterHaCreateRuleRequest {
ClusterHaCreateRuleRequest {
affinity: None,
comment: None,
disable: None,
nodes: None,
resources,
rule,
strict: None,
r#type,
}
}
}