Struct google_compute1::api::InstanceMethods[][src]

pub struct InstanceMethods<'a, C> where
    C: 'a, 
{ /* fields omitted */ }

A builder providing access to all methods supported on instance resources. It is not used directly, but through the Compute hub.

Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate yup_oauth2 as oauth2;
extern crate google_compute1 as compute1;
 
use std::default::Default;
use oauth2;
use compute1::Compute;
 
let secret: oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
        secret,
        yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
    ).build().await.unwrap();
let mut hub = Compute::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `add_access_config(...)`, `add_resource_policies(...)`, `aggregated_list(...)`, `attach_disk(...)`, `bulk_insert(...)`, `delete(...)`, `delete_access_config(...)`, `detach_disk(...)`, `get(...)`, `get_effective_firewalls(...)`, `get_guest_attributes(...)`, `get_iam_policy(...)`, `get_screenshot(...)`, `get_serial_port_output(...)`, `get_shielded_instance_identity(...)`, `insert(...)`, `list(...)`, `list_referrers(...)`, `remove_resource_policies(...)`, `reset(...)`, `set_deletion_protection(...)`, `set_disk_auto_delete(...)`, `set_iam_policy(...)`, `set_labels(...)`, `set_machine_resources(...)`, `set_machine_type(...)`, `set_metadata(...)`, `set_min_cpu_platform(...)`, `set_scheduling(...)`, `set_service_account(...)`, `set_shielded_instance_integrity_policy(...)`, `set_tags(...)`, `simulate_maintenance_event(...)`, `start(...)`, `start_with_encryption_key(...)`, `stop(...)`, `test_iam_permissions(...)`, `update(...)`, `update_access_config(...)`, `update_display_device(...)`, `update_network_interface(...)` and `update_shielded_instance_config(...)`
// to build up your call.
let rb = hub.instances();

Implementations

impl<'a, C> InstanceMethods<'a, C>[src]

pub fn add_access_config(
    &self,
    request: AccessConfig,
    project: &str,
    zone: &str,
    instance: &str,
    network_interface: &str
) -> InstanceAddAccessConfigCall<'a, C>
[src]

Create a builder to help you perform the following task:

Adds an access config to an instance's network interface.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.
  • networkInterface - The name of the network interface to add to this instance.

pub fn add_resource_policies(
    &self,
    request: InstancesAddResourcePoliciesRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceAddResourcePolicyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.

pub fn aggregated_list(
    &self,
    project: &str
) -> InstanceAggregatedListCall<'a, C>
[src]

Create a builder to help you perform the following task:

Retrieves aggregated list of all of the instances in your project across all regions and zones.

Arguments

  • project - Project ID for this request.

pub fn attach_disk(
    &self,
    request: AttachedDisk,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceAttachDiskCall<'a, C>
[src]

Create a builder to help you perform the following task:

Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.

pub fn bulk_insert(
    &self,
    request: BulkInsertInstanceResource,
    project: &str,
    zone: &str
) -> InstanceBulkInsertCall<'a, C>
[src]

Create a builder to help you perform the following task:

Creates multiple instances. Count specifies the number of instances to create.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.

pub fn delete(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceDeleteCall<'a, C>
[src]

Create a builder to help you perform the following task:

Deletes the specified Instance resource. For more information, see Deleting an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to delete.

pub fn delete_access_config(
    &self,
    project: &str,
    zone: &str,
    instance: &str,
    access_config: &str,
    network_interface: &str
) -> InstanceDeleteAccessConfigCall<'a, C>
[src]

Create a builder to help you perform the following task:

Deletes an access config from an instance's network interface.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.
  • accessConfig - The name of the access config to delete.
  • networkInterface - The name of the network interface.

pub fn detach_disk(
    &self,
    project: &str,
    zone: &str,
    instance: &str,
    device_name: &str
) -> InstanceDetachDiskCall<'a, C>
[src]

Create a builder to help you perform the following task:

Detaches a disk from an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Instance name for this request.
  • deviceName - The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.

pub fn get(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceGetCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns the specified Instance resource. Gets a list of available instances by making a list() request.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to return.

pub fn get_effective_firewalls(
    &self,
    project: &str,
    zone: &str,
    instance: &str,
    network_interface: &str
) -> InstanceGetEffectiveFirewallCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns effective firewalls applied to an interface of the instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.
  • networkInterface - The name of the network interface to get the effective firewalls.

pub fn get_guest_attributes(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceGetGuestAttributeCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns the specified guest attributes entry.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn get_iam_policy(
    &self,
    project: &str,
    zone: &str,
    resource: &str
) -> InstanceGetIamPolicyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • resource - Name or id of the resource for this request.

pub fn get_screenshot(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceGetScreenshotCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns the screenshot from the specified instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn get_serial_port_output(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceGetSerialPortOutputCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns the last 1 MB of serial port output from the specified instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance for this request.

pub fn get_shielded_instance_identity(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceGetShieldedInstanceIdentityCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns the Shielded Instance Identity of an instance

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name or id of the instance scoping this request.

pub fn insert(
    &self,
    request: Instance,
    project: &str,
    zone: &str
) -> InstanceInsertCall<'a, C>
[src]

Create a builder to help you perform the following task:

Creates an instance resource in the specified project using the data included in the request.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.

pub fn list(&self, project: &str, zone: &str) -> InstanceListCall<'a, C>[src]

Create a builder to help you perform the following task:

Retrieves the list of instances contained within the specified zone.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.

pub fn list_referrers(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceListReferrerCall<'a, C>
[src]

Create a builder to help you perform the following task:

Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.

pub fn remove_resource_policies(
    &self,
    request: InstancesRemoveResourcePoliciesRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceRemoveResourcePolicyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Removes resource policies from an instance.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.

pub fn reset(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceResetCall<'a, C>
[src]

Create a builder to help you perform the following task:

Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_deletion_protection(
    &self,
    project: &str,
    zone: &str,
    resource: &str
) -> InstanceSetDeletionProtectionCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets deletion protection on the instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • resource - Name or id of the resource for this request.

pub fn set_disk_auto_delete(
    &self,
    project: &str,
    zone: &str,
    instance: &str,
    auto_delete: bool,
    device_name: &str
) -> InstanceSetDiskAutoDeleteCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets the auto-delete flag for a disk attached to an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.
  • autoDelete - Whether to auto-delete the disk when the instance is deleted.
  • deviceName - The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.

pub fn set_iam_policy(
    &self,
    request: ZoneSetPolicyRequest,
    project: &str,
    zone: &str,
    resource: &str
) -> InstanceSetIamPolicyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets the access control policy on the specified resource. Replaces any existing policy.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • resource - Name or id of the resource for this request.

pub fn set_labels(
    &self,
    request: InstancesSetLabelsRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetLabelCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_machine_resources(
    &self,
    request: InstancesSetMachineResourcesRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetMachineResourceCall<'a, C>
[src]

Create a builder to help you perform the following task:

Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_machine_type(
    &self,
    request: InstancesSetMachineTypeRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetMachineTypeCall<'a, C>
[src]

Create a builder to help you perform the following task:

Changes the machine type for a stopped instance to the machine type specified in the request.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_metadata(
    &self,
    request: Metadata,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetMetadataCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets metadata for the specified instance to the data included in the request.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_min_cpu_platform(
    &self,
    request: InstancesSetMinCpuPlatformRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetMinCpuPlatformCall<'a, C>
[src]

Create a builder to help you perform the following task:

Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn set_scheduling(
    &self,
    request: Scheduling,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetSchedulingCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Instance name for this request.

pub fn set_service_account(
    &self,
    request: InstancesSetServiceAccountRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetServiceAccountCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to start.

pub fn set_shielded_instance_integrity_policy(
    &self,
    request: ShieldedInstanceIntegrityPolicy,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetShieldedInstanceIntegrityPolicyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name or id of the instance scoping this request.

pub fn set_tags(
    &self,
    request: Tags,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSetTagCall<'a, C>
[src]

Create a builder to help you perform the following task:

Sets network tags for the specified instance to the data included in the request.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn simulate_maintenance_event(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceSimulateMaintenanceEventCall<'a, C>
[src]

Create a builder to help you perform the following task:

Simulates a maintenance event on the instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn start(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceStartCall<'a, C>
[src]

Create a builder to help you perform the following task:

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to start.

pub fn start_with_encryption_key(
    &self,
    request: InstancesStartWithEncryptionKeyRequest,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceStartWithEncryptionKeyCall<'a, C>
[src]

Create a builder to help you perform the following task:

Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to start.

pub fn stop(
    &self,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceStopCall<'a, C>
[src]

Create a builder to help you perform the following task:

Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.

Arguments

  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to stop.

pub fn test_iam_permissions(
    &self,
    request: TestPermissionsRequest,
    project: &str,
    zone: &str,
    resource: &str
) -> InstanceTestIamPermissionCall<'a, C>
[src]

Create a builder to help you perform the following task:

Returns permissions that a caller has on the specified resource.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • resource - Name or id of the resource for this request.

pub fn update(
    &self,
    request: Instance,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceUpdateCall<'a, C>
[src]

Create a builder to help you perform the following task:

Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance resource to update.

pub fn update_access_config(
    &self,
    request: AccessConfig,
    project: &str,
    zone: &str,
    instance: &str,
    network_interface: &str
) -> InstanceUpdateAccessConfigCall<'a, C>
[src]

Create a builder to help you perform the following task:

Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.
  • networkInterface - The name of the network interface where the access config is attached.

pub fn update_display_device(
    &self,
    request: DisplayDevice,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceUpdateDisplayDeviceCall<'a, C>
[src]

Create a builder to help you perform the following task:

Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name of the instance scoping this request.

pub fn update_network_interface(
    &self,
    request: NetworkInterface,
    project: &str,
    zone: &str,
    instance: &str,
    network_interface: &str
) -> InstanceUpdateNetworkInterfaceCall<'a, C>
[src]

Create a builder to help you perform the following task:

Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - The instance name for this request.
  • networkInterface - The name of the network interface to update.

pub fn update_shielded_instance_config(
    &self,
    request: ShieldedInstanceConfig,
    project: &str,
    zone: &str,
    instance: &str
) -> InstanceUpdateShieldedInstanceConfigCall<'a, C>
[src]

Create a builder to help you perform the following task:

Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Arguments

  • request - No description provided.
  • project - Project ID for this request.
  • zone - The name of the zone for this request.
  • instance - Name or id of the instance scoping this request.

Trait Implementations

impl<'a, C> MethodsBuilder for InstanceMethods<'a, C>[src]

Auto Trait Implementations

impl<'a, C> !RefUnwindSafe for InstanceMethods<'a, C>[src]

impl<'a, C> !Send for InstanceMethods<'a, C>[src]

impl<'a, C> !Sync for InstanceMethods<'a, C>[src]

impl<'a, C> Unpin for InstanceMethods<'a, C>[src]

impl<'a, C> !UnwindSafe for InstanceMethods<'a, C>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.