Skip to main content

incus_client/models/
instance_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 InstancePost {
16    /// Instance configuration file.
17    #[serde(rename = "Config", skip_serializing_if = "Option::is_none")]
18    pub config: Option<serde_json::Value>,
19    /// Instance devices.
20    #[serde(rename = "Devices", skip_serializing_if = "Option::is_none")]
21    pub devices: Option<serde_json::Value>,
22    /// List of profiles applied to the instance.
23    #[serde(rename = "Profiles", skip_serializing_if = "Option::is_none")]
24    pub profiles: Option<Vec<String>>,
25    /// AllowInconsistent allow inconsistent copies when migrating.
26    #[serde(rename = "allow_inconsistent", skip_serializing_if = "Option::is_none")]
27    pub allow_inconsistent: Option<bool>,
28    /// Whether snapshots should be discarded (migration only)
29    #[serde(rename = "instance_only", skip_serializing_if = "Option::is_none")]
30    pub instance_only: Option<bool>,
31    /// Whether to perform a live migration (migration only)
32    #[serde(rename = "live", skip_serializing_if = "Option::is_none")]
33    pub live: Option<bool>,
34    /// Whether the instance is being migrated to another server
35    #[serde(rename = "migration", skip_serializing_if = "Option::is_none")]
36    pub migration: Option<bool>,
37    /// New name for the instance
38    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
39    pub name: Option<String>,
40    /// Target pool for local cross-pool move
41    #[serde(rename = "pool", skip_serializing_if = "Option::is_none")]
42    pub pool: Option<String>,
43    /// Target project for local cross-project move
44    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
45    pub project: Option<String>,
46    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
47    pub target: Option<Box<models::InstancePostTarget>>,
48}
49
50impl InstancePost {
51    pub fn new() -> InstancePost {
52        InstancePost {
53            config: None,
54            devices: None,
55            profiles: None,
56            allow_inconsistent: None,
57            instance_only: None,
58            live: None,
59            migration: None,
60            name: None,
61            pool: None,
62            project: None,
63            target: None,
64        }
65    }
66}
67