Skip to main content

incus_client/models/
instance_source.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 InstanceSource {
16    /// Image alias name (for image source)
17    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
18    pub alias: Option<String>,
19    /// Whether to ignore errors when copying (e.g. for volatile files)
20    #[serde(rename = "allow_inconsistent", skip_serializing_if = "Option::is_none")]
21    pub allow_inconsistent: Option<bool>,
22    /// Base image fingerprint (for faster migration)
23    #[serde(rename = "base-image", skip_serializing_if = "Option::is_none")]
24    pub base_image: Option<String>,
25    /// Certificate (for remote images or migration)
26    #[serde(rename = "certificate", skip_serializing_if = "Option::is_none")]
27    pub certificate: Option<String>,
28    /// Image fingerprint (for image source)
29    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
30    pub fingerprint: Option<String>,
31    /// Whether the copy should skip the snapshots (for copy)
32    #[serde(rename = "instance_only", skip_serializing_if = "Option::is_none")]
33    pub instance_only: Option<bool>,
34    /// Whether this is a live migration (for migration)
35    #[serde(rename = "live", skip_serializing_if = "Option::is_none")]
36    pub live: Option<bool>,
37    /// Whether to use pull or push mode (for migration)
38    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
39    pub mode: Option<String>,
40    /// Remote operation URL (for migration)
41    #[serde(rename = "operation", skip_serializing_if = "Option::is_none")]
42    pub operation: Option<String>,
43    /// Source project name (for copy and local image)
44    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
45    pub project: Option<String>,
46    /// Image filters (for image source)
47    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
48    pub properties: Option<std::collections::HashMap<String, String>>,
49    /// Protocol name (for remote image)
50    #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")]
51    pub protocol: Option<String>,
52    /// Whether this is refreshing an existing instance (for migration and copy)
53    #[serde(rename = "refresh", skip_serializing_if = "Option::is_none")]
54    pub refresh: Option<bool>,
55    /// Whether to exclude source snapshots earlier than latest target snapshot
56    #[serde(rename = "refresh_exclude_older", skip_serializing_if = "Option::is_none")]
57    pub refresh_exclude_older: Option<bool>,
58    /// Remote server secret (for remote private images)
59    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
60    pub secret: Option<String>,
61    /// Map of migration websockets (for migration)
62    #[serde(rename = "secrets", skip_serializing_if = "Option::is_none")]
63    pub secrets: Option<std::collections::HashMap<String, String>>,
64    /// Remote server URL (for remote images)
65    #[serde(rename = "server", skip_serializing_if = "Option::is_none")]
66    pub server: Option<String>,
67    /// Existing instance name or snapshot (for copy)
68    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
69    pub source: Option<String>,
70    /// Source type
71    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
72    pub r#type: Option<String>,
73}
74
75impl InstanceSource {
76    pub fn new() -> InstanceSource {
77        InstanceSource {
78            alias: None,
79            allow_inconsistent: None,
80            base_image: None,
81            certificate: None,
82            fingerprint: None,
83            instance_only: None,
84            live: None,
85            mode: None,
86            operation: None,
87            project: None,
88            properties: None,
89            protocol: None,
90            refresh: None,
91            refresh_exclude_older: None,
92            secret: None,
93            secrets: None,
94            server: None,
95            source: None,
96            r#type: None,
97        }
98    }
99}
100