Skip to main content

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