Skip to main content

SourceInstanceProperties

Struct SourceInstanceProperties 

Source
#[non_exhaustive]
pub struct SourceInstanceProperties {
Show 15 fields pub can_ip_forward: Option<bool>, pub deletion_protection: Option<bool>, pub description: Option<String>, pub disks: Vec<SavedAttachedDisk>, 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 post_key_revocation_action_type: Option<PostKeyRevocationActionType>, pub scheduling: Option<Scheduling>, pub service_accounts: Vec<ServiceAccount>, pub tags: Option<Tags>, /* private fields */
}
Available on crate feature machine-images only.
Expand description

DEPRECATED: Please use compute#instanceProperties instead. New properties will not be added to this field.

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.
§can_ip_forward: Option<bool>

Enables instances created based on this machine image 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.

§deletion_protection: Option<bool>

Whether the instance created from this machine image should be protected against deletion.

§description: Option<String>

An optional text description for the instances that are created from this machine image.

§disks: Vec<SavedAttachedDisk>

An array of disks that are associated with the instances that are created from this machine image.

§guest_accelerators: Vec<AcceleratorConfig>

A list of guest accelerator cards’ type and count to use for instances created from this machine image.

§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 this machine image.

§machine_type: Option<String>

The machine type to use for instances that are created from this machine image.

§metadata: Option<Metadata>

The metadata key/value pairs to assign to instances that are created from this machine image. 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 created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: “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.

§post_key_revocation_action_type: Option<PostKeyRevocationActionType>

PostKeyRevocationActionType of the instance.

§scheduling: Option<Scheduling>

Specifies the scheduling options for the instances that are created from this machine image.

§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 this machine image. Use metadata queries to obtain the access tokens for these instances.

§tags: Option<Tags>

A list of tags to apply to the instances that are created from this machine image. 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 withRFC1035.

Implementations§

Source§

impl SourceInstanceProperties

Source

pub fn new() -> Self

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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_can_ip_forward(Some(false));
let x = SourceInstanceProperties::new().set_or_clear_can_ip_forward(None::<bool>);
Source

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

Sets the value of deletion_protection.

§Example
let x = SourceInstanceProperties::new().set_deletion_protection(true);
Source

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

Sets or clears the value of deletion_protection.

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

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

Sets the value of description.

§Example
let x = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_description(Some("example"));
let x = SourceInstanceProperties::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<SavedAttachedDisk>,

Sets the value of disks.

§Example
use google_cloud_compute_v1::model::SavedAttachedDisk;
let x = SourceInstanceProperties::new()
    .set_disks([
        SavedAttachedDisk::default()/* use setters */,
        SavedAttachedDisk::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 = SourceInstanceProperties::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::source_instance_properties::KeyRevocationActionType;
let x0 = SourceInstanceProperties::new().set_key_revocation_action_type(KeyRevocationActionType::None);
let x1 = SourceInstanceProperties::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::source_instance_properties::KeyRevocationActionType;
let x0 = SourceInstanceProperties::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::None));
let x1 = SourceInstanceProperties::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::Stop));
let x_none = SourceInstanceProperties::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 = SourceInstanceProperties::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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_machine_type(Some("example"));
let x = SourceInstanceProperties::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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
let x = SourceInstanceProperties::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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_min_cpu_platform(Some("example"));
let x = SourceInstanceProperties::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 = SourceInstanceProperties::new()
    .set_network_interfaces([
        NetworkInterface::default()/* use setters */,
        NetworkInterface::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of post_key_revocation_action_type.

§Example
use google_cloud_compute_v1::model::source_instance_properties::PostKeyRevocationActionType;
let x0 = SourceInstanceProperties::new().set_post_key_revocation_action_type(PostKeyRevocationActionType::Unspecified);
let x1 = SourceInstanceProperties::new().set_post_key_revocation_action_type(PostKeyRevocationActionType::Shutdown);
Source

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

Sets or clears the value of post_key_revocation_action_type.

§Example
use google_cloud_compute_v1::model::source_instance_properties::PostKeyRevocationActionType;
let x0 = SourceInstanceProperties::new().set_or_clear_post_key_revocation_action_type(Some(PostKeyRevocationActionType::Unspecified));
let x1 = SourceInstanceProperties::new().set_or_clear_post_key_revocation_action_type(Some(PostKeyRevocationActionType::Shutdown));
let x_none = SourceInstanceProperties::new().set_or_clear_post_key_revocation_action_type(None::<PostKeyRevocationActionType>);
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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_scheduling(Some(Scheduling::default()/* use setters */));
let x = SourceInstanceProperties::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 = SourceInstanceProperties::new()
    .set_service_accounts([
        ServiceAccount::default()/* use setters */,
        ServiceAccount::default()/* use (different) setters */,
    ]);
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 = SourceInstanceProperties::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 = SourceInstanceProperties::new().set_or_clear_tags(Some(Tags::default()/* use setters */));
let x = SourceInstanceProperties::new().set_or_clear_tags(None::<Tags>);

Trait Implementations§

Source§

impl Clone for SourceInstanceProperties

Source§

fn clone(&self) -> SourceInstanceProperties

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 SourceInstanceProperties

Source§

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

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

impl Default for SourceInstanceProperties

Source§

fn default() -> SourceInstanceProperties

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

impl Message for SourceInstanceProperties

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for SourceInstanceProperties

Source§

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

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