Skip to main content

cloud_hypervisor_client/models/
send_migration_data.rs

1/*
2 * Cloud Hypervisor API
3 *
4 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
5 *
6 * The version of the OpenAPI document: 0.3.0
7 *
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 SendMigrationData {
16    #[serde(rename = "destination_url")]
17    pub destination_url: String,
18    #[serde(rename = "local", skip_serializing_if = "Option::is_none")]
19    pub local: Option<bool>,
20    /// The maximum downtime the migration aims for, in milliseconds. Defaults to 300ms.
21    #[serde(rename = "downtime_ms", skip_serializing_if = "Option::is_none")]
22    pub downtime_ms: Option<i64>,
23    /// The timeout for the migration (maximum total duration), in seconds. Defaults to 3600s (one hour).
24    #[serde(rename = "timeout_s", skip_serializing_if = "Option::is_none")]
25    pub timeout_s: Option<i64>,
26    #[serde(rename = "timeout_strategy", skip_serializing_if = "Option::is_none")]
27    pub timeout_strategy: Option<models::TimeoutStrategy>,
28    /// The number of parallel TCP connections to use for migration. Must be between 1 and 128. Multiple connections are not supported with local UNIX-socket migration.
29    #[serde(rename = "connections", skip_serializing_if = "Option::is_none")]
30    pub connections: Option<i64>,
31}
32
33impl SendMigrationData {
34    pub fn new(destination_url: String) -> SendMigrationData {
35        SendMigrationData {
36            destination_url,
37            local: None,
38            downtime_ms: None,
39            timeout_s: None,
40            timeout_strategy: None,
41            connections: None,
42        }
43    }
44}