#[non_exhaustive]pub struct BlockDevice {
pub name: Option<String>,
pub host_groups: Vec<String>,
pub identifier: String,
pub size_gib: Option<i64>,
pub os_type: OsType,
/* private fields */
}Expand description
Block device represents the device(s) which are stored in the block volume.
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.name: Option<String>Optional. User-defined name for the block device, unique within the volume. In case no user input is provided, name will be auto-generated in the backend. The name must meet the following requirements:
- Be between 1 and 255 characters long.
- Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9), and the following special characters: “-”, “_”, “}”, “{”, “.”.
- Spaces are not allowed.
host_groups: Vec<String>Optional. A list of host groups that identify hosts that can mount the
block volume. Format:
projects/{project_id}/locations/{location}/hostGroups/{host_group_id}
This field can be updated after the block device is created.
identifier: StringOutput only. Device identifier of the block volume. This represents
lun_serial_number for iSCSI volumes.
size_gib: Option<i64>Optional. The size of the block device in GiB.
Any value provided for the size_gib field during volume creation is
ignored. The block device’s size is system-managed and will be set to match
the parent Volume’s capacity_gib.
os_type: OsTypeRequired. Immutable. The OS type of the volume. This field can’t be changed after the block device is created.
Implementations§
Source§impl BlockDevice
impl BlockDevice
Sourcepub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
Sourcepub fn set_host_groups<T, V>(self, v: T) -> Self
pub fn set_host_groups<T, V>(self, v: T) -> Self
Sets the value of host_groups.
§Example
let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);Sourcepub fn set_identifier<T: Into<String>>(self, v: T) -> Self
pub fn set_identifier<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_size_gib<T>(self, v: T) -> Self
pub fn set_size_gib<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_size_gib<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_size_gib<T>(self, v: Option<T>) -> Self
Sourcepub fn set_os_type<T: Into<OsType>>(self, v: T) -> Self
pub fn set_os_type<T: Into<OsType>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for BlockDevice
impl Clone for BlockDevice
Source§fn clone(&self) -> BlockDevice
fn clone(&self) -> BlockDevice
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more