#[non_exhaustive]pub struct InstanceTemplate {
pub creation_timestamp: Option<String>,
pub description: Option<String>,
pub id: Option<u64>,
pub kind: Option<String>,
pub name: Option<String>,
pub properties: Option<InstanceProperties>,
pub region: Option<String>,
pub self_link: Option<String>,
pub source_instance: Option<String>,
pub source_instance_params: Option<SourceInstanceParams>,
/* private fields */
}instance-templates or region-instance-templates only.Expand description
Represents an Instance Template resource.
Google Compute Engine has two Instance Template resources:
You can reuse a global instance template in different regions whereas you can use a regional instance template in a specified region only. If you want to reduce cross-region dependency or achieve data residency, use a regional instance template.
To create VMs, managed instance groups, and reservations, you can use either global or regional instance templates.
For more information, readInstance Templates.
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.creation_timestamp: Option<String>Output only. [Output Only] The creation timestamp for this instance template inRFC3339 text format.
description: Option<String>An optional description of this resource. Provide this property when you create the resource.
id: Option<u64>Output only. [Output Only] A unique identifier for this instance template. The server defines this identifier.
kind: Option<String>Output only. [Output Only] The resource type, which is alwayscompute#instanceTemplate for instance templates.
name: Option<String>Name of the resource; provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
character must be a lowercase letter, and all following characters must be
a dash, lowercase letter, or digit, except the last character, which cannot
be a dash.
properties: Option<InstanceProperties>The instance properties for this instance template.
region: Option<String>Output only. [Output Only] URL of the region where the instance template resides. Only applicable for regional resources.
self_link: Option<String>Output only. [Output Only] The URL for this instance template. The server defines this URL.
source_instance: Option<String>The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance- projects/project/zones/zone/instances/instance
source_instance_params: Option<SourceInstanceParams>The source instance params to use to create this instance template.
Implementations§
Source§impl InstanceTemplate
impl InstanceTemplate
Sourcepub fn set_creation_timestamp<T>(self, v: T) -> Self
pub fn set_creation_timestamp<T>(self, v: T) -> Self
Sets the value of creation_timestamp.
§Example
let x = InstanceTemplate::new().set_creation_timestamp("example");Sourcepub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of creation_timestamp.
§Example
let x = InstanceTemplate::new().set_or_clear_creation_timestamp(Some("example"));
let x = InstanceTemplate::new().set_or_clear_creation_timestamp(None::<String>);Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sets the value of description.
§Example
let x = InstanceTemplate::new().set_description("example");Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = InstanceTemplate::new().set_or_clear_description(Some("example"));
let x = InstanceTemplate::new().set_or_clear_description(None::<String>);Sourcepub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
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_properties<T>(self, v: T) -> Selfwhere
T: Into<InstanceProperties>,
pub fn set_properties<T>(self, v: T) -> Selfwhere
T: Into<InstanceProperties>,
Sets the value of properties.
§Example
use google_cloud_compute_v1::model::InstanceProperties;
let x = InstanceTemplate::new().set_properties(InstanceProperties::default()/* use setters */);Sourcepub fn set_or_clear_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceProperties>,
pub fn set_or_clear_properties<T>(self, v: Option<T>) -> Selfwhere
T: Into<InstanceProperties>,
Sets or clears the value of properties.
§Example
use google_cloud_compute_v1::model::InstanceProperties;
let x = InstanceTemplate::new().set_or_clear_properties(Some(InstanceProperties::default()/* use setters */));
let x = InstanceTemplate::new().set_or_clear_properties(None::<InstanceProperties>);Sourcepub fn set_region<T>(self, v: T) -> Self
pub fn set_region<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
Sourcepub fn set_self_link<T>(self, v: T) -> Self
pub fn set_self_link<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
Sourcepub fn set_source_instance<T>(self, v: T) -> Self
pub fn set_source_instance<T>(self, v: T) -> Self
Sets the value of source_instance.
§Example
let x = InstanceTemplate::new().set_source_instance("example");Sourcepub fn set_or_clear_source_instance<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_source_instance<T>(self, v: Option<T>) -> Self
Sets or clears the value of source_instance.
§Example
let x = InstanceTemplate::new().set_or_clear_source_instance(Some("example"));
let x = InstanceTemplate::new().set_or_clear_source_instance(None::<String>);Sourcepub fn set_source_instance_params<T>(self, v: T) -> Selfwhere
T: Into<SourceInstanceParams>,
pub fn set_source_instance_params<T>(self, v: T) -> Selfwhere
T: Into<SourceInstanceParams>,
Sets the value of source_instance_params.
§Example
use google_cloud_compute_v1::model::SourceInstanceParams;
let x = InstanceTemplate::new().set_source_instance_params(SourceInstanceParams::default()/* use setters */);Sourcepub fn set_or_clear_source_instance_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceInstanceParams>,
pub fn set_or_clear_source_instance_params<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceInstanceParams>,
Sets or clears the value of source_instance_params.
§Example
use google_cloud_compute_v1::model::SourceInstanceParams;
let x = InstanceTemplate::new().set_or_clear_source_instance_params(Some(SourceInstanceParams::default()/* use setters */));
let x = InstanceTemplate::new().set_or_clear_source_instance_params(None::<SourceInstanceParams>);Trait Implementations§
Source§impl Clone for InstanceTemplate
impl Clone for InstanceTemplate
Source§fn clone(&self) -> InstanceTemplate
fn clone(&self) -> InstanceTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InstanceTemplate
impl Debug for InstanceTemplate
Source§impl Default for InstanceTemplate
impl Default for InstanceTemplate
Source§fn default() -> InstanceTemplate
fn default() -> InstanceTemplate
Source§impl Message for InstanceTemplate
impl Message for InstanceTemplate
Source§impl PartialEq for InstanceTemplate
impl PartialEq for InstanceTemplate
impl StructuralPartialEq for InstanceTemplate
Auto Trait Implementations§
impl !Freeze for InstanceTemplate
impl RefUnwindSafe for InstanceTemplate
impl Send for InstanceTemplate
impl Sync for InstanceTemplate
impl Unpin for InstanceTemplate
impl UnsafeUnpin for InstanceTemplate
impl UnwindSafe for InstanceTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request