Struct google_api_proto::google::cloud::compute::v1::AttachedDisk
source · pub struct AttachedDisk {Show 18 fields
pub architecture: Option<String>,
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<String>,
pub kind: Option<String>,
pub licenses: Vec<String>,
pub mode: Option<String>,
pub saved_state: Option<String>,
pub shielded_instance_initial_state: Option<InitialStateConfig>,
pub source: Option<String>,
pub type: Option<String>,
}
Expand description
An instance-attached disk resource.
Fields§
§architecture: Option<String>
[Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. Check the Architecture enum for the list of possible values.
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 a customer-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. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
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] 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<String>
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, see About persistent disks. Check the Interface enum for the list of possible values.
kind: Option<String>
[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
licenses: Vec<String>
[Output Only] Any valid publicly visible licenses.
mode: Option<String>
The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. Check the Mode enum for the list of possible values.
saved_state: Option<String>
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. Check the SavedState enum for the list of possible values.
shielded_instance_initial_state: Option<InitialStateConfig>
[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, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. 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<String>
Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. Check the Type enum for the list of possible values.
Implementations§
source§impl AttachedDisk
impl AttachedDisk
sourcepub fn device_name(&self) -> &str
pub fn device_name(&self) -> &str
Returns the value of device_name
, or the default value if device_name
is unset.
sourcepub fn force_attach(&self) -> bool
pub fn force_attach(&self) -> bool
Returns the value of force_attach
, or the default value if force_attach
is unset.
sourcepub fn source(&self) -> &str
pub fn source(&self) -> &str
Returns the value of source
, or the default value if source
is unset.
sourcepub fn architecture(&self) -> &str
pub fn architecture(&self) -> &str
Returns the value of architecture
, or the default value if architecture
is unset.
sourcepub fn disk_size_gb(&self) -> i64
pub fn disk_size_gb(&self) -> i64
Returns the value of disk_size_gb
, or the default value if disk_size_gb
is unset.
sourcepub fn saved_state(&self) -> &str
pub fn saved_state(&self) -> &str
Returns the value of saved_state
, or the default value if saved_state
is unset.
sourcepub fn auto_delete(&self) -> bool
pub fn auto_delete(&self) -> bool
Returns the value of auto_delete
, or the default value if auto_delete
is unset.
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 moresource§impl Debug for AttachedDisk
impl Debug for AttachedDisk
source§impl Default for AttachedDisk
impl Default for AttachedDisk
source§impl Message for AttachedDisk
impl Message for AttachedDisk
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for AttachedDisk
impl PartialEq for AttachedDisk
source§fn eq(&self, other: &AttachedDisk) -> bool
fn eq(&self, other: &AttachedDisk) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AttachedDisk
Auto Trait Implementations§
impl Freeze for AttachedDisk
impl RefUnwindSafe for AttachedDisk
impl Send for AttachedDisk
impl Sync for AttachedDisk
impl Unpin for AttachedDisk
impl UnwindSafe for AttachedDisk
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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