Skip to main content

incus_client/models/
instance_exec_post.rs

1/*
2 * Incus external REST API
3 *
4 * This is the REST API used by all Incus clients. Internal endpoints aren't included in this documentation.  The Incus API is available over both a local unix+http and remote https API. Authentication for local users relies on group membership and access to the unix socket. For remote users, the default authentication method is TLS client certificates.
5 *
6 * The version of the OpenAPI document: 1.0
7 * Contact: lxc-devel@lists.linuxcontainers.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InstanceExecPost {
16    /// Command and its arguments
17    #[serde(rename = "command", skip_serializing_if = "Option::is_none")]
18    pub command: Option<Vec<String>>,
19    /// Current working directory for the command
20    #[serde(rename = "cwd", skip_serializing_if = "Option::is_none")]
21    pub cwd: Option<String>,
22    /// Additional environment to pass to the command
23    #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
24    pub environment: Option<std::collections::HashMap<String, String>>,
25    /// GID of the user to spawn the command as
26    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
27    pub group: Option<i32>,
28    /// Terminal height in rows (for interactive)
29    #[serde(rename = "height", skip_serializing_if = "Option::is_none")]
30    pub height: Option<i64>,
31    /// Whether the command is to be spawned in interactive mode (singled PTY instead of 3 PIPEs)
32    #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")]
33    pub interactive: Option<bool>,
34    /// Whether to capture the output for later download (requires non-interactive)
35    #[serde(rename = "record-output", skip_serializing_if = "Option::is_none")]
36    pub record_output: Option<bool>,
37    /// UID of the user to spawn the command as
38    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
39    pub user: Option<i32>,
40    /// Whether to wait for all websockets to be connected before spawning the command
41    #[serde(rename = "wait-for-websocket", skip_serializing_if = "Option::is_none")]
42    pub wait_for_websocket: Option<bool>,
43    /// Terminal width in characters (for interactive)
44    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
45    pub width: Option<i64>,
46}
47
48impl InstanceExecPost {
49    pub fn new() -> InstanceExecPost {
50        InstanceExecPost {
51            command: None,
52            cwd: None,
53            environment: None,
54            group: None,
55            height: None,
56            interactive: None,
57            record_output: None,
58            user: None,
59            wait_for_websocket: None,
60            width: None,
61        }
62    }
63}
64