proxmox_api/generated/nodes/node/ceph/
restart.rs1#[derive(Debug, Clone)]
2pub struct RestartClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> RestartClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/restart"),
14 }
15 }
16}
17impl<T> RestartClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Restart ceph services."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/\", [\"Sys.Modify\"])"]
24 pub async fn post(&self, params: PostParams) -> Result<String, T::Error> {
25 let path = self.path.to_string();
26 self.client.post(&path, ¶ms).await
27 }
28}
29#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
30pub struct PostParams {
31 #[serde(skip_serializing_if = "Option::is_none", default)]
32 #[doc = "Ceph service name."]
33 #[doc = ""]
34 pub service: Option<ServiceStr>,
35 #[serde(
36 flatten,
37 default,
38 skip_serializing_if = "::std::collections::HashMap::is_empty"
39 )]
40 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
41}
42#[derive(Debug, Clone, PartialEq, PartialOrd)]
43pub struct ServiceStr {
44 value: String,
45}
46impl crate::types::bounded_string::BoundedString for ServiceStr {
47 const MIN_LENGTH: Option<usize> = None::<usize>;
48 const MAX_LENGTH: Option<usize> = None::<usize>;
49 const DEFAULT: Option<&'static str> = Some("ceph.target");
50 const PATTERN: Option<&'static str> =
51 Some("(mon|mds|osd|mgr)(\\.[a-zA-Z0-9]([a-zA-Z0-9\\-]*[a-zA-Z0-9])?)?");
52 const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"(mon|mds|osd|mgr)(\\.[a-zA-Z0-9]([a-zA-Z0-9\\-]*[a-zA-Z0-9])?)?\" and no length constraints";
53 fn get_value(&self) -> &str {
54 &self.value
55 }
56 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
57 Self::validate(&value)?;
58 Ok(Self { value })
59 }
60}
61impl std::convert::TryFrom<String> for ServiceStr {
62 type Error = crate::types::bounded_string::BoundedStringError;
63 fn try_from(value: String) -> Result<Self, Self::Error> {
64 crate::types::bounded_string::BoundedString::new(value)
65 }
66}
67impl ::serde::Serialize for ServiceStr {
68 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
69 where
70 S: ::serde::Serializer,
71 {
72 crate::types::bounded_string::serialize_bounded_string(self, serializer)
73 }
74}
75impl<'de> ::serde::Deserialize<'de> for ServiceStr {
76 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
77 where
78 D: ::serde::Deserializer<'de>,
79 {
80 crate::types::bounded_string::deserialize_bounded_string(deserializer)
81 }
82}