#[non_exhaustive]pub struct DiskInstantiationConfig {
pub auto_delete: Option<bool>,
pub custom_image: Option<String>,
pub device_name: Option<String>,
pub instantiate_from: Option<InstantiateFrom>,
/* private fields */
}instance-templates or region-instance-templates only.Expand description
A specification of the desired way to instantiate a disk in the instance template when its created from a source instance.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.auto_delete: Option<bool>Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
custom_image: Option<String>The custom source image to be used to restore this disk when instantiating this instance template.
device_name: Option<String>Specifies the device name of the disk to which the configurations apply to.
instantiate_from: Option<InstantiateFrom>Specifies whether to include the disk and what image to use. Possible values are:
- source-image: to use the same image that was used to
create the source instance's corresponding disk. Applicable to the boot
disk and additional read-write disks.
- source-image-family: to use the same image family that
was used to create the source instance's corresponding disk. Applicable
to the boot disk and additional read-write disks.
- custom-image: to use a user-provided image url for disk
creation. Applicable to the boot disk and additional read-write
disks.- attach-read-only: to attach a read-only
disk. Applicable to read-only disks.
- do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks.
Implementations§
Source§impl DiskInstantiationConfig
impl DiskInstantiationConfig
pub fn new() -> Self
Sourcepub fn set_auto_delete<T>(self, v: T) -> Self
pub fn set_auto_delete<T>(self, v: T) -> Self
Sets the value of auto_delete.
§Example
let x = DiskInstantiationConfig::new().set_auto_delete(true);Sourcepub fn set_or_clear_auto_delete<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_auto_delete<T>(self, v: Option<T>) -> Self
Sets or clears the value of auto_delete.
§Example
let x = DiskInstantiationConfig::new().set_or_clear_auto_delete(Some(false));
let x = DiskInstantiationConfig::new().set_or_clear_auto_delete(None::<bool>);Sourcepub fn set_custom_image<T>(self, v: T) -> Self
pub fn set_custom_image<T>(self, v: T) -> Self
Sets the value of custom_image.
§Example
let x = DiskInstantiationConfig::new().set_custom_image("example");Sourcepub fn set_or_clear_custom_image<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_custom_image<T>(self, v: Option<T>) -> Self
Sets or clears the value of custom_image.
§Example
let x = DiskInstantiationConfig::new().set_or_clear_custom_image(Some("example"));
let x = DiskInstantiationConfig::new().set_or_clear_custom_image(None::<String>);Sourcepub fn set_device_name<T>(self, v: T) -> Self
pub fn set_device_name<T>(self, v: T) -> Self
Sets the value of device_name.
§Example
let x = DiskInstantiationConfig::new().set_device_name("example");Sourcepub fn set_or_clear_device_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_device_name<T>(self, v: Option<T>) -> Self
Sets or clears the value of device_name.
§Example
let x = DiskInstantiationConfig::new().set_or_clear_device_name(Some("example"));
let x = DiskInstantiationConfig::new().set_or_clear_device_name(None::<String>);Sourcepub fn set_instantiate_from<T>(self, v: T) -> Selfwhere
T: Into<InstantiateFrom>,
pub fn set_instantiate_from<T>(self, v: T) -> Selfwhere
T: Into<InstantiateFrom>,
Sets the value of instantiate_from.
§Example
use google_cloud_compute_v1::model::disk_instantiation_config::InstantiateFrom;
let x0 = DiskInstantiationConfig::new().set_instantiate_from(InstantiateFrom::Blank);
let x1 = DiskInstantiationConfig::new().set_instantiate_from(InstantiateFrom::CustomImage);
let x2 = DiskInstantiationConfig::new().set_instantiate_from(InstantiateFrom::Default);Sourcepub fn set_or_clear_instantiate_from<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstantiateFrom>,
pub fn set_or_clear_instantiate_from<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstantiateFrom>,
Sets or clears the value of instantiate_from.
§Example
use google_cloud_compute_v1::model::disk_instantiation_config::InstantiateFrom;
let x0 = DiskInstantiationConfig::new().set_or_clear_instantiate_from(Some(InstantiateFrom::Blank));
let x1 = DiskInstantiationConfig::new().set_or_clear_instantiate_from(Some(InstantiateFrom::CustomImage));
let x2 = DiskInstantiationConfig::new().set_or_clear_instantiate_from(Some(InstantiateFrom::Default));
let x_none = DiskInstantiationConfig::new().set_or_clear_instantiate_from(None::<InstantiateFrom>);Trait Implementations§
Source§impl Clone for DiskInstantiationConfig
impl Clone for DiskInstantiationConfig
Source§fn clone(&self) -> DiskInstantiationConfig
fn clone(&self) -> DiskInstantiationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more