proxmox_api/generated/nodes/node/
execute.rs1#[derive(Debug, Clone)]
2pub struct ExecuteClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> ExecuteClient<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, "/execute"),
14 }
15 }
16}
17impl<T> ExecuteClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Execute multiple commands in order, root only."]
22 #[doc = ""]
23 pub async fn post(&self, params: PostParams) -> Result<Vec<PostOutputItems>, T::Error> {
24 let path = self.path.to_string();
25 let optional_vec: Option<Vec<PostOutputItems>> = self.client.post(&path, ¶ms).await?;
26 Ok(optional_vec.unwrap_or_default())
27 }
28}
29#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
30pub struct PostOutputItems {
31 #[serde(
32 flatten,
33 default,
34 skip_serializing_if = "::std::collections::HashMap::is_empty"
35 )]
36 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
37}
38impl PostParams {
39 pub fn new(commands: String) -> Self {
40 Self {
41 commands,
42 additional_properties: ::std::default::Default::default(),
43 }
44 }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
47pub struct PostParams {
48 #[doc = "JSON encoded array of commands."]
49 #[doc = ""]
50 #[doc = "JSON encoded array of commands, where each command is an object with the following properties:"]
51 #[doc = ""]
52 #[doc = "args: \\\\<object\\\\>"]
53 #[doc = ""]
54 #[doc = "A set of parameter names and their values."]
55 #[doc = ""]
56 #[doc = "method: (GET|POST|PUT|DELETE)"]
57 #[doc = ""]
58 #[doc = "A method related to the API endpoint (GET, POST etc.)."]
59 #[doc = ""]
60 #[doc = "path: \\\\<string\\\\>"]
61 #[doc = ""]
62 #[doc = "A relative path to an API endpoint on this node."]
63 #[doc = ""]
64 pub commands: String,
65 #[serde(
66 flatten,
67 default,
68 skip_serializing_if = "::std::collections::HashMap::is_empty"
69 )]
70 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
71}