#[non_exhaustive]pub struct BulkInsertInstanceResource {
pub count: Option<i64>,
pub instance_flexibility_policy: Option<InstanceFlexibilityPolicy>,
pub instance_properties: Option<InstanceProperties>,
pub location_policy: Option<LocationPolicy>,
pub min_count: Option<i64>,
pub name_pattern: Option<String>,
pub per_instance_properties: HashMap<String, BulkInsertInstanceResourcePerInstanceProperties>,
pub source_instance_template: Option<String>,
/* private fields */
}instances or region-instances only.Expand description
A transient resource used in compute.instances.bulkInsert and compute.regionInstances.bulkInsert . This resource is not persisted anywhere, it is used only for processing the requests.
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.count: Option<i64>The maximum number of instances to create.
instance_flexibility_policy: Option<InstanceFlexibilityPolicy>A flexible specification of machine type of instances to create.
instance_properties: Option<InstanceProperties>The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided.
location_policy: Option<LocationPolicy>Policy for choosing target zone. For more information, seeCreate VMs in bulk.
min_count: Option<i64>The minimum number of instances to create. If no min_count is specified then count is used as the default value. Ifmin_count instances cannot be created, then no instances will be created and instances already created will be deleted.
name_pattern: Option<String>The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such asinst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with nameinst-0050, then instance names generated using the patterninst-#### begin with inst-0051. The name pattern placeholder #…# can contain up to 18 characters.
per_instance_properties: HashMap<String, BulkInsertInstanceResourcePerInstanceProperties>Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used.
source_instance_template: Option<String>Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate withinstanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396.
It can be a full or partial URL. For example, the following are all valid URLs to an instance template:
- https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
- projects/project/global/instanceTemplates/instanceTemplate
- global/instanceTemplates/instanceTemplateThis field is optional.
Implementations§
Source§impl BulkInsertInstanceResource
impl BulkInsertInstanceResource
pub fn new() -> Self
Sourcepub fn set_or_clear_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_count<T>(self, v: Option<T>) -> Self
Sourcepub fn set_instance_flexibility_policy<T>(self, v: T) -> Selfwhere
T: Into<InstanceFlexibilityPolicy>,
pub fn set_instance_flexibility_policy<T>(self, v: T) -> Selfwhere
T: Into<InstanceFlexibilityPolicy>,
Sets the value of instance_flexibility_policy.
§Example
use google_cloud_compute_v1::model::InstanceFlexibilityPolicy;
let x = BulkInsertInstanceResource::new().set_instance_flexibility_policy(InstanceFlexibilityPolicy::default()/* use setters */);Sourcepub fn set_or_clear_instance_flexibility_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceFlexibilityPolicy>,
pub fn set_or_clear_instance_flexibility_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceFlexibilityPolicy>,
Sets or clears the value of instance_flexibility_policy.
§Example
use google_cloud_compute_v1::model::InstanceFlexibilityPolicy;
let x = BulkInsertInstanceResource::new().set_or_clear_instance_flexibility_policy(Some(InstanceFlexibilityPolicy::default()/* use setters */));
let x = BulkInsertInstanceResource::new().set_or_clear_instance_flexibility_policy(None::<InstanceFlexibilityPolicy>);Sourcepub fn set_instance_properties<T>(self, v: T) -> Selfwhere
T: Into<InstanceProperties>,
pub fn set_instance_properties<T>(self, v: T) -> Selfwhere
T: Into<InstanceProperties>,
Sets the value of instance_properties.
§Example
use google_cloud_compute_v1::model::InstanceProperties;
let x = BulkInsertInstanceResource::new().set_instance_properties(InstanceProperties::default()/* use setters */);Sourcepub fn set_or_clear_instance_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceProperties>,
pub fn set_or_clear_instance_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceProperties>,
Sets or clears the value of instance_properties.
§Example
use google_cloud_compute_v1::model::InstanceProperties;
let x = BulkInsertInstanceResource::new().set_or_clear_instance_properties(Some(InstanceProperties::default()/* use setters */));
let x = BulkInsertInstanceResource::new().set_or_clear_instance_properties(None::<InstanceProperties>);Sourcepub fn set_location_policy<T>(self, v: T) -> Selfwhere
T: Into<LocationPolicy>,
pub fn set_location_policy<T>(self, v: T) -> Selfwhere
T: Into<LocationPolicy>,
Sets the value of location_policy.
§Example
use google_cloud_compute_v1::model::LocationPolicy;
let x = BulkInsertInstanceResource::new().set_location_policy(LocationPolicy::default()/* use setters */);Sourcepub fn set_or_clear_location_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<LocationPolicy>,
pub fn set_or_clear_location_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<LocationPolicy>,
Sets or clears the value of location_policy.
§Example
use google_cloud_compute_v1::model::LocationPolicy;
let x = BulkInsertInstanceResource::new().set_or_clear_location_policy(Some(LocationPolicy::default()/* use setters */));
let x = BulkInsertInstanceResource::new().set_or_clear_location_policy(None::<LocationPolicy>);Sourcepub fn set_min_count<T>(self, v: T) -> Self
pub fn set_min_count<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_min_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_min_count<T>(self, v: Option<T>) -> Self
Sourcepub fn set_name_pattern<T>(self, v: T) -> Self
pub fn set_name_pattern<T>(self, v: T) -> Self
Sets the value of name_pattern.
§Example
let x = BulkInsertInstanceResource::new().set_name_pattern("example");Sourcepub fn set_or_clear_name_pattern<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_name_pattern<T>(self, v: Option<T>) -> Self
Sets or clears the value of name_pattern.
§Example
let x = BulkInsertInstanceResource::new().set_or_clear_name_pattern(Some("example"));
let x = BulkInsertInstanceResource::new().set_or_clear_name_pattern(None::<String>);Sourcepub fn set_per_instance_properties<T, K, V>(self, v: T) -> Selfwhere
T: IntoIterator<Item = (K, V)>,
K: Into<String>,
V: Into<BulkInsertInstanceResourcePerInstanceProperties>,
pub fn set_per_instance_properties<T, K, V>(self, v: T) -> Selfwhere
T: IntoIterator<Item = (K, V)>,
K: Into<String>,
V: Into<BulkInsertInstanceResourcePerInstanceProperties>,
Sets the value of per_instance_properties.
§Example
use google_cloud_compute_v1::model::BulkInsertInstanceResourcePerInstanceProperties;
let x = BulkInsertInstanceResource::new().set_per_instance_properties([
("key0", BulkInsertInstanceResourcePerInstanceProperties::default()/* use setters */),
("key1", BulkInsertInstanceResourcePerInstanceProperties::default()/* use (different) setters */),
]);Sourcepub fn set_source_instance_template<T>(self, v: T) -> Self
pub fn set_source_instance_template<T>(self, v: T) -> Self
Sets the value of source_instance_template.
§Example
let x = BulkInsertInstanceResource::new().set_source_instance_template("example");Sourcepub fn set_or_clear_source_instance_template<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_source_instance_template<T>(self, v: Option<T>) -> Self
Sets or clears the value of source_instance_template.
§Example
let x = BulkInsertInstanceResource::new().set_or_clear_source_instance_template(Some("example"));
let x = BulkInsertInstanceResource::new().set_or_clear_source_instance_template(None::<String>);Trait Implementations§
Source§impl Clone for BulkInsertInstanceResource
impl Clone for BulkInsertInstanceResource
Source§fn clone(&self) -> BulkInsertInstanceResource
fn clone(&self) -> BulkInsertInstanceResource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more