#[non_exhaustive]pub struct AttachedDisk {Show 18 fields
pub architecture: Option<Architecture>,
pub auto_delete: Option<bool>,
pub boot: Option<bool>,
pub device_name: Option<String>,
pub disk_encryption_key: Option<CustomerEncryptionKey>,
pub disk_size_gb: Option<i64>,
pub force_attach: Option<bool>,
pub guest_os_features: Vec<GuestOsFeature>,
pub index: Option<i32>,
pub initialize_params: Option<AttachedDiskInitializeParams>,
pub interface: Option<Interface>,
pub kind: Option<String>,
pub licenses: Vec<String>,
pub mode: Option<Mode>,
pub saved_state: Option<SavedState>,
pub shielded_instance_initial_state: Option<InitialStateConfig>,
pub source: Option<String>,
pub type: Option<Type>,
/* private fields */
}instance-templates or instances or machine-images or region-instance-templates or region-instances only.Expand description
An instance-attached disk resource.
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.architecture: Option<Architecture>Output only. [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64.
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).
boot: Option<bool>Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
device_name: Option<String>Specifies a unique device name of your choice that is reflected into the/dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.
If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
disk_encryption_key: Option<CustomerEncryptionKey>Encrypts or decrypts a disk using acustomer-supplied encryption key.
If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
Note:
Instance templates do not storecustomer-supplied encryption keys, so you cannot use your own keys to encrypt disks in amanaged instance group.
You cannot create VMs that have disks with customer-supplied keys using the bulk insert method.
disk_size_gb: Option<i64>The size of the disk in GB.
force_attach: Option<bool>[Input Only] Whether to force attach the regional disk even if it’s currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.
guest_os_features: Vec<GuestOsFeature>A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
index: Option<i32>Output only. [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.
initialize_params: Option<AttachedDiskInitializeParams>[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
This property is mutually exclusive with the source property; you can only define one or the other, but not both.
interface: Option<Interface>Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, seeAbout persistent disks.
kind: Option<String>Output only. [Output Only] Type of the resource. Alwayscompute#attachedDisk for attached disks.
licenses: Vec<String>Output only. [Output Only] Any valid publicly visible licenses.
mode: Option<Mode>The mode in which to attach this disk, either READ_WRITE orREAD_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
saved_state: Option<SavedState>Output only. For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api.
shielded_instance_initial_state: Option<InitialStateConfig>Output only. [Output Only] shielded vm initial state stored on disk
source: Option<String>Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance boot disk, one ofinitializeParams.sourceImage orinitializeParams.sourceSnapshot or disks.source is required.
If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.
type: Option<Type>Specifies the type of the disk, either SCRATCH orPERSISTENT. If not specified, the default isPERSISTENT.
Implementations§
Source§impl AttachedDisk
impl AttachedDisk
pub fn new() -> Self
Sourcepub fn set_architecture<T>(self, v: T) -> Selfwhere
T: Into<Architecture>,
pub fn set_architecture<T>(self, v: T) -> Selfwhere
T: Into<Architecture>,
Sets the value of architecture.
§Example
use google_cloud_compute_v1::model::attached_disk::Architecture;
let x0 = AttachedDisk::new().set_architecture(Architecture::Arm64);
let x1 = AttachedDisk::new().set_architecture(Architecture::X8664);Sourcepub fn set_or_clear_architecture<T>(self, v: Option<T>) -> Selfwhere
T: Into<Architecture>,
pub fn set_or_clear_architecture<T>(self, v: Option<T>) -> Selfwhere
T: Into<Architecture>,
Sets or clears the value of architecture.
§Example
use google_cloud_compute_v1::model::attached_disk::Architecture;
let x0 = AttachedDisk::new().set_or_clear_architecture(Some(Architecture::Arm64));
let x1 = AttachedDisk::new().set_or_clear_architecture(Some(Architecture::X8664));
let x_none = AttachedDisk::new().set_or_clear_architecture(None::<Architecture>);Sourcepub fn set_auto_delete<T>(self, v: T) -> Self
pub fn set_auto_delete<T>(self, v: T) -> Self
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 = AttachedDisk::new().set_or_clear_auto_delete(Some(false));
let x = AttachedDisk::new().set_or_clear_auto_delete(None::<bool>);Sourcepub fn set_or_clear_boot<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_boot<T>(self, v: Option<T>) -> Self
Sourcepub fn set_device_name<T>(self, v: T) -> Self
pub fn set_device_name<T>(self, v: T) -> Self
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 = AttachedDisk::new().set_or_clear_device_name(Some("example"));
let x = AttachedDisk::new().set_or_clear_device_name(None::<String>);Sourcepub fn set_disk_encryption_key<T>(self, v: T) -> Selfwhere
T: Into<CustomerEncryptionKey>,
pub fn set_disk_encryption_key<T>(self, v: T) -> Selfwhere
T: Into<CustomerEncryptionKey>,
Sets the value of disk_encryption_key.
§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = AttachedDisk::new().set_disk_encryption_key(CustomerEncryptionKey::default()/* use setters */);Sourcepub fn set_or_clear_disk_encryption_key<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomerEncryptionKey>,
pub fn set_or_clear_disk_encryption_key<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomerEncryptionKey>,
Sets or clears the value of disk_encryption_key.
§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = AttachedDisk::new().set_or_clear_disk_encryption_key(Some(CustomerEncryptionKey::default()/* use setters */));
let x = AttachedDisk::new().set_or_clear_disk_encryption_key(None::<CustomerEncryptionKey>);Sourcepub fn set_disk_size_gb<T>(self, v: T) -> Self
pub fn set_disk_size_gb<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_disk_size_gb<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_disk_size_gb<T>(self, v: Option<T>) -> Self
Sets or clears the value of disk_size_gb.
§Example
let x = AttachedDisk::new().set_or_clear_disk_size_gb(Some(42));
let x = AttachedDisk::new().set_or_clear_disk_size_gb(None::<i32>);Sourcepub fn set_force_attach<T>(self, v: T) -> Self
pub fn set_force_attach<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_force_attach<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_force_attach<T>(self, v: Option<T>) -> Self
Sets or clears the value of force_attach.
§Example
let x = AttachedDisk::new().set_or_clear_force_attach(Some(false));
let x = AttachedDisk::new().set_or_clear_force_attach(None::<bool>);Sourcepub fn set_guest_os_features<T, V>(self, v: T) -> Self
pub fn set_guest_os_features<T, V>(self, v: T) -> Self
Sets the value of guest_os_features.
§Example
use google_cloud_compute_v1::model::GuestOsFeature;
let x = AttachedDisk::new()
.set_guest_os_features([
GuestOsFeature::default()/* use setters */,
GuestOsFeature::default()/* use (different) setters */,
]);Sourcepub fn set_or_clear_index<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_index<T>(self, v: Option<T>) -> Self
Sourcepub fn set_initialize_params<T>(self, v: T) -> Selfwhere
T: Into<AttachedDiskInitializeParams>,
pub fn set_initialize_params<T>(self, v: T) -> Selfwhere
T: Into<AttachedDiskInitializeParams>,
Sets the value of initialize_params.
§Example
use google_cloud_compute_v1::model::AttachedDiskInitializeParams;
let x = AttachedDisk::new().set_initialize_params(AttachedDiskInitializeParams::default()/* use setters */);Sourcepub fn set_or_clear_initialize_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<AttachedDiskInitializeParams>,
pub fn set_or_clear_initialize_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<AttachedDiskInitializeParams>,
Sets or clears the value of initialize_params.
§Example
use google_cloud_compute_v1::model::AttachedDiskInitializeParams;
let x = AttachedDisk::new().set_or_clear_initialize_params(Some(AttachedDiskInitializeParams::default()/* use setters */));
let x = AttachedDisk::new().set_or_clear_initialize_params(None::<AttachedDiskInitializeParams>);Sourcepub fn set_interface<T>(self, v: T) -> Self
pub fn set_interface<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_interface<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_interface<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
Sourcepub fn set_licenses<T, V>(self, v: T) -> Self
pub fn set_licenses<T, V>(self, v: T) -> Self
Sourcepub fn set_or_clear_mode<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_mode<T>(self, v: Option<T>) -> Self
Sourcepub fn set_saved_state<T>(self, v: T) -> Selfwhere
T: Into<SavedState>,
pub fn set_saved_state<T>(self, v: T) -> Selfwhere
T: Into<SavedState>,
Sets the value of saved_state.
§Example
use google_cloud_compute_v1::model::attached_disk::SavedState;
let x0 = AttachedDisk::new().set_saved_state(SavedState::Preserved);Sourcepub fn set_or_clear_saved_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<SavedState>,
pub fn set_or_clear_saved_state<T>(self, v: Option<T>) -> Selfwhere
T: Into<SavedState>,
Sets or clears the value of saved_state.
§Example
use google_cloud_compute_v1::model::attached_disk::SavedState;
let x0 = AttachedDisk::new().set_or_clear_saved_state(Some(SavedState::Preserved));
let x_none = AttachedDisk::new().set_or_clear_saved_state(None::<SavedState>);Sourcepub fn set_shielded_instance_initial_state<T>(self, v: T) -> Selfwhere
T: Into<InitialStateConfig>,
pub fn set_shielded_instance_initial_state<T>(self, v: T) -> Selfwhere
T: Into<InitialStateConfig>,
Sets the value of shielded_instance_initial_state.
§Example
use google_cloud_compute_v1::model::InitialStateConfig;
let x = AttachedDisk::new().set_shielded_instance_initial_state(InitialStateConfig::default()/* use setters */);Sourcepub fn set_or_clear_shielded_instance_initial_state<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<InitialStateConfig>,
pub fn set_or_clear_shielded_instance_initial_state<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<InitialStateConfig>,
Sets or clears the value of shielded_instance_initial_state.
§Example
use google_cloud_compute_v1::model::InitialStateConfig;
let x = AttachedDisk::new().set_or_clear_shielded_instance_initial_state(Some(InitialStateConfig::default()/* use setters */));
let x = AttachedDisk::new().set_or_clear_shielded_instance_initial_state(None::<InitialStateConfig>);Sourcepub fn set_source<T>(self, v: T) -> Self
pub fn set_source<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_source<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_source<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for AttachedDisk
impl Clone for AttachedDisk
Source§fn clone(&self) -> AttachedDisk
fn clone(&self) -> AttachedDisk
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more