clientapi_pve/models/cluster_ha_create_resources_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 ClusterHaCreateResourcesRequest {
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 /// Automatically migrate HA resource to the node with the highest priority according to their node affinity rules, if a node with a higher priority than the current node comes online.
26 #[serde(rename = "failback", skip_serializing_if = "Option::is_none")]
27 pub failback: Option<models::PveBoolean>,
28
29 /// The HA group identifier.
30 #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
31 pub group: Option<String>,
32
33 /// Maximal number of resource relocate tries when a resource fails to start.
34 #[serde(rename = "max_relocate", skip_serializing_if = "Option::is_none")]
35 pub max_relocate: Option<i64>,
36
37 /// Maximal number of tries to restart the resource on a node after its start failed. When reached, the HA manager will try to relocate the resource to an eligible node.
38 #[serde(rename = "max_restart", skip_serializing_if = "Option::is_none")]
39 pub max_restart: Option<i64>,
40
41 /// 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).
42 #[serde(rename = "sid")]
43 pub sid: String,
44
45 /// Requested resource state. The CRM reads this state and acts accordingly. Please note that `enabled` is just an alias for `started`. `started`;; The CRM tries to start the resource. Service state is set to `started` after successful start. On node failures, or when start fails, it tries to recover the resource. If everything fails, service state it set to `error`. `stopped`;; The CRM tries to keep the resource in `stopped` state, but it still tries to relocate the resources on node failures. `disabled`;; The CRM tries to put the resource in `stopped` state, but does not try to relocate the resources on node failures. The main purpose of this state is error recovery, because it is the only way to move a resource out of the `error` state. `ignored`;; The resource gets removed from the manager status and so the CRM and the LRM do not touch the resource anymore. All {pve} API calls affecting this resource will be executed, directly bypassing the HA stack. CRM commands will be thrown away while the resource is in this state. The resource will not get relocated on node failures.
46 #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
47 pub state: Option<models::PveStateEnum>,
48
49 /// Resource type.
50 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
51 pub r#type: Option<models::PveClusterHaTypeTypeEnum>,
52
53
54}
55
56impl ClusterHaCreateResourcesRequest {
57 pub fn new(sid: String) -> ClusterHaCreateResourcesRequest {
58 ClusterHaCreateResourcesRequest {
59
60 auto_rebalance: None,
61
62 comment: None,
63
64 failback: None,
65
66 group: None,
67
68 max_relocate: None,
69
70 max_restart: None,
71
72 sid,
73
74 state: None,
75
76 r#type: None,
77
78 }
79 }
80}
81
82