Skip to main content

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

1#[derive(Debug, Clone)]
2pub struct TemplateClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> TemplateClient<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, "/template"),
14        }
15    }
16}
17impl<T> TemplateClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Create a Template."]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Allocate\"])"]
24    #[doc = "You need 'VM.Allocate' permissions on /vms/{vmid}"]
25    pub async fn post(&self) -> Result<(), T::Error> {
26        let path = self.path.to_string();
27        self.client.post(&path, &()).await
28    }
29}