Compute Engine v1 API - Class Instances.InstancesBase (2.7.0)

[BindServiceMethod(typeof(Instances), "BindService")]
public abstract class Instances.InstancesBase

Reference documentation and code samples for the Compute Engine v1 API class Instances.InstancesBase.

Base class for server-side implementations of Instances

Inheritance

object > Instances.InstancesBase

Namespace

GoogleCloudGoogle.Cloud.ComputeV1

Assembly

Google.Cloud.Compute.V1.dll

Methods

AddAccessConfig(AddAccessConfigInstanceRequest, ServerCallContext)

public virtual Task<Operation> AddAccessConfig(AddAccessConfigInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestAddAccessConfigInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

AddResourcePolicies(AddResourcePoliciesInstanceRequest, ServerCallContext)

public virtual Task<Operation> AddResourcePolicies(AddResourcePoliciesInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestAddResourcePoliciesInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

AggregatedList(AggregatedListInstancesRequest, ServerCallContext)

public virtual Task<InstanceAggregatedList> AggregatedList(AggregatedListInstancesRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestAggregatedListInstancesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskInstanceAggregatedList

The response to send back to the client (wrapped by a task).

AttachDisk(AttachDiskInstanceRequest, ServerCallContext)

public virtual Task<Operation> AttachDisk(AttachDiskInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestAttachDiskInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

BulkInsert(BulkInsertInstanceRequest, ServerCallContext)

public virtual Task<Operation> BulkInsert(BulkInsertInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestBulkInsertInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Delete(DeleteInstanceRequest, ServerCallContext)

public virtual Task<Operation> Delete(DeleteInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestDeleteInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

DeleteAccessConfig(DeleteAccessConfigInstanceRequest, ServerCallContext)

public virtual Task<Operation> DeleteAccessConfig(DeleteAccessConfigInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestDeleteAccessConfigInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

DetachDisk(DetachDiskInstanceRequest, ServerCallContext)

public virtual Task<Operation> DetachDisk(DetachDiskInstanceRequest request, ServerCallContext context)

Detaches a disk from an instance.

Parameters
NameDescription
requestDetachDiskInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Get(GetInstanceRequest, ServerCallContext)

public virtual Task<Instance> Get(GetInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestGetInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskInstance

The response to send back to the client (wrapped by a task).

GetEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest, ServerCallContext)

public virtual Task<InstancesGetEffectiveFirewallsResponse> GetEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest request, ServerCallContext context)

Returns effective firewalls applied to an interface of the instance.

Parameters
NameDescription
requestGetEffectiveFirewallsInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskInstancesGetEffectiveFirewallsResponse

The response to send back to the client (wrapped by a task).

GetGuestAttributes(GetGuestAttributesInstanceRequest, ServerCallContext)

public virtual Task<GuestAttributes> GetGuestAttributes(GetGuestAttributesInstanceRequest request, ServerCallContext context)

Returns the specified guest attributes entry.

Parameters
NameDescription
requestGetGuestAttributesInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskGuestAttributes

The response to send back to the client (wrapped by a task).

GetIamPolicy(GetIamPolicyInstanceRequest, ServerCallContext)

public virtual Task<Policy> GetIamPolicy(GetIamPolicyInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestGetIamPolicyInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).

GetScreenshot(GetScreenshotInstanceRequest, ServerCallContext)

public virtual Task<Screenshot> GetScreenshot(GetScreenshotInstanceRequest request, ServerCallContext context)

Returns the screenshot from the specified instance.

Parameters
NameDescription
requestGetScreenshotInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskScreenshot

The response to send back to the client (wrapped by a task).

GetSerialPortOutput(GetSerialPortOutputInstanceRequest, ServerCallContext)

public virtual Task<SerialPortOutput> GetSerialPortOutput(GetSerialPortOutputInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestGetSerialPortOutputInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskSerialPortOutput

The response to send back to the client (wrapped by a task).

GetShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest, ServerCallContext)

public virtual Task<ShieldedInstanceIdentity> GetShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest request, ServerCallContext context)

Returns the Shielded Instance Identity of an instance

Parameters
NameDescription
requestGetShieldedInstanceIdentityInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskShieldedInstanceIdentity

The response to send back to the client (wrapped by a task).

Insert(InsertInstanceRequest, ServerCallContext)

public virtual Task<Operation> Insert(InsertInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestInsertInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

List(ListInstancesRequest, ServerCallContext)

public virtual Task<InstanceList> List(ListInstancesRequest request, ServerCallContext context)

Retrieves the list of instances contained within the specified zone.

Parameters
NameDescription
requestListInstancesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskInstanceList

The response to send back to the client (wrapped by a task).

ListReferrers(ListReferrersInstancesRequest, ServerCallContext)

public virtual Task<InstanceListReferrers> ListReferrers(ListReferrersInstancesRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestListReferrersInstancesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskInstanceListReferrers

The response to send back to the client (wrapped by a task).

RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest, ServerCallContext)

public virtual Task<Operation> RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest request, ServerCallContext context)

Removes resource policies from an instance.

Parameters
NameDescription
requestRemoveResourcePoliciesInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Reset(ResetInstanceRequest, ServerCallContext)

public virtual Task<Operation> Reset(ResetInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestResetInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Resume(ResumeInstanceRequest, ServerCallContext)

public virtual Task<Operation> Resume(ResumeInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestResumeInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest, ServerCallContext)

public virtual Task<SendDiagnosticInterruptInstanceResponse> SendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest request, ServerCallContext context)

Sends diagnostic interrupt to the instance.

Parameters
NameDescription
requestSendDiagnosticInterruptInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskSendDiagnosticInterruptInstanceResponse

The response to send back to the client (wrapped by a task).

SetDeletionProtection(SetDeletionProtectionInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetDeletionProtection(SetDeletionProtectionInstanceRequest request, ServerCallContext context)

Sets deletion protection on the instance.

Parameters
NameDescription
requestSetDeletionProtectionInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetDiskAutoDeleteInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetIamPolicy(SetIamPolicyInstanceRequest, ServerCallContext)

public virtual Task<Policy> SetIamPolicy(SetIamPolicyInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetIamPolicyInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskPolicy

The response to send back to the client (wrapped by a task).

SetLabels(SetLabelsInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetLabels(SetLabelsInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetLabelsInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetMachineResources(SetMachineResourcesInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetMachineResources(SetMachineResourcesInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetMachineResourcesInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetMachineType(SetMachineTypeInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetMachineType(SetMachineTypeInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetMachineTypeInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetMetadata(SetMetadataInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetMetadata(SetMetadataInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetMetadataInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestSetMinCpuPlatformInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetScheduling(SetSchedulingInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetScheduling(SetSchedulingInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestSetSchedulingInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetServiceAccount(SetServiceAccountInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetServiceAccount(SetServiceAccountInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetServiceAccountInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestSetShieldedInstanceIntegrityPolicyInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SetTags(SetTagsInstanceRequest, ServerCallContext)

public virtual Task<Operation> SetTags(SetTagsInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSetTagsInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest, ServerCallContext)

public virtual Task<Operation> SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestSimulateMaintenanceEventInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Start(StartInstanceRequest, ServerCallContext)

public virtual Task<Operation> Start(StartInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestStartInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest, ServerCallContext)

public virtual Task<Operation> StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest request, ServerCallContext context)

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

Parameters
NameDescription
requestStartWithEncryptionKeyInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Stop(StopInstanceRequest, ServerCallContext)

public virtual Task<Operation> Stop(StopInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestStopInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

Suspend(SuspendInstanceRequest, ServerCallContext)

public virtual Task<Operation> Suspend(SuspendInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestSuspendInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

TestIamPermissions(TestIamPermissionsInstanceRequest, ServerCallContext)

public virtual Task<TestPermissionsResponse> TestIamPermissions(TestIamPermissionsInstanceRequest request, ServerCallContext context)

Returns permissions that a caller has on the specified resource.

Parameters
NameDescription
requestTestIamPermissionsInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskTestPermissionsResponse

The response to send back to the client (wrapped by a task).

Update(UpdateInstanceRequest, ServerCallContext)

public virtual Task<Operation> Update(UpdateInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestUpdateInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

UpdateAccessConfig(UpdateAccessConfigInstanceRequest, ServerCallContext)

public virtual Task<Operation> UpdateAccessConfig(UpdateAccessConfigInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestUpdateAccessConfigInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest, ServerCallContext)

public virtual Task<Operation> UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestUpdateDisplayDeviceInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest, ServerCallContext)

public virtual Task<Operation> UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestUpdateNetworkInterfaceInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).

UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest, ServerCallContext)

public virtual Task<Operation> UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest request, ServerCallContext context)

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.

Parameters
NameDescription
requestUpdateShieldedInstanceConfigInstanceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
TaskOperation

The response to send back to the client (wrapped by a task).