Skip to main content

clientapi_pve/models/
cluster_ha_update_rule_request.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClusterHaUpdateRuleRequest {
16
17    /// 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').
18    #[serde(rename = "affinity", skip_serializing_if = "Option::is_none")]
19    pub affinity: Option<models::PveAffinityEnum>,
20
21    /// HA rule description.
22    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
23    pub comment: Option<String>,
24
25    /// A list of settings you want to delete.
26    #[serde(rename = "delete", skip_serializing_if = "Option::is_none")]
27    pub delete: Option<String>,
28
29    /// Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications.
30    #[serde(rename = "digest", skip_serializing_if = "Option::is_none")]
31    pub digest: Option<String>,
32
33    /// Whether the HA rule is disabled.
34    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
35    pub disable: Option<models::PveBoolean>,
36
37    /// 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.
38    #[serde(rename = "nodes", skip_serializing_if = "Option::is_none")]
39    pub nodes: Option<String>,
40
41    /// 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).
42    #[serde(rename = "resources", skip_serializing_if = "Option::is_none")]
43    pub resources: Option<String>,
44
45    /// 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. 
46    #[serde(rename = "strict", skip_serializing_if = "Option::is_none")]
47    pub strict: Option<models::PveBoolean>,
48
49    /// HA rule type.
50    #[serde(rename = "type")]
51    pub r#type: models::PveCauseEnum,
52
53
54}
55
56impl ClusterHaUpdateRuleRequest {
57    pub fn new(r#type: models::PveCauseEnum) -> ClusterHaUpdateRuleRequest {
58        ClusterHaUpdateRuleRequest {
59            
60            affinity: None,
61            
62            comment: None,
63            
64            delete: None,
65            
66            digest: None,
67            
68            disable: None,
69            
70            nodes: None,
71            
72            resources: None,
73            
74            strict: None,
75            
76            r#type,
77            
78        }
79    }
80}
81
82