proxmox_api/generated/nodes/node/
vncshell.rs

1pub struct VncshellClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> VncshellClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/vncshell"),
13        }
14    }
15}
16impl<T> VncshellClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Creates a VNC Shell proxy."]
21    pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.post(&path, &params)
24    }
25}
26#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
27pub struct PostParams {
28    #[serde(skip_serializing_if = "Option::is_none", default)]
29    #[doc = "Run specific command or default to login (requires 'root@pam')"]
30    pub cmd: Option<Cmd>,
31    #[serde(rename = "cmd-opts")]
32    #[serde(skip_serializing_if = "Option::is_none", default)]
33    #[doc = "Add parameters to a command. Encoded as null terminated strings."]
34    pub cmd_opts: Option<String>,
35    #[serde(
36        serialize_with = "crate::types::serialize_int_optional",
37        deserialize_with = "crate::types::deserialize_int_optional"
38    )]
39    #[serde(skip_serializing_if = "Option::is_none", default)]
40    #[doc = "sets the height of the console in pixels."]
41    pub height: Option<u64>,
42    #[serde(
43        serialize_with = "crate::types::serialize_bool_optional",
44        deserialize_with = "crate::types::deserialize_bool_optional"
45    )]
46    #[serde(skip_serializing_if = "Option::is_none", default)]
47    #[doc = "use websocket instead of standard vnc."]
48    pub websocket: Option<bool>,
49    #[serde(
50        serialize_with = "crate::types::serialize_int_optional",
51        deserialize_with = "crate::types::deserialize_int_optional"
52    )]
53    #[serde(skip_serializing_if = "Option::is_none", default)]
54    #[doc = "sets the width of the console in pixels."]
55    pub width: Option<u64>,
56    #[serde(
57        flatten,
58        default,
59        skip_serializing_if = "::std::collections::HashMap::is_empty"
60    )]
61    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
62}
63#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
64pub enum Cmd {
65    #[serde(rename = "ceph_install")]
66    CephInstall,
67    #[serde(rename = "login")]
68    Login,
69    #[serde(rename = "upgrade")]
70    Upgrade,
71}
72impl Default for Cmd {
73    fn default() -> Self {
74        Self::Login
75    }
76}