proxmox_api/generated/nodes/node/
spiceshell.rs1pub struct SpiceshellClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> SpiceshellClient<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, "/spiceshell"),
13 }
14 }
15}
16impl<T> SpiceshellClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Creates a SPICE shell."]
21 pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
22 let path = self.path.to_string();
23 self.client.post(&path, ¶ms)
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(skip_serializing_if = "Option::is_none", default)]
36 #[doc = "SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As reasonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI)."]
37 pub proxy: Option<String>,
38 #[serde(
39 flatten,
40 default,
41 skip_serializing_if = "::std::collections::HashMap::is_empty"
42 )]
43 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
44}
45#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
46pub enum Cmd {
47 #[serde(rename = "ceph_install")]
48 CephInstall,
49 #[serde(rename = "login")]
50 Login,
51 #[serde(rename = "upgrade")]
52 Upgrade,
53}
54impl Default for Cmd {
55 fn default() -> Self {
56 Self::Login
57 }
58}