#[non_exhaustive]pub struct ReservationAffinity {
pub consume_reservation_type: Option<ConsumeReservationType>,
pub key: Option<String>,
pub values: Vec<String>,
/* private fields */
}instance-templates or instances or machine-images or region-instance-templates or region-instances only.Expand description
Specifies the reservations that this instance can consume from.
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.consume_reservation_type: Option<ConsumeReservationType>Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default),SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples.
key: Option<String>Corresponds to the label key of a reservation resource. To target aSPECIFIC_RESERVATION by name, specifygoogleapis.com/reservation-name as the key and specify the name of your reservation as its value.
values: Vec<String>Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or “projects/different-project/reservations/some-reservation-name” to target a shared reservation in the same zone but in a different project.
Implementations§
Source§impl ReservationAffinity
impl ReservationAffinity
pub fn new() -> Self
Sourcepub fn set_consume_reservation_type<T>(self, v: T) -> Selfwhere
T: Into<ConsumeReservationType>,
pub fn set_consume_reservation_type<T>(self, v: T) -> Selfwhere
T: Into<ConsumeReservationType>,
Sets the value of consume_reservation_type.
§Example
use google_cloud_compute_v1::model::reservation_affinity::ConsumeReservationType;
let x0 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::NoReservation);
let x1 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::SpecificReservation);
let x2 = ReservationAffinity::new().set_consume_reservation_type(ConsumeReservationType::Unspecified);Sourcepub fn set_or_clear_consume_reservation_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConsumeReservationType>,
pub fn set_or_clear_consume_reservation_type<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConsumeReservationType>,
Sets or clears the value of consume_reservation_type.
§Example
use google_cloud_compute_v1::model::reservation_affinity::ConsumeReservationType;
let x0 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::NoReservation));
let x1 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::SpecificReservation));
let x2 = ReservationAffinity::new().set_or_clear_consume_reservation_type(Some(ConsumeReservationType::Unspecified));
let x_none = ReservationAffinity::new().set_or_clear_consume_reservation_type(None::<ConsumeReservationType>);Sourcepub fn set_or_clear_key<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_key<T>(self, v: Option<T>) -> Self
Sourcepub fn set_values<T, V>(self, v: T) -> Self
pub fn set_values<T, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for ReservationAffinity
impl Clone for ReservationAffinity
Source§fn clone(&self) -> ReservationAffinity
fn clone(&self) -> ReservationAffinity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more