Skip to main content

proxmox_api/generated/nodes/node/lxc/vmid/
termproxy.rs

1#[derive(Debug, Clone)]
2pub struct TermproxyClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> TermproxyClient<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, "/termproxy"),
14        }
15    }
16}
17impl<T> TermproxyClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Creates a TCP proxy connection."]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Console\"])"]
24    pub async fn post(&self) -> Result<PostOutput, T::Error> {
25        let path = self.path.to_string();
26        self.client.post(&path, &()).await
27    }
28}
29impl PostOutput {
30    pub fn new(port: i64, ticket: String, upid: String, user: String) -> Self {
31        Self {
32            port,
33            ticket,
34            upid,
35            user,
36        }
37    }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct PostOutput {
41    #[serde(
42        serialize_with = "crate::types::serialize_int",
43        deserialize_with = "crate::types::deserialize_int"
44    )]
45    pub port: i64,
46    pub ticket: String,
47    pub upid: String,
48    pub user: String,
49}