Skip to main content

InstanceProperties

Struct InstanceProperties 

Source
#[non_exhaustive]
pub struct InstanceProperties {
Show 21 fields pub advanced_machine_features: Option<AdvancedMachineFeatures>, pub can_ip_forward: Option<bool>, pub confidential_instance_config: Option<ConfidentialInstanceConfig>, pub description: Option<String>, pub disks: Vec<AttachedDisk>, pub guest_accelerators: Vec<AcceleratorConfig>, pub key_revocation_action_type: Option<KeyRevocationActionType>, pub labels: HashMap<String, String>, pub machine_type: Option<String>, pub metadata: Option<Metadata>, pub min_cpu_platform: Option<String>, pub network_interfaces: Vec<NetworkInterface>, pub network_performance_config: Option<NetworkPerformanceConfig>, pub private_ipv_6_google_access: Option<PrivateIpv6GoogleAccess>, pub reservation_affinity: Option<ReservationAffinity>, pub resource_manager_tags: HashMap<String, String>, pub resource_policies: Vec<String>, pub scheduling: Option<Scheduling>, pub service_accounts: Vec<ServiceAccount>, pub shielded_instance_config: Option<ShieldedInstanceConfig>, pub tags: Option<Tags>, /* private fields */
}
Available on crate features instance-templates or instances or machine-images or region-instance-templates or region-instances only.

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.
§advanced_machine_features: Option<AdvancedMachineFeatures>

Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet.

§can_ip_forward: Option<bool>

Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set tofalse. See theEnable IP forwarding documentation for more information.

§confidential_instance_config: Option<ConfidentialInstanceConfig>

Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet.

§description: Option<String>

An optional text description for the instances that are created from these properties.

§disks: Vec<AttachedDisk>

An array of disks that are associated with the instances that are created from these properties.

§guest_accelerators: Vec<AcceleratorConfig>

A list of guest accelerator cards’ type and count to use for instances created from these properties.

§key_revocation_action_type: Option<KeyRevocationActionType>

KeyRevocationActionType of the instance. Supported options are “STOP” and “NONE”. The default value is “NONE” if it is not specified.

§labels: HashMap<String, String>

Labels to apply to instances that are created from these properties.

§machine_type: Option<String>

The machine type to use for instances that are created from these properties. This field only accepts a machine type name, for example n2-standard-4. If you use the machine type full or partial URL, for example projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4, the request will result in an INTERNAL_ERROR.

§metadata: Option<Metadata>

The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. SeeProject and instance metadata for more information.

§min_cpu_platform: Option<String>

Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such asminCpuPlatform: “Intel Haswell” orminCpuPlatform: “Intel Sandy Bridge”. For more information, read Specifying a Minimum CPU Platform.

§network_interfaces: Vec<NetworkInterface>

An array of network access configurations for this interface.

§network_performance_config: Option<NetworkPerformanceConfig>

Note that for MachineImage, this is not supported yet.

§private_ipv_6_google_access: Option<PrivateIpv6GoogleAccess>

The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet.

§reservation_affinity: Option<ReservationAffinity>

Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet.

§resource_manager_tags: HashMap<String, String>

Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored (both PUT & PATCH) when empty.

§resource_policies: Vec<String>

Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet.

§scheduling: Option<Scheduling>

Specifies the scheduling options for the instances that are created from these properties.

§service_accounts: Vec<ServiceAccount>

A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances.

§shielded_instance_config: Option<ShieldedInstanceConfig>

Note that for MachineImage, this is not supported yet.

§tags: Option<Tags>

A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035.

Implementations§

Source§

impl InstanceProperties

Source

pub fn new() -> Self

Source

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

Sets the value of advanced_machine_features.

§Example
use google_cloud_compute_v1::model::AdvancedMachineFeatures;
let x = InstanceProperties::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
Source

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

Sets or clears the value of advanced_machine_features.

§Example
use google_cloud_compute_v1::model::AdvancedMachineFeatures;
let x = InstanceProperties::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
Source

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

Sets the value of can_ip_forward.

§Example
let x = InstanceProperties::new().set_can_ip_forward(true);
Source

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

Sets or clears the value of can_ip_forward.

§Example
let x = InstanceProperties::new().set_or_clear_can_ip_forward(Some(false));
let x = InstanceProperties::new().set_or_clear_can_ip_forward(None::<bool>);
Source

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

Sets the value of confidential_instance_config.

§Example
use google_cloud_compute_v1::model::ConfidentialInstanceConfig;
let x = InstanceProperties::new().set_confidential_instance_config(ConfidentialInstanceConfig::default()/* use setters */);
Source

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

Sets or clears the value of confidential_instance_config.

§Example
use google_cloud_compute_v1::model::ConfidentialInstanceConfig;
let x = InstanceProperties::new().set_or_clear_confidential_instance_config(Some(ConfidentialInstanceConfig::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_confidential_instance_config(None::<ConfidentialInstanceConfig>);
Source

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

Sets the value of description.

§Example
let x = InstanceProperties::new().set_description("example");
Source

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

Sets or clears the value of description.

§Example
let x = InstanceProperties::new().set_or_clear_description(Some("example"));
let x = InstanceProperties::new().set_or_clear_description(None::<String>);
Source

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

Sets the value of disks.

§Example
use google_cloud_compute_v1::model::AttachedDisk;
let x = InstanceProperties::new()
    .set_disks([
        AttachedDisk::default()/* use setters */,
        AttachedDisk::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of guest_accelerators.

§Example
use google_cloud_compute_v1::model::AcceleratorConfig;
let x = InstanceProperties::new()
    .set_guest_accelerators([
        AcceleratorConfig::default()/* use setters */,
        AcceleratorConfig::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of key_revocation_action_type.

§Example
use google_cloud_compute_v1::model::instance_properties::KeyRevocationActionType;
let x0 = InstanceProperties::new().set_key_revocation_action_type(KeyRevocationActionType::None);
let x1 = InstanceProperties::new().set_key_revocation_action_type(KeyRevocationActionType::Stop);
Source

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

Sets or clears the value of key_revocation_action_type.

§Example
use google_cloud_compute_v1::model::instance_properties::KeyRevocationActionType;
let x0 = InstanceProperties::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::None));
let x1 = InstanceProperties::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::Stop));
let x_none = InstanceProperties::new().set_or_clear_key_revocation_action_type(None::<KeyRevocationActionType>);
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 = InstanceProperties::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

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

Sets the value of machine_type.

§Example
let x = InstanceProperties::new().set_machine_type("example");
Source

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

Sets or clears the value of machine_type.

§Example
let x = InstanceProperties::new().set_or_clear_machine_type(Some("example"));
let x = InstanceProperties::new().set_or_clear_machine_type(None::<String>);
Source

pub fn set_metadata<T>(self, v: T) -> Self
where T: Into<Metadata>,

Sets the value of metadata.

§Example
use google_cloud_compute_v1::model::Metadata;
let x = InstanceProperties::new().set_metadata(Metadata::default()/* use setters */);
Source

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

Sets or clears the value of metadata.

§Example
use google_cloud_compute_v1::model::Metadata;
let x = InstanceProperties::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_metadata(None::<Metadata>);
Source

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

Sets the value of min_cpu_platform.

§Example
let x = InstanceProperties::new().set_min_cpu_platform("example");
Source

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

Sets or clears the value of min_cpu_platform.

§Example
let x = InstanceProperties::new().set_or_clear_min_cpu_platform(Some("example"));
let x = InstanceProperties::new().set_or_clear_min_cpu_platform(None::<String>);
Source

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

Sets the value of network_interfaces.

§Example
use google_cloud_compute_v1::model::NetworkInterface;
let x = InstanceProperties::new()
    .set_network_interfaces([
        NetworkInterface::default()/* use setters */,
        NetworkInterface::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of network_performance_config.

§Example
use google_cloud_compute_v1::model::NetworkPerformanceConfig;
let x = InstanceProperties::new().set_network_performance_config(NetworkPerformanceConfig::default()/* use setters */);
Source

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

Sets or clears the value of network_performance_config.

§Example
use google_cloud_compute_v1::model::NetworkPerformanceConfig;
let x = InstanceProperties::new().set_or_clear_network_performance_config(Some(NetworkPerformanceConfig::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_network_performance_config(None::<NetworkPerformanceConfig>);
Source

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

Sets the value of private_ipv_6_google_access.

§Example
use google_cloud_compute_v1::model::instance_properties::PrivateIpv6GoogleAccess;
let x0 = InstanceProperties::new().set_private_ipv_6_google_access(PrivateIpv6GoogleAccess::EnableOutboundVmAccessToGoogle);
let x1 = InstanceProperties::new().set_private_ipv_6_google_access(PrivateIpv6GoogleAccess::InheritFromSubnetwork);
Source

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

Sets or clears the value of private_ipv_6_google_access.

§Example
use google_cloud_compute_v1::model::instance_properties::PrivateIpv6GoogleAccess;
let x0 = InstanceProperties::new().set_or_clear_private_ipv_6_google_access(Some(PrivateIpv6GoogleAccess::EnableOutboundVmAccessToGoogle));
let x1 = InstanceProperties::new().set_or_clear_private_ipv_6_google_access(Some(PrivateIpv6GoogleAccess::InheritFromSubnetwork));
let x_none = InstanceProperties::new().set_or_clear_private_ipv_6_google_access(None::<PrivateIpv6GoogleAccess>);
Source

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

Sets the value of reservation_affinity.

§Example
use google_cloud_compute_v1::model::ReservationAffinity;
let x = InstanceProperties::new().set_reservation_affinity(ReservationAffinity::default()/* use setters */);
Source

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

Sets or clears the value of reservation_affinity.

§Example
use google_cloud_compute_v1::model::ReservationAffinity;
let x = InstanceProperties::new().set_or_clear_reservation_affinity(Some(ReservationAffinity::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_reservation_affinity(None::<ReservationAffinity>);
Source

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

Sets the value of resource_manager_tags.

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

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

Sets the value of resource_policies.

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

pub fn set_scheduling<T>(self, v: T) -> Self
where T: Into<Scheduling>,

Sets the value of scheduling.

§Example
use google_cloud_compute_v1::model::Scheduling;
let x = InstanceProperties::new().set_scheduling(Scheduling::default()/* use setters */);
Source

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

Sets or clears the value of scheduling.

§Example
use google_cloud_compute_v1::model::Scheduling;
let x = InstanceProperties::new().set_or_clear_scheduling(Some(Scheduling::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_scheduling(None::<Scheduling>);
Source

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

Sets the value of service_accounts.

§Example
use google_cloud_compute_v1::model::ServiceAccount;
let x = InstanceProperties::new()
    .set_service_accounts([
        ServiceAccount::default()/* use setters */,
        ServiceAccount::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of shielded_instance_config.

§Example
use google_cloud_compute_v1::model::ShieldedInstanceConfig;
let x = InstanceProperties::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
Source

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

Sets or clears the value of shielded_instance_config.

§Example
use google_cloud_compute_v1::model::ShieldedInstanceConfig;
let x = InstanceProperties::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
Source

pub fn set_tags<T>(self, v: T) -> Self
where T: Into<Tags>,

Sets the value of tags.

§Example
use google_cloud_compute_v1::model::Tags;
let x = InstanceProperties::new().set_tags(Tags::default()/* use setters */);
Source

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

Sets or clears the value of tags.

§Example
use google_cloud_compute_v1::model::Tags;
let x = InstanceProperties::new().set_or_clear_tags(Some(Tags::default()/* use setters */));
let x = InstanceProperties::new().set_or_clear_tags(None::<Tags>);

Trait Implementations§

Source§

impl Clone for InstanceProperties

Source§

fn clone(&self) -> InstanceProperties

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 InstanceProperties

Source§

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

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

impl Default for InstanceProperties

Source§

fn default() -> InstanceProperties

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

impl Message for InstanceProperties

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for InstanceProperties

Source§

fn eq(&self, other: &InstanceProperties) -> 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 InstanceProperties

Auto Trait Implementations§

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>,