Skip to main content

Instance

Struct Instance 

Source
#[non_exhaustive]
pub struct Instance {
Show 46 fields pub advanced_machine_features: Option<AdvancedMachineFeatures>, pub can_ip_forward: Option<bool>, pub confidential_instance_config: Option<ConfidentialInstanceConfig>, pub cpu_platform: Option<String>, pub creation_timestamp: Option<String>, pub deletion_protection: Option<bool>, pub description: Option<String>, pub disks: Vec<AttachedDisk>, pub display_device: Option<DisplayDevice>, pub fingerprint: Option<Bytes>, pub guest_accelerators: Vec<AcceleratorConfig>, pub hostname: Option<String>, pub id: Option<u64>, pub instance_encryption_key: Option<CustomerEncryptionKey>, pub key_revocation_action_type: Option<KeyRevocationActionType>, pub kind: Option<String>, pub label_fingerprint: Option<Bytes>, pub labels: HashMap<String, String>, pub last_start_timestamp: Option<String>, pub last_stop_timestamp: Option<String>, pub last_suspended_timestamp: Option<String>, pub machine_type: Option<String>, pub metadata: Option<Metadata>, pub min_cpu_platform: Option<String>, pub name: Option<String>, pub network_interfaces: Vec<NetworkInterface>, pub network_performance_config: Option<NetworkPerformanceConfig>, pub params: Option<InstanceParams>, pub private_ipv_6_google_access: Option<PrivateIpv6GoogleAccess>, pub reservation_affinity: Option<ReservationAffinity>, pub resource_policies: Vec<String>, pub resource_status: Option<ResourceStatus>, pub satisfies_pzi: Option<bool>, pub satisfies_pzs: Option<bool>, pub scheduling: Option<Scheduling>, pub self_link: Option<String>, pub service_accounts: Vec<ServiceAccount>, pub shielded_instance_config: Option<ShieldedInstanceConfig>, pub shielded_instance_integrity_policy: Option<ShieldedInstanceIntegrityPolicy>, pub source_machine_image: Option<String>, pub source_machine_image_encryption_key: Option<CustomerEncryptionKey>, pub start_restricted: Option<bool>, pub status: Option<Status>, pub status_message: Option<String>, pub tags: Option<Tags>, pub zone: Option<String>, /* private fields */
}
Available on crate feature instances only.
Expand description

Represents an Instance resource.

An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, readVirtual Machine Instances.

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.

§can_ip_forward: Option<bool>

Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, seeEnabling IP Forwarding.

§confidential_instance_config: Option<ConfidentialInstanceConfig>§cpu_platform: Option<String>

Output only. [Output Only] The CPU platform used by this instance.

§creation_timestamp: Option<String>

Output only. [Output Only] Creation timestamp inRFC3339 text format.

§deletion_protection: Option<bool>

Whether the resource should be protected against deletion.

§description: Option<String>

An optional description of this resource. Provide this property when you create the resource.

§disks: Vec<AttachedDisk>

Array of disks associated with this instance. Persistent disks must be created before you can assign them.

§display_device: Option<DisplayDevice>

Enables display device for the instance.

§fingerprint: Option<Bytes>

Specifies a fingerprint for this resource, which is essentially a hash of the instance’s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance.

To see the latest fingerprint, make get() request to the instance.

§guest_accelerators: Vec<AcceleratorConfig>

A list of the type and count of accelerator cards attached to the instance.

§hostname: Option<String>

Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS.

§id: Option<u64>

Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.

§instance_encryption_key: Option<CustomerEncryptionKey>

Encrypts suspended data for an instance with acustomer-managed encryption key.

If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation.

If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation.

§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.

§kind: Option<String>

Output only. [Output Only] Type of the resource. Always compute#instance for instances.

§label_fingerprint: Option<Bytes>

A fingerprint for this request, which is essentially a hash of the label’s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.

To see the latest fingerprint, make get() request to the instance.

§labels: HashMap<String, String>

Labels to apply to this instance. These can be later modified by the setLabels method.

§last_start_timestamp: Option<String>

Output only. [Output Only] Last start timestamp inRFC3339 text format.

§last_stop_timestamp: Option<String>

Output only. [Output Only] Last stop timestamp inRFC3339 text format.

§last_suspended_timestamp: Option<String>

Output only. [Output Only] Last suspended timestamp inRFC3339 text format.

§machine_type: Option<String>

Full or partial URL of the machine type resource to use for this instance, in the format:zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:

zones/us-central1-f/machineTypes/n1-standard-1

To create acustom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, … 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):

zones/zone/machineTypes/custom-CPUS-MEMORY

For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read theSpecifications for custom machine types.

§metadata: Option<Metadata>

The metadata key/value pairs assigned to this instance. This includes metadata keys that were explicitly defined for the instance.

§min_cpu_platform: Option<String>

Specifies aminimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: “Intel Haswell” or minCpuPlatform: “Intel Sandy Bridge”.

§name: Option<String>

The name of the resource, provided by the client when initially creating the resource. The resource 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.

§network_interfaces: Vec<NetworkInterface>

An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.

§network_performance_config: Option<NetworkPerformanceConfig>§params: Option<InstanceParams>

Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload.

§private_ipv_6_google_access: Option<PrivateIpv6GoogleAccess>

The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default.

§reservation_affinity: Option<ReservationAffinity>

Specifies the reservations that this instance can consume from.

§resource_policies: Vec<String>

Resource policies applied to this instance.

§resource_status: Option<ResourceStatus>

Output only. [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field.

§satisfies_pzi: Option<bool>

Output only. [Output Only] Reserved for future use.

§satisfies_pzs: Option<bool>

Output only. [Output Only] Reserved for future use.

§scheduling: Option<Scheduling>

Sets the scheduling options for this instance.

§self_link: Option<String>

Output only. [Output Only] Server-defined URL for this resource.

§service_accounts: Vec<ServiceAccount>

A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.

Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. SeeService Accounts for more information.

§shielded_instance_config: Option<ShieldedInstanceConfig>§shielded_instance_integrity_policy: Option<ShieldedInstanceIntegrityPolicy>§source_machine_image: Option<String>

Source machine image

§source_machine_image_encryption_key: Option<CustomerEncryptionKey>

Source machine image encryption key when creating an instance from a machine image.

§start_restricted: Option<bool>

Output only. [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity.

§status: Option<Status>

Output only. [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING,RUNNING, STOPPING, SUSPENDING,SUSPENDED, REPAIRING, andTERMINATED. For more information about the status of the instance, see Instance life cycle.

§status_message: Option<String>

Output only. [Output Only] An optional, human-readable explanation of the status.

§tags: Option<Tags>

Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply withRFC1035. Multiple tags can be specified via the ‘tags.items’ field.

§zone: Option<String>

Output only. [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

Implementations§

Source§

impl Instance

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 = Instance::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 = Instance::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
let x = Instance::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 = Instance::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 = Instance::new().set_or_clear_can_ip_forward(Some(false));
let x = Instance::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 = Instance::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 = Instance::new().set_or_clear_confidential_instance_config(Some(ConfidentialInstanceConfig::default()/* use setters */));
let x = Instance::new().set_or_clear_confidential_instance_config(None::<ConfidentialInstanceConfig>);
Source

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

Sets the value of cpu_platform.

§Example
let x = Instance::new().set_cpu_platform("example");
Source

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

Sets or clears the value of cpu_platform.

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

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

Sets the value of creation_timestamp.

§Example
let x = Instance::new().set_creation_timestamp("example");
Source

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

Sets or clears the value of creation_timestamp.

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

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

Sets the value of deletion_protection.

§Example
let x = Instance::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 = Instance::new().set_or_clear_deletion_protection(Some(false));
let x = Instance::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 = Instance::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 = Instance::new().set_or_clear_description(Some("example"));
let x = Instance::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 = Instance::new()
    .set_disks([
        AttachedDisk::default()/* use setters */,
        AttachedDisk::default()/* use (different) setters */,
    ]);
Source

pub fn set_display_device<T>(self, v: T) -> Self
where T: Into<DisplayDevice>,

Sets the value of display_device.

§Example
use google_cloud_compute_v1::model::DisplayDevice;
let x = Instance::new().set_display_device(DisplayDevice::default()/* use setters */);
Source

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

Sets or clears the value of display_device.

§Example
use google_cloud_compute_v1::model::DisplayDevice;
let x = Instance::new().set_or_clear_display_device(Some(DisplayDevice::default()/* use setters */));
let x = Instance::new().set_or_clear_display_device(None::<DisplayDevice>);
Source

pub fn set_fingerprint<T>(self, v: T) -> Self
where T: Into<Bytes>,

Sets the value of fingerprint.

§Example
let x = Instance::new().set_fingerprint(bytes::Bytes::from_static(b"example"));
Source

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

Sets or clears the value of fingerprint.

§Example
let x = Instance::new().set_or_clear_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = Instance::new().set_or_clear_fingerprint(None::<bytes::Bytes>);
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 = Instance::new()
    .set_guest_accelerators([
        AcceleratorConfig::default()/* use setters */,
        AcceleratorConfig::default()/* use (different) setters */,
    ]);
Source

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

Sets the value of hostname.

§Example
let x = Instance::new().set_hostname("example");
Source

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

Sets or clears the value of hostname.

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

pub fn set_id<T>(self, v: T) -> Self
where T: Into<u64>,

Sets the value of id.

§Example
let x = Instance::new().set_id(42_u32);
Source

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

Sets or clears the value of id.

§Example
let x = Instance::new().set_or_clear_id(Some(42_u32));
let x = Instance::new().set_or_clear_id(None::<u32>);
Source

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

Sets the value of instance_encryption_key.

§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = Instance::new().set_instance_encryption_key(CustomerEncryptionKey::default()/* use setters */);
Source

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

Sets or clears the value of instance_encryption_key.

§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = Instance::new().set_or_clear_instance_encryption_key(Some(CustomerEncryptionKey::default()/* use setters */));
let x = Instance::new().set_or_clear_instance_encryption_key(None::<CustomerEncryptionKey>);
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::KeyRevocationActionType;
let x0 = Instance::new().set_key_revocation_action_type(KeyRevocationActionType::None);
let x1 = Instance::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::KeyRevocationActionType;
let x0 = Instance::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::None));
let x1 = Instance::new().set_or_clear_key_revocation_action_type(Some(KeyRevocationActionType::Stop));
let x_none = Instance::new().set_or_clear_key_revocation_action_type(None::<KeyRevocationActionType>);
Source

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

Sets the value of kind.

§Example
let x = Instance::new().set_kind("example");
Source

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

Sets or clears the value of kind.

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

pub fn set_label_fingerprint<T>(self, v: T) -> Self
where T: Into<Bytes>,

Sets the value of label_fingerprint.

§Example
let x = Instance::new().set_label_fingerprint(bytes::Bytes::from_static(b"example"));
Source

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

Sets or clears the value of label_fingerprint.

§Example
let x = Instance::new().set_or_clear_label_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = Instance::new().set_or_clear_label_fingerprint(None::<bytes::Bytes>);
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 = Instance::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

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

Sets the value of last_start_timestamp.

§Example
let x = Instance::new().set_last_start_timestamp("example");
Source

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

Sets or clears the value of last_start_timestamp.

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

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

Sets the value of last_stop_timestamp.

§Example
let x = Instance::new().set_last_stop_timestamp("example");
Source

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

Sets or clears the value of last_stop_timestamp.

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

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

Sets the value of last_suspended_timestamp.

§Example
let x = Instance::new().set_last_suspended_timestamp("example");
Source

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

Sets or clears the value of last_suspended_timestamp.

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

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

Sets the value of machine_type.

§Example
let x = Instance::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 = Instance::new().set_or_clear_machine_type(Some("example"));
let x = Instance::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 = Instance::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 = Instance::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
let x = Instance::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 = Instance::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 = Instance::new().set_or_clear_min_cpu_platform(Some("example"));
let x = Instance::new().set_or_clear_min_cpu_platform(None::<String>);
Source

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

Sets the value of name.

§Example
let x = Instance::new().set_name("example");
Source

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

Sets or clears the value of name.

§Example
let x = Instance::new().set_or_clear_name(Some("example"));
let x = Instance::new().set_or_clear_name(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 = Instance::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 = Instance::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 = Instance::new().set_or_clear_network_performance_config(Some(NetworkPerformanceConfig::default()/* use setters */));
let x = Instance::new().set_or_clear_network_performance_config(None::<NetworkPerformanceConfig>);
Source

pub fn set_params<T>(self, v: T) -> Self
where T: Into<InstanceParams>,

Sets the value of params.

§Example
use google_cloud_compute_v1::model::InstanceParams;
let x = Instance::new().set_params(InstanceParams::default()/* use setters */);
Source

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

Sets or clears the value of params.

§Example
use google_cloud_compute_v1::model::InstanceParams;
let x = Instance::new().set_or_clear_params(Some(InstanceParams::default()/* use setters */));
let x = Instance::new().set_or_clear_params(None::<InstanceParams>);
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::PrivateIpv6GoogleAccess;
let x0 = Instance::new().set_private_ipv_6_google_access(PrivateIpv6GoogleAccess::EnableOutboundVmAccessToGoogle);
let x1 = Instance::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::PrivateIpv6GoogleAccess;
let x0 = Instance::new().set_or_clear_private_ipv_6_google_access(Some(PrivateIpv6GoogleAccess::EnableOutboundVmAccessToGoogle));
let x1 = Instance::new().set_or_clear_private_ipv_6_google_access(Some(PrivateIpv6GoogleAccess::InheritFromSubnetwork));
let x_none = Instance::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 = Instance::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 = Instance::new().set_or_clear_reservation_affinity(Some(ReservationAffinity::default()/* use setters */));
let x = Instance::new().set_or_clear_reservation_affinity(None::<ReservationAffinity>);
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 = Instance::new().set_resource_policies(["a", "b", "c"]);
Source

pub fn set_resource_status<T>(self, v: T) -> Self
where T: Into<ResourceStatus>,

Sets the value of resource_status.

§Example
use google_cloud_compute_v1::model::ResourceStatus;
let x = Instance::new().set_resource_status(ResourceStatus::default()/* use setters */);
Source

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

Sets or clears the value of resource_status.

§Example
use google_cloud_compute_v1::model::ResourceStatus;
let x = Instance::new().set_or_clear_resource_status(Some(ResourceStatus::default()/* use setters */));
let x = Instance::new().set_or_clear_resource_status(None::<ResourceStatus>);
Source

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

Sets the value of satisfies_pzi.

§Example
let x = Instance::new().set_satisfies_pzi(true);
Source

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

Sets or clears the value of satisfies_pzi.

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

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

Sets the value of satisfies_pzs.

§Example
let x = Instance::new().set_satisfies_pzs(true);
Source

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

Sets or clears the value of satisfies_pzs.

§Example
let x = Instance::new().set_or_clear_satisfies_pzs(Some(false));
let x = Instance::new().set_or_clear_satisfies_pzs(None::<bool>);
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 = Instance::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 = Instance::new().set_or_clear_scheduling(Some(Scheduling::default()/* use setters */));
let x = Instance::new().set_or_clear_scheduling(None::<Scheduling>);

Sets the value of self_link.

§Example
let x = Instance::new().set_self_link("example");

Sets or clears the value of self_link.

§Example
let x = Instance::new().set_or_clear_self_link(Some("example"));
let x = Instance::new().set_or_clear_self_link(None::<String>);
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 = Instance::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 = Instance::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 = Instance::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
let x = Instance::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
Source

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

Sets the value of shielded_instance_integrity_policy.

§Example
use google_cloud_compute_v1::model::ShieldedInstanceIntegrityPolicy;
let x = Instance::new().set_shielded_instance_integrity_policy(ShieldedInstanceIntegrityPolicy::default()/* use setters */);
Source

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

Sets or clears the value of shielded_instance_integrity_policy.

§Example
use google_cloud_compute_v1::model::ShieldedInstanceIntegrityPolicy;
let x = Instance::new().set_or_clear_shielded_instance_integrity_policy(Some(ShieldedInstanceIntegrityPolicy::default()/* use setters */));
let x = Instance::new().set_or_clear_shielded_instance_integrity_policy(None::<ShieldedInstanceIntegrityPolicy>);
Source

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

Sets the value of source_machine_image.

§Example
let x = Instance::new().set_source_machine_image("example");
Source

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

Sets or clears the value of source_machine_image.

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

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

Sets the value of source_machine_image_encryption_key.

§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = Instance::new().set_source_machine_image_encryption_key(CustomerEncryptionKey::default()/* use setters */);
Source

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

Sets or clears the value of source_machine_image_encryption_key.

§Example
use google_cloud_compute_v1::model::CustomerEncryptionKey;
let x = Instance::new().set_or_clear_source_machine_image_encryption_key(Some(CustomerEncryptionKey::default()/* use setters */));
let x = Instance::new().set_or_clear_source_machine_image_encryption_key(None::<CustomerEncryptionKey>);
Source

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

Sets the value of start_restricted.

§Example
let x = Instance::new().set_start_restricted(true);
Source

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

Sets or clears the value of start_restricted.

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

pub fn set_status<T>(self, v: T) -> Self
where T: Into<Status>,

Sets the value of status.

§Example
use google_cloud_compute_v1::model::instance::Status;
let x0 = Instance::new().set_status(Status::Pending);
let x1 = Instance::new().set_status(Status::Provisioning);
let x2 = Instance::new().set_status(Status::Repairing);
Source

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

Sets or clears the value of status.

§Example
use google_cloud_compute_v1::model::instance::Status;
let x0 = Instance::new().set_or_clear_status(Some(Status::Pending));
let x1 = Instance::new().set_or_clear_status(Some(Status::Provisioning));
let x2 = Instance::new().set_or_clear_status(Some(Status::Repairing));
let x_none = Instance::new().set_or_clear_status(None::<Status>);
Source

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

Sets the value of status_message.

§Example
let x = Instance::new().set_status_message("example");
Source

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

Sets or clears the value of status_message.

§Example
let x = Instance::new().set_or_clear_status_message(Some("example"));
let x = Instance::new().set_or_clear_status_message(None::<String>);
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 = Instance::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 = Instance::new().set_or_clear_tags(Some(Tags::default()/* use setters */));
let x = Instance::new().set_or_clear_tags(None::<Tags>);
Source

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

Sets the value of zone.

§Example
let x = Instance::new().set_zone("example");
Source

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

Sets or clears the value of zone.

§Example
let x = Instance::new().set_or_clear_zone(Some("example"));
let x = Instance::new().set_or_clear_zone(None::<String>);

Trait Implementations§

Source§

impl Clone for Instance

Source§

fn clone(&self) -> Instance

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 Instance

Source§

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

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

impl Default for Instance

Source§

fn default() -> Instance

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

impl Message for Instance

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Instance

Source§

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

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