proxmox_api/generated/nodes/node/
execute.rs1pub struct ExecuteClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> ExecuteClient<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, "/execute"),
13 }
14 }
15}
16impl<T> ExecuteClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Execute multiple commands in order, root only."]
21 pub fn post(&self, params: PostParams) -> Result<Vec<PostOutputItems>, 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 PostOutputItems {
28 #[serde(
29 flatten,
30 default,
31 skip_serializing_if = "::std::collections::HashMap::is_empty"
32 )]
33 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
34}
35impl PostParams {
36 pub fn new(commands: String) -> Self {
37 Self {
38 commands,
39 additional_properties: Default::default(),
40 }
41 }
42}
43#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
44pub struct PostParams {
45 #[doc = "JSON encoded array of commands."]
46 #[doc = "JSON encoded array of commands, where each command is an object with the following properties:\n args: \\<object\\>\n\t A set of parameter names and their values.\n\n method: (GET|POST|PUT|DELETE)\n\t A method related to the API endpoint (GET, POST etc.).\n\n path: \\<string\\>\n\t A relative path to an API endpoint on this node.\n\n"]
47 pub commands: String,
48 #[serde(
49 flatten,
50 default,
51 skip_serializing_if = "::std::collections::HashMap::is_empty"
52 )]
53 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
54}