Skip to main content

clientapi_pve/models/
cluster_ha_read_get_resources_response_data.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 ClusterHaReadGetResourcesResponseData {
16
17    /// HA resource may be migrated during automatic rebalancing.
18    #[serde(rename = "auto-rebalance", skip_serializing_if = "Option::is_none")]
19    pub auto_rebalance: Option<models::PveBoolean>,
20
21    /// Description.
22    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
23    pub comment: Option<String>,
24
25    /// Can be used to prevent concurrent modifications.
26    #[serde(rename = "digest")]
27    pub digest: String,
28
29    /// 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.
30    #[serde(rename = "failback", skip_serializing_if = "Option::is_none")]
31    pub failback: Option<models::PveBoolean>,
32
33    /// The HA group identifier.
34    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
35    pub group: Option<String>,
36
37    /// Maximal number of service relocate tries when a service fails to start.
38    #[serde(rename = "max_relocate", skip_serializing_if = "Option::is_none")]
39    pub max_relocate: Option<i64>,
40
41    /// Maximal number of tries to restart the service on a node after its start failed.
42    #[serde(rename = "max_restart", skip_serializing_if = "Option::is_none")]
43    pub max_restart: Option<i64>,
44
45    /// 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).
46    #[serde(rename = "sid")]
47    pub sid: String,
48
49    /// Requested resource state.
50    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
51    pub state: Option<models::PveStateEnum>,
52
53    /// The type of the resources.
54    #[serde(rename = "type")]
55    pub r#type: String,
56
57
58}
59
60impl ClusterHaReadGetResourcesResponseData {
61    pub fn new(digest: String, sid: String, r#type: String) -> ClusterHaReadGetResourcesResponseData {
62        ClusterHaReadGetResourcesResponseData {
63            
64            auto_rebalance: None,
65            
66            comment: None,
67            
68            digest,
69            
70            failback: None,
71            
72            group: None,
73            
74            max_relocate: None,
75            
76            max_restart: None,
77            
78            sid,
79            
80            state: None,
81            
82            r#type,
83            
84        }
85    }
86}
87
88