Skip to main content

incus_client/models/
instance_snapshot.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 InstanceSnapshot {
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 the instance is ephemeral (deleted on shutdown)
32    #[serde(rename = "ephemeral", skip_serializing_if = "Option::is_none")]
33    pub ephemeral: Option<bool>,
34    /// Expanded configuration (all profiles and local config merged)
35    #[serde(rename = "expanded_config", skip_serializing_if = "Option::is_none")]
36    pub expanded_config: Option<serde_json::Value>,
37    /// Expanded devices (all profiles and local devices merged)
38    #[serde(rename = "expanded_devices", skip_serializing_if = "Option::is_none")]
39    pub expanded_devices: Option<serde_json::Value>,
40    /// When the snapshot expires (gets auto-deleted)
41    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
42    pub expires_at: Option<chrono::DateTime<chrono::FixedOffset>>,
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    /// Snapshot name
47    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
48    pub name: Option<String>,
49    /// List of profiles applied to the instance
50    #[serde(rename = "profiles", skip_serializing_if = "Option::is_none")]
51    pub profiles: Option<Vec<String>>,
52    /// Size of the snapshot in bytes
53    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
54    pub size: Option<i64>,
55    /// Whether the instance currently has saved state on disk
56    #[serde(rename = "stateful", skip_serializing_if = "Option::is_none")]
57    pub stateful: Option<bool>,
58}
59
60impl InstanceSnapshot {
61    pub fn new() -> InstanceSnapshot {
62        InstanceSnapshot {
63            architecture: None,
64            config: None,
65            created_at: None,
66            description: None,
67            devices: None,
68            ephemeral: None,
69            expanded_config: None,
70            expanded_devices: None,
71            expires_at: None,
72            last_used_at: None,
73            name: None,
74            profiles: None,
75            size: None,
76            stateful: None,
77        }
78    }
79}
80