#[non_exhaustive]pub struct LocationPolicy {
pub locations: HashMap<String, LocationPolicyLocation>,
pub target_shape: Option<TargetShape>,
pub zones: Vec<LocationPolicyZoneConfiguration>,
/* private fields */
}instances or region-instances only.Expand description
Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).
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.locations: HashMap<String, LocationPolicyLocation>Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. The bulkInsert operation doesn’t create instances in an AI zone, even if an AI zone is available in the specified region. For example, if you set a DENY preference for us-central1-a, Compute Engine will consider us-central1-b and us-central1-c for instance creation, but not us-central1-ai1a. Also, you can’t use the locations[] configuration to allow instance creation in an AI zone. To include an AI zone in bulkInsert operations, use the locationPolicy.zones[] field.
target_shape: Option<TargetShape>Strategy for distributing VMs across zones in a region.
zones: Vec<LocationPolicyZoneConfiguration>The bulkInsert operation applies any preferences set in the locations field to the specific zones listed in the zones field if the same zones are specified in both fields.
Implementations§
Source§impl LocationPolicy
impl LocationPolicy
pub fn new() -> Self
Sourcepub fn set_locations<T, K, V>(self, v: T) -> Self
pub fn set_locations<T, K, V>(self, v: T) -> Self
Sourcepub fn set_target_shape<T>(self, v: T) -> Selfwhere
T: Into<TargetShape>,
pub fn set_target_shape<T>(self, v: T) -> Selfwhere
T: Into<TargetShape>,
Sets the value of target_shape.
§Example
use google_cloud_compute_v1::model::location_policy::TargetShape;
let x0 = LocationPolicy::new().set_target_shape(TargetShape::AnySingleZone);
let x1 = LocationPolicy::new().set_target_shape(TargetShape::Balanced);Sourcepub fn set_or_clear_target_shape<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetShape>,
pub fn set_or_clear_target_shape<T>(self, v: Option<T>) -> Selfwhere
T: Into<TargetShape>,
Sets or clears the value of target_shape.
§Example
use google_cloud_compute_v1::model::location_policy::TargetShape;
let x0 = LocationPolicy::new().set_or_clear_target_shape(Some(TargetShape::AnySingleZone));
let x1 = LocationPolicy::new().set_or_clear_target_shape(Some(TargetShape::Balanced));
let x_none = LocationPolicy::new().set_or_clear_target_shape(None::<TargetShape>);Trait Implementations§
Source§impl Clone for LocationPolicy
impl Clone for LocationPolicy
Source§fn clone(&self) -> LocationPolicy
fn clone(&self) -> LocationPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more