Volume

Struct Volume 

Source
#[non_exhaustive]
pub struct Volume {
Show 24 fields pub name: String, pub id: String, pub storage_type: StorageType, pub state: State, pub requested_size_gib: i64, pub originally_requested_size_gib: i64, pub current_size_gib: i64, pub emergency_size_gib: i64, pub max_size_gib: i64, pub auto_grown_size_gib: i64, pub remaining_space_gib: i64, pub snapshot_reservation_detail: Option<SnapshotReservationDetail>, pub snapshot_auto_delete_behavior: SnapshotAutoDeleteBehavior, pub labels: HashMap<String, String>, pub snapshot_enabled: bool, pub pod: String, pub protocol: Protocol, pub boot_volume: bool, pub performance_tier: VolumePerformanceTier, pub notes: String, pub workload_profile: WorkloadProfile, pub expire_time: Option<Timestamp>, pub instances: Vec<String>, pub attached: bool, /* private fields */
}
Expand description

A storage volume.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output only. The resource name of this Volume. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: projects/{project}/locations/{location}/volumes/{volume}

§id: String

An identifier for the Volume, generated by the backend.

§storage_type: StorageType

The storage type for this volume.

§state: State

The state of this storage volume.

§requested_size_gib: i64

The requested size of this storage volume, in GiB.

§originally_requested_size_gib: i64

Originally requested size, in GiB.

§current_size_gib: i64

The current size of this storage volume, in GiB, including space reserved for snapshots. This size might be different than the requested size if the storage volume has been configured with auto grow or auto shrink.

§emergency_size_gib: i64

Additional emergency size that was requested for this Volume, in GiB. current_size_gib includes this value.

§max_size_gib: i64

Maximum size volume can be expanded to in case of evergency, in GiB.

§auto_grown_size_gib: i64

The size, in GiB, that this storage volume has expanded as a result of an auto grow policy. In the absence of auto-grow, the value is 0.

§remaining_space_gib: i64

The space remaining in the storage volume for new LUNs, in GiB, excluding space reserved for snapshots.

§snapshot_reservation_detail: Option<SnapshotReservationDetail>

Details about snapshot space reservation and usage on the storage volume.

§snapshot_auto_delete_behavior: SnapshotAutoDeleteBehavior

The behavior to use when snapshot reserved space is full.

§labels: HashMap<String, String>

Labels as key value pairs.

§snapshot_enabled: bool

Whether snapshots are enabled.

§pod: String

Immutable. Pod name.

§protocol: Protocol

Output only. Storage protocol for the Volume.

§boot_volume: bool

Output only. Whether this volume is a boot volume. A boot volume is one which contains a boot LUN.

§performance_tier: VolumePerformanceTier

Immutable. Performance tier of the Volume. Default is SHARED.

§notes: String

Input only. User-specified notes for new Volume. Used to provision Volumes that require manual intervention.

§workload_profile: WorkloadProfile

The workload profile for the volume.

§expire_time: Option<Timestamp>

Output only. Time after which volume will be fully deleted. It is filled only for volumes in COOLOFF state.

§instances: Vec<String>

Output only. Instances this Volume is attached to. This field is set only in Get requests.

§attached: bool

Output only. Is the Volume attached at at least one instance. This field is a lightweight counterpart of instances field. It is filled in List responses as well.

Implementations§

Source§

impl Volume

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Volume::new().set_name("example");
Source

pub fn set_id<T: Into<String>>(self, v: T) -> Self

Sets the value of id.

§Example
let x = Volume::new().set_id("example");
Source

pub fn set_storage_type<T: Into<StorageType>>(self, v: T) -> Self

Sets the value of storage_type.

§Example
use google_cloud_baremetalsolution_v2::model::volume::StorageType;
let x0 = Volume::new().set_storage_type(StorageType::Ssd);
let x1 = Volume::new().set_storage_type(StorageType::Hdd);
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_baremetalsolution_v2::model::volume::State;
let x0 = Volume::new().set_state(State::Creating);
let x1 = Volume::new().set_state(State::Ready);
let x2 = Volume::new().set_state(State::Deleting);
Source

pub fn set_requested_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of requested_size_gib.

§Example
let x = Volume::new().set_requested_size_gib(42);
Source

pub fn set_originally_requested_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of originally_requested_size_gib.

§Example
let x = Volume::new().set_originally_requested_size_gib(42);
Source

pub fn set_current_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of current_size_gib.

§Example
let x = Volume::new().set_current_size_gib(42);
Source

pub fn set_emergency_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of emergency_size_gib.

§Example
let x = Volume::new().set_emergency_size_gib(42);
Source

pub fn set_max_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of max_size_gib.

§Example
let x = Volume::new().set_max_size_gib(42);
Source

pub fn set_auto_grown_size_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of auto_grown_size_gib.

§Example
let x = Volume::new().set_auto_grown_size_gib(42);
Source

pub fn set_remaining_space_gib<T: Into<i64>>(self, v: T) -> Self

Sets the value of remaining_space_gib.

§Example
let x = Volume::new().set_remaining_space_gib(42);
Source

pub fn set_snapshot_reservation_detail<T>(self, v: T) -> Self

Sets the value of snapshot_reservation_detail.

§Example
use google_cloud_baremetalsolution_v2::model::volume::SnapshotReservationDetail;
let x = Volume::new().set_snapshot_reservation_detail(SnapshotReservationDetail::default()/* use setters */);
Source

pub fn set_or_clear_snapshot_reservation_detail<T>(self, v: Option<T>) -> Self

Sets or clears the value of snapshot_reservation_detail.

§Example
use google_cloud_baremetalsolution_v2::model::volume::SnapshotReservationDetail;
let x = Volume::new().set_or_clear_snapshot_reservation_detail(Some(SnapshotReservationDetail::default()/* use setters */));
let x = Volume::new().set_or_clear_snapshot_reservation_detail(None::<SnapshotReservationDetail>);
Source

pub fn set_snapshot_auto_delete_behavior<T: Into<SnapshotAutoDeleteBehavior>>( self, v: T, ) -> Self

Sets the value of snapshot_auto_delete_behavior.

§Example
use google_cloud_baremetalsolution_v2::model::volume::SnapshotAutoDeleteBehavior;
let x0 = Volume::new().set_snapshot_auto_delete_behavior(SnapshotAutoDeleteBehavior::Disabled);
let x1 = Volume::new().set_snapshot_auto_delete_behavior(SnapshotAutoDeleteBehavior::OldestFirst);
let x2 = Volume::new().set_snapshot_auto_delete_behavior(SnapshotAutoDeleteBehavior::NewestFirst);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = Volume::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_snapshot_enabled<T: Into<bool>>(self, v: T) -> Self

Sets the value of snapshot_enabled.

§Example
let x = Volume::new().set_snapshot_enabled(true);
Source

pub fn set_pod<T: Into<String>>(self, v: T) -> Self

Sets the value of pod.

§Example
let x = Volume::new().set_pod("example");
Source

pub fn set_protocol<T: Into<Protocol>>(self, v: T) -> Self

Sets the value of protocol.

§Example
use google_cloud_baremetalsolution_v2::model::volume::Protocol;
let x0 = Volume::new().set_protocol(Protocol::FibreChannel);
let x1 = Volume::new().set_protocol(Protocol::Nfs);
Source

pub fn set_boot_volume<T: Into<bool>>(self, v: T) -> Self

Sets the value of boot_volume.

§Example
let x = Volume::new().set_boot_volume(true);
Source

pub fn set_performance_tier<T: Into<VolumePerformanceTier>>(self, v: T) -> Self

Sets the value of performance_tier.

§Example
use google_cloud_baremetalsolution_v2::model::VolumePerformanceTier;
let x0 = Volume::new().set_performance_tier(VolumePerformanceTier::Shared);
let x1 = Volume::new().set_performance_tier(VolumePerformanceTier::Assigned);
let x2 = Volume::new().set_performance_tier(VolumePerformanceTier::Ht);
Source

pub fn set_notes<T: Into<String>>(self, v: T) -> Self

Sets the value of notes.

§Example
let x = Volume::new().set_notes("example");
Source

pub fn set_workload_profile<T: Into<WorkloadProfile>>(self, v: T) -> Self

Sets the value of workload_profile.

§Example
use google_cloud_baremetalsolution_v2::model::volume::WorkloadProfile;
let x0 = Volume::new().set_workload_profile(WorkloadProfile::Generic);
let x1 = Volume::new().set_workload_profile(WorkloadProfile::Hana);
Source

pub fn set_expire_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of expire_time.

§Example
use wkt::Timestamp;
let x = Volume::new().set_expire_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_expire_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of expire_time.

§Example
use wkt::Timestamp;
let x = Volume::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
let x = Volume::new().set_or_clear_expire_time(None::<Timestamp>);
Source

pub fn set_instances<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of instances.

§Example
let x = Volume::new().set_instances(["a", "b", "c"]);
Source

pub fn set_attached<T: Into<bool>>(self, v: T) -> Self

Sets the value of attached.

§Example
let x = Volume::new().set_attached(true);

Trait Implementations§

Source§

impl Clone for Volume

Source§

fn clone(&self) -> Volume

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Volume

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Volume

Source§

fn default() -> Volume

Returns the “default value” for a type. Read more
Source§

impl Message for Volume

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Volume

Source§

fn eq(&self, other: &Volume) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Volume

Auto Trait Implementations§

§

impl Freeze for Volume

§

impl RefUnwindSafe for Volume

§

impl Send for Volume

§

impl Sync for Volume

§

impl Unpin for Volume

§

impl UnwindSafe for Volume

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,