Skip to main content

oci_rust_sdk/core/models/
launch_options.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5/// Options for tuning the compatibility and performance of VM shapes. The values that you specify override any default values.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct LaunchOptions {
9    /// Emulation type for the boot volume. * {@code ISCSI} - ISCSI attached block storage device. * {@code SCSI} - Emulated SCSI disk. * {@code IDE} - Emulated IDE disk. * {@code VFIO} - Direct attached Virtual Function storage. This is the default option for local data volumes on platform images. * {@code PARAVIRTUALIZED} - Paravirtualized disk. This is the default for boot volumes and remote block storage volumes on platform images.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub boot_volume_type: Option<LaunchOptionsBootVolumeType>,
12
13    /// Firmware used to boot VM. Select the option that matches your operating system. * {@code BIOS} - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating systems that boot using MBR style bootloaders. * {@code UEFI_64} - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the default for platform images.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub firmware: Option<LaunchOptionsFirmware>,
16
17    /// Emulation type for the physical network interface card (NIC). * {@code E1000} - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. * {@code VFIO} - Direct attached Virtual Function network controller. This is the networking type when you launch an instance using hardware-assisted (SR-IOV) networking. * {@code PARAVIRTUALIZED} - VM instances launch with paravirtualized devices using VirtIO drivers.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub network_type: Option<LaunchOptionsNetworkType>,
20
21    /// Emulation type for volume. * {@code ISCSI} - ISCSI attached block storage device. * {@code SCSI} - Emulated SCSI disk. * {@code IDE} - Emulated IDE disk. * {@code VFIO} - Direct attached Virtual Function storage. This is the default option for local data volumes on platform images. * {@code PARAVIRTUALIZED} - Paravirtualized disk. This is the default for boot volumes and remote block storage volumes on platform images.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub remote_data_volume_type: Option<LaunchOptionsRemoteDataVolumeType>,
24
25    /// Deprecated. Instead use {@code isPvEncryptionInTransitEnabled} in {@link #launchInstanceDetails(LaunchInstanceDetailsRequest) launchInstanceDetails}.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub is_pv_encryption_in_transit_enabled: Option<bool>,
28
29    /// Whether to enable consistent volume naming feature. Defaults to false.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub is_consistent_volume_naming_enabled: Option<bool>,
32}
33
34impl LaunchOptions {
35    /// Create a new LaunchOptions
36    pub fn new() -> Self {
37        Self {
38            boot_volume_type: None,
39
40            firmware: None,
41
42            network_type: None,
43
44            remote_data_volume_type: None,
45
46            is_pv_encryption_in_transit_enabled: None,
47
48            is_consistent_volume_naming_enabled: None,
49        }
50    }
51
52    /// Set boot_volume_type
53    pub fn set_boot_volume_type(mut self, value: Option<LaunchOptionsBootVolumeType>) -> Self {
54        self.boot_volume_type = value;
55        self
56    }
57
58    /// Set firmware
59    pub fn set_firmware(mut self, value: Option<LaunchOptionsFirmware>) -> Self {
60        self.firmware = value;
61        self
62    }
63
64    /// Set network_type
65    pub fn set_network_type(mut self, value: Option<LaunchOptionsNetworkType>) -> Self {
66        self.network_type = value;
67        self
68    }
69
70    /// Set remote_data_volume_type
71    pub fn set_remote_data_volume_type(
72        mut self,
73        value: Option<LaunchOptionsRemoteDataVolumeType>,
74    ) -> Self {
75        self.remote_data_volume_type = value;
76        self
77    }
78
79    /// Set is_pv_encryption_in_transit_enabled
80    pub fn set_is_pv_encryption_in_transit_enabled(mut self, value: Option<bool>) -> Self {
81        self.is_pv_encryption_in_transit_enabled = value;
82        self
83    }
84
85    /// Set is_consistent_volume_naming_enabled
86    pub fn set_is_consistent_volume_naming_enabled(mut self, value: Option<bool>) -> Self {
87        self.is_consistent_volume_naming_enabled = value;
88        self
89    }
90
91    /// Set boot_volume_type (unwraps Option)
92    pub fn with_boot_volume_type(mut self, value: LaunchOptionsBootVolumeType) -> Self {
93        self.boot_volume_type = Some(value);
94        self
95    }
96
97    /// Set firmware (unwraps Option)
98    pub fn with_firmware(mut self, value: LaunchOptionsFirmware) -> Self {
99        self.firmware = Some(value);
100        self
101    }
102
103    /// Set network_type (unwraps Option)
104    pub fn with_network_type(mut self, value: LaunchOptionsNetworkType) -> Self {
105        self.network_type = Some(value);
106        self
107    }
108
109    /// Set remote_data_volume_type (unwraps Option)
110    pub fn with_remote_data_volume_type(
111        mut self,
112        value: LaunchOptionsRemoteDataVolumeType,
113    ) -> Self {
114        self.remote_data_volume_type = Some(value);
115        self
116    }
117
118    /// Set is_pv_encryption_in_transit_enabled (unwraps Option)
119    pub fn with_is_pv_encryption_in_transit_enabled(mut self, value: bool) -> Self {
120        self.is_pv_encryption_in_transit_enabled = Some(value);
121        self
122    }
123
124    /// Set is_consistent_volume_naming_enabled (unwraps Option)
125    pub fn with_is_consistent_volume_naming_enabled(mut self, value: bool) -> Self {
126        self.is_consistent_volume_naming_enabled = Some(value);
127        self
128    }
129}
130
131impl Default for LaunchOptions {
132    fn default() -> Self {
133        Self::new()
134    }
135}