Skip to main content

incus_client/models/
instance.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 Instance {
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 creation timestamp
23    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
24    pub created_at: Option<chrono::DateTime<chrono::FixedOffset>>,
25    /// Instance description
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    /// Instance devices (see doc/instances.md)
29    #[serde(rename = "devices", skip_serializing_if = "Option::is_none")]
30    pub devices: Option<serde_json::Value>,
31    /// Whether only the instances disk should be restored
32    #[serde(rename = "disk_only", skip_serializing_if = "Option::is_none")]
33    pub disk_only: Option<bool>,
34    /// Whether the instance is ephemeral (deleted on shutdown)
35    #[serde(rename = "ephemeral", skip_serializing_if = "Option::is_none")]
36    pub ephemeral: Option<bool>,
37    /// Expanded configuration (all profiles and local config merged)
38    #[serde(rename = "expanded_config", skip_serializing_if = "Option::is_none")]
39    pub expanded_config: Option<serde_json::Value>,
40    /// Expanded devices (all profiles and local devices merged)
41    #[serde(rename = "expanded_devices", skip_serializing_if = "Option::is_none")]
42    pub expanded_devices: Option<serde_json::Value>,
43    /// Last start timestamp
44    #[serde(rename = "last_used_at", skip_serializing_if = "Option::is_none")]
45    pub last_used_at: Option<chrono::DateTime<chrono::FixedOffset>>,
46    /// What cluster member this instance is located on
47    #[serde(rename = "location", skip_serializing_if = "Option::is_none")]
48    pub location: Option<String>,
49    /// Instance name
50    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
51    pub name: Option<String>,
52    /// List of profiles applied to the instance
53    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
54    pub profiles: Option<Vec<String>>,
55    /// Instance project name
56    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
57    pub project: Option<String>,
58    /// If set, instance will be restored to the provided snapshot name
59    #[serde(rename = "restore", skip_serializing_if = "Option::is_none")]
60    pub restore: Option<String>,
61    /// Whether the instance currently has saved state on disk
62    #[serde(rename = "stateful", skip_serializing_if = "Option::is_none")]
63    pub stateful: Option<bool>,
64    /// Instance status (see instance_state)
65    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
66    pub status: Option<String>,
67    #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")]
68    pub status_code: Option<i64>,
69    /// The type of instance (container or virtual-machine)
70    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
71    pub r#type: Option<String>,
72}
73
74impl Instance {
75    pub fn new() -> Instance {
76        Instance {
77            architecture: None,
78            config: None,
79            created_at: None,
80            description: None,
81            devices: None,
82            disk_only: None,
83            ephemeral: None,
84            expanded_config: None,
85            expanded_devices: None,
86            last_used_at: None,
87            location: None,
88            name: None,
89            profiles: None,
90            project: None,
91            restore: None,
92            stateful: None,
93            status: None,
94            status_code: None,
95            r#type: None,
96        }
97    }
98}
99