proxmox_api/generated/nodes/node/lxc/vmid/
spiceproxy.rs1#[derive(Debug, Clone)]
2pub struct SpiceproxyClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> SpiceproxyClient<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, "/spiceproxy"),
14 }
15 }
16}
17impl<T> SpiceproxyClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Returns a SPICE configuration to connect to the CT."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Console\"])"]
24 pub async fn post(&self, params: PostParams) -> Result<PostOutput, T::Error> {
25 let path = self.path.to_string();
26 self.client.post(&path, ¶ms).await
27 }
28}
29impl PostOutput {
30 pub fn new(host: String, password: String, proxy: String, tls_port: i64, ty: String) -> Self {
31 Self {
32 host,
33 password,
34 proxy,
35 tls_port,
36 ty,
37 additional_properties: ::std::default::Default::default(),
38 }
39 }
40}
41#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
42pub struct PostOutput {
43 pub host: String,
44 pub password: String,
45 pub proxy: String,
46 #[serde(rename = "tls-port")]
47 #[serde(
48 serialize_with = "crate::types::serialize_int",
49 deserialize_with = "crate::types::deserialize_int"
50 )]
51 pub tls_port: i64,
52 #[serde(rename = "type")]
53 pub ty: String,
54 #[serde(
55 flatten,
56 default,
57 skip_serializing_if = "::std::collections::HashMap::is_empty"
58 )]
59 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
60}
61#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
62pub struct PostParams {
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[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)."]
65 #[doc = ""]
66 pub proxy: Option<String>,
67 #[serde(
68 flatten,
69 default,
70 skip_serializing_if = "::std::collections::HashMap::is_empty"
71 )]
72 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
73}