Struct google_api_proto::google::cloud::compute::v1::instances_client::InstancesClient
source · 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,
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,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
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,
sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
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.
sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
sourcepub async fn add_access_config(
&mut self,
request: impl IntoRequest<AddAccessConfigInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn add_resource_policies(
&mut self,
request: impl IntoRequest<AddResourcePoliciesInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn aggregated_list(
&mut self,
request: impl IntoRequest<AggregatedListInstancesRequest>,
) -> Result<Response<InstanceAggregatedList>, Status>
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
.
sourcepub async fn attach_disk(
&mut self,
request: impl IntoRequest<AttachDiskInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn bulk_insert(
&mut self,
request: impl IntoRequest<BulkInsertInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn delete(
&mut self,
request: impl IntoRequest<DeleteInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn delete_access_config(
&mut self,
request: impl IntoRequest<DeleteAccessConfigInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn detach_disk(
&mut self,
request: impl IntoRequest<DetachDiskInstanceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn detach_disk( &mut self, request: impl IntoRequest<DetachDiskInstanceRequest>, ) -> Result<Response<Operation>, Status>
Detaches a disk from an instance.
sourcepub async fn get(
&mut self,
request: impl IntoRequest<GetInstanceRequest>,
) -> Result<Response<Instance>, Status>
pub async fn get( &mut self, request: impl IntoRequest<GetInstanceRequest>, ) -> Result<Response<Instance>, Status>
Returns the specified Instance resource.
sourcepub async fn get_effective_firewalls(
&mut self,
request: impl IntoRequest<GetEffectiveFirewallsInstanceRequest>,
) -> Result<Response<InstancesGetEffectiveFirewallsResponse>, Status>
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.
sourcepub async fn get_guest_attributes(
&mut self,
request: impl IntoRequest<GetGuestAttributesInstanceRequest>,
) -> Result<Response<GuestAttributes>, Status>
pub async fn get_guest_attributes( &mut self, request: impl IntoRequest<GetGuestAttributesInstanceRequest>, ) -> Result<Response<GuestAttributes>, Status>
Returns the specified guest attributes entry.
sourcepub async fn get_iam_policy(
&mut self,
request: impl IntoRequest<GetIamPolicyInstanceRequest>,
) -> Result<Response<Policy>, Status>
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.
sourcepub async fn get_screenshot(
&mut self,
request: impl IntoRequest<GetScreenshotInstanceRequest>,
) -> Result<Response<Screenshot>, Status>
pub async fn get_screenshot( &mut self, request: impl IntoRequest<GetScreenshotInstanceRequest>, ) -> Result<Response<Screenshot>, Status>
Returns the screenshot from the specified instance.
sourcepub async fn get_serial_port_output(
&mut self,
request: impl IntoRequest<GetSerialPortOutputInstanceRequest>,
) -> Result<Response<SerialPortOutput>, Status>
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.
sourcepub async fn get_shielded_instance_identity(
&mut self,
request: impl IntoRequest<GetShieldedInstanceIdentityInstanceRequest>,
) -> Result<Response<ShieldedInstanceIdentity>, Status>
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
sourcepub async fn insert(
&mut self,
request: impl IntoRequest<InsertInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn list(
&mut self,
request: impl IntoRequest<ListInstancesRequest>,
) -> Result<Response<InstanceList>, Status>
pub async fn list( &mut self, request: impl IntoRequest<ListInstancesRequest>, ) -> Result<Response<InstanceList>, Status>
Retrieves the list of instances contained within the specified zone.
sourcepub async fn list_referrers(
&mut self,
request: impl IntoRequest<ListReferrersInstancesRequest>,
) -> Result<Response<InstanceListReferrers>, Status>
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.
sourcepub async fn perform_maintenance(
&mut self,
request: impl IntoRequest<PerformMaintenanceInstanceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn perform_maintenance( &mut self, request: impl IntoRequest<PerformMaintenanceInstanceRequest>, ) -> Result<Response<Operation>, Status>
Perform a manual maintenance on the instance.
sourcepub async fn remove_resource_policies(
&mut self,
request: impl IntoRequest<RemoveResourcePoliciesInstanceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn remove_resource_policies( &mut self, request: impl IntoRequest<RemoveResourcePoliciesInstanceRequest>, ) -> Result<Response<Operation>, Status>
Removes resource policies from an instance.
sourcepub async fn reset(
&mut self,
request: impl IntoRequest<ResetInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn resume(
&mut self,
request: impl IntoRequest<ResumeInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn send_diagnostic_interrupt(
&mut self,
request: impl IntoRequest<SendDiagnosticInterruptInstanceRequest>,
) -> Result<Response<SendDiagnosticInterruptInstanceResponse>, Status>
pub async fn send_diagnostic_interrupt( &mut self, request: impl IntoRequest<SendDiagnosticInterruptInstanceRequest>, ) -> Result<Response<SendDiagnosticInterruptInstanceResponse>, Status>
Sends diagnostic interrupt to the instance.
sourcepub async fn set_deletion_protection(
&mut self,
request: impl IntoRequest<SetDeletionProtectionInstanceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn set_deletion_protection( &mut self, request: impl IntoRequest<SetDeletionProtectionInstanceRequest>, ) -> Result<Response<Operation>, Status>
Sets deletion protection on the instance.
sourcepub async fn set_disk_auto_delete(
&mut self,
request: impl IntoRequest<SetDiskAutoDeleteInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_iam_policy(
&mut self,
request: impl IntoRequest<SetIamPolicyInstanceRequest>,
) -> Result<Response<Policy>, Status>
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.
sourcepub async fn set_labels(
&mut self,
request: impl IntoRequest<SetLabelsInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_machine_resources(
&mut self,
request: impl IntoRequest<SetMachineResourcesInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_machine_type(
&mut self,
request: impl IntoRequest<SetMachineTypeInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_metadata(
&mut self,
request: impl IntoRequest<SetMetadataInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_min_cpu_platform(
&mut self,
request: impl IntoRequest<SetMinCpuPlatformInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_name(
&mut self,
request: impl IntoRequest<SetNameInstanceRequest>,
) -> Result<Response<Operation>, Status>
pub async fn set_name( &mut self, request: impl IntoRequest<SetNameInstanceRequest>, ) -> Result<Response<Operation>, Status>
Sets name of an instance.
sourcepub async fn set_scheduling(
&mut self,
request: impl IntoRequest<SetSchedulingInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_security_policy(
&mut self,
request: impl IntoRequest<SetSecurityPolicyInstanceRequest>,
) -> Result<Response<Operation>, Status>
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
sourcepub async fn set_service_account(
&mut self,
request: impl IntoRequest<SetServiceAccountInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn set_shielded_instance_integrity_policy(
&mut self,
request: impl IntoRequest<SetShieldedInstanceIntegrityPolicyInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
Sets network tags for the specified instance to the data included in the request.
sourcepub async fn simulate_maintenance_event(
&mut self,
request: impl IntoRequest<SimulateMaintenanceEventInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn start(
&mut self,
request: impl IntoRequest<StartInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn start_with_encryption_key(
&mut self,
request: impl IntoRequest<StartWithEncryptionKeyInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn stop(
&mut self,
request: impl IntoRequest<StopInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn suspend(
&mut self,
request: impl IntoRequest<SuspendInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn test_iam_permissions(
&mut self,
request: impl IntoRequest<TestIamPermissionsInstanceRequest>,
) -> Result<Response<TestPermissionsResponse>, Status>
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.
sourcepub async fn update(
&mut self,
request: impl IntoRequest<UpdateInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn update_access_config(
&mut self,
request: impl IntoRequest<UpdateAccessConfigInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn update_display_device(
&mut self,
request: impl IntoRequest<UpdateDisplayDeviceInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn update_network_interface(
&mut self,
request: impl IntoRequest<UpdateNetworkInterfaceInstanceRequest>,
) -> Result<Response<Operation>, Status>
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.
sourcepub async fn update_shielded_instance_config(
&mut self,
request: impl IntoRequest<UpdateShieldedInstanceConfigInstanceRequest>,
) -> Result<Response<Operation>, Status>
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>
impl<T: Clone> Clone for InstancesClient<T>
source§fn clone(&self) -> InstancesClient<T>
fn clone(&self) -> InstancesClient<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request