#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiskInstantiationConfig
impl Debug for DiskInstantiationConfig
Source§impl Default for DiskInstantiationConfig
impl Default for DiskInstantiationConfig
Source§fn default() -> DiskInstantiationConfig
fn default() -> DiskInstantiationConfig
Source§impl Message for DiskInstantiationConfig
impl Message for DiskInstantiationConfig
Source§impl PartialEq for DiskInstantiationConfig
impl PartialEq for DiskInstantiationConfig
impl StructuralPartialEq for DiskInstantiationConfig
Auto Trait Implementations§
impl Freeze for DiskInstantiationConfig
impl RefUnwindSafe for DiskInstantiationConfig
impl Send for DiskInstantiationConfig
impl Sync for DiskInstantiationConfig
impl Unpin for DiskInstantiationConfig
impl UnsafeUnpin for DiskInstantiationConfig
impl UnwindSafe for DiskInstantiationConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request