pub struct InstancesClient<T> { /* private fields */ }
Expand description

The Instances API.

Implementations§

source§

impl<T> InstancesClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F ) -> InstancesClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn add_access_config( &mut self, request: impl IntoRequest<AddAccessConfigInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn add_resource_policies( &mut self, request: impl IntoRequest<AddResourcePoliciesInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn aggregated_list( &mut self, request: impl IntoRequest<AggregatedListInstancesRequest> ) -> Result<Response<InstanceAggregatedList>, Status>

Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

source

pub async fn attach_disk( &mut self, request: impl IntoRequest<AttachDiskInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn bulk_insert( &mut self, request: impl IntoRequest<BulkInsertInstanceRequest> ) -> Result<Response<Operation>, Status>

Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.

source

pub async fn delete( &mut self, request: impl IntoRequest<DeleteInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn delete_access_config( &mut self, request: impl IntoRequest<DeleteAccessConfigInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn detach_disk( &mut self, request: impl IntoRequest<DetachDiskInstanceRequest> ) -> Result<Response<Operation>, Status>

Detaches a disk from an instance.

source

pub async fn get( &mut self, request: impl IntoRequest<GetInstanceRequest> ) -> Result<Response<Instance>, Status>

Returns the specified Instance resource.

source

pub async fn get_effective_firewalls( &mut self, request: impl IntoRequest<GetEffectiveFirewallsInstanceRequest> ) -> Result<Response<InstancesGetEffectiveFirewallsResponse>, Status>

Returns effective firewalls applied to an interface of the instance.

source

pub async fn get_guest_attributes( &mut self, request: impl IntoRequest<GetGuestAttributesInstanceRequest> ) -> Result<Response<GuestAttributes>, Status>

Returns the specified guest attributes entry.

source

pub async fn get_iam_policy( &mut self, request: impl IntoRequest<GetIamPolicyInstanceRequest> ) -> Result<Response<Policy>, Status>

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

source

pub async fn get_screenshot( &mut self, request: impl IntoRequest<GetScreenshotInstanceRequest> ) -> Result<Response<Screenshot>, Status>

Returns the screenshot from the specified instance.

source

pub async fn get_serial_port_output( &mut self, request: impl IntoRequest<GetSerialPortOutputInstanceRequest> ) -> Result<Response<SerialPortOutput>, Status>

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

source

pub async fn get_shielded_instance_identity( &mut self, request: impl IntoRequest<GetShieldedInstanceIdentityInstanceRequest> ) -> Result<Response<ShieldedInstanceIdentity>, Status>

Returns the Shielded Instance Identity of an instance

source

pub async fn insert( &mut self, request: impl IntoRequest<InsertInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn list( &mut self, request: impl IntoRequest<ListInstancesRequest> ) -> Result<Response<InstanceList>, Status>

Retrieves the list of instances contained within the specified zone.

source

pub async fn list_referrers( &mut self, request: impl IntoRequest<ListReferrersInstancesRequest> ) -> Result<Response<InstanceListReferrers>, Status>

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.

source

pub async fn perform_maintenance( &mut self, request: impl IntoRequest<PerformMaintenanceInstanceRequest> ) -> Result<Response<Operation>, Status>

Perform a manual maintenance on the instance.

source

pub async fn remove_resource_policies( &mut self, request: impl IntoRequest<RemoveResourcePoliciesInstanceRequest> ) -> Result<Response<Operation>, Status>

Removes resource policies from an instance.

source

pub async fn reset( &mut self, request: impl IntoRequest<ResetInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn resume( &mut self, request: impl IntoRequest<ResumeInstanceRequest> ) -> Result<Response<Operation>, Status>

Resumes an instance that was suspended using the instances().suspend method.

source

pub async fn send_diagnostic_interrupt( &mut self, request: impl IntoRequest<SendDiagnosticInterruptInstanceRequest> ) -> Result<Response<SendDiagnosticInterruptInstanceResponse>, Status>

Sends diagnostic interrupt to the instance.

source

pub async fn set_deletion_protection( &mut self, request: impl IntoRequest<SetDeletionProtectionInstanceRequest> ) -> Result<Response<Operation>, Status>

Sets deletion protection on the instance.

source

pub async fn set_disk_auto_delete( &mut self, request: impl IntoRequest<SetDiskAutoDeleteInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_iam_policy( &mut self, request: impl IntoRequest<SetIamPolicyInstanceRequest> ) -> Result<Response<Policy>, Status>

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

source

pub async fn set_labels( &mut self, request: impl IntoRequest<SetLabelsInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_machine_resources( &mut self, request: impl IntoRequest<SetMachineResourcesInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_machine_type( &mut self, request: impl IntoRequest<SetMachineTypeInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_metadata( &mut self, request: impl IntoRequest<SetMetadataInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_min_cpu_platform( &mut self, request: impl IntoRequest<SetMinCpuPlatformInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn set_name( &mut self, request: impl IntoRequest<SetNameInstanceRequest> ) -> Result<Response<Operation>, Status>

Sets name of an instance.

source

pub async fn set_scheduling( &mut self, request: impl IntoRequest<SetSchedulingInstanceRequest> ) -> Result<Response<Operation>, Status>

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. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.

source

pub async fn set_security_policy( &mut self, request: impl IntoRequest<SetSecurityPolicyInstanceRequest> ) -> Result<Response<Operation>, Status>

Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview

source

pub async fn set_service_account( &mut self, request: impl IntoRequest<SetServiceAccountInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn set_shielded_instance_integrity_policy( &mut self, request: impl IntoRequest<SetShieldedInstanceIntegrityPolicyInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn set_tags( &mut self, request: impl IntoRequest<SetTagsInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn simulate_maintenance_event( &mut self, request: impl IntoRequest<SimulateMaintenanceEventInstanceRequest> ) -> Result<Response<Operation>, Status>

Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.

source

pub async fn start( &mut self, request: impl IntoRequest<StartInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn start_with_encryption_key( &mut self, request: impl IntoRequest<StartWithEncryptionKeyInstanceRequest> ) -> Result<Response<Operation>, Status>

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

source

pub async fn stop( &mut self, request: impl IntoRequest<StopInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn suspend( &mut self, request: impl IntoRequest<SuspendInstanceRequest> ) -> Result<Response<Operation>, Status>

This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.

source

pub async fn test_iam_permissions( &mut self, request: impl IntoRequest<TestIamPermissionsInstanceRequest> ) -> Result<Response<TestPermissionsResponse>, Status>

Returns permissions that a caller has on the specified resource.

source

pub async fn update( &mut self, request: impl IntoRequest<UpdateInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn update_access_config( &mut self, request: impl IntoRequest<UpdateAccessConfigInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn update_display_device( &mut self, request: impl IntoRequest<UpdateDisplayDeviceInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn update_network_interface( &mut self, request: impl IntoRequest<UpdateNetworkInterfaceInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

source

pub async fn update_shielded_instance_config( &mut self, request: impl IntoRequest<UpdateShieldedInstanceConfigInstanceRequest> ) -> Result<Response<Operation>, Status>

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.

Trait Implementations§

source§

impl<T: Clone> Clone for InstancesClient<T>

source§

fn clone(&self) -> InstancesClient<T>

Returns a copy 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<T: Debug> Debug for InstancesClient<T>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for InstancesClient<T>

§

impl<T> RefUnwindSafe for InstancesClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for InstancesClient<T>
where T: Send,

§

impl<T> Sync for InstancesClient<T>
where T: Sync,

§

impl<T> Unpin for InstancesClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for InstancesClient<T>
where T: UnwindSafe,

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more