Skip to main content

incus_client/models/
instances_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 InstancesPost {
16    /// Architecture name
17    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
18    pub architecture: Option<String>,
19    /// Instance configuration (see doc/instances.md)
20    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
21    pub config: Option<serde_json::Value>,
22    /// Instance description
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// Instance devices (see doc/instances.md)
26    #[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
27    pub devices: Option<serde_json::Value>,
28    /// Whether only the instances disk should be restored
29    #[serde(rename = "disk_only", skip_serializing_if = "Option::is_none")]
30    pub disk_only: Option<bool>,
31    /// Whether the instance is ephemeral (deleted on shutdown)
32    #[serde(rename = "ephemeral", skip_serializing_if = "Option::is_none")]
33    pub ephemeral: Option<bool>,
34    /// Cloud instance type (AWS, GCP, Azure, ...) to emulate with limits
35    #[serde(rename = "instance_type", skip_serializing_if = "Option::is_none")]
36    pub instance_type: Option<String>,
37    /// Instance name
38    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
39    pub name: Option<String>,
40    /// List of profiles applied to the instance
41    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
42    pub profiles: Option<Vec<String>>,
43    /// If set, instance will be restored to the provided snapshot name
44    #[serde(rename = "restore", skip_serializing_if = "Option::is_none")]
45    pub restore: Option<String>,
46    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
47    pub source: Option<Box<models::InstanceSource>>,
48    /// Whether to start the instance after creation
49    #[serde(rename = "start", skip_serializing_if = "Option::is_none")]
50    pub start: Option<bool>,
51    /// Whether the instance currently has saved state on disk
52    #[serde(rename = "stateful", skip_serializing_if = "Option::is_none")]
53    pub stateful: Option<bool>,
54    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
55    pub r#type: Option<String>,
56}
57
58impl InstancesPost {
59    pub fn new() -> InstancesPost {
60        InstancesPost {
61            architecture: None,
62            config: None,
63            description: None,
64            devices: None,
65            disk_only: None,
66            ephemeral: None,
67            instance_type: None,
68            name: None,
69            profiles: None,
70            restore: None,
71            source: None,
72            start: None,
73            stateful: None,
74            r#type: None,
75        }
76    }
77}
78