Class InstancesResource
The "instances" collection of methods.
Inheritance
Inherited Members
Namespace: Google.Apis.Compute.v1
Assembly: Google.Apis.Compute.v1.dll
Syntax
public class InstancesResource
Constructors
InstancesResource(IClientService)
Constructs a new resource.
Declaration
public InstancesResource(IClientService service)
Parameters
| Type | Name | Description |
|---|---|---|
| Google.Apis.Services.IClientService | service |
Methods
AddAccessConfig(AccessConfig, String, String, String, String)
Adds an access config to an instance's network interface.
Declaration
public virtual InstancesResource.AddAccessConfigRequest AddAccessConfig(AccessConfig body, string project, string zone, string instance, string networkInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| AccessConfig | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
| System.String | networkInterface | The name of the network interface to add to this instance. |
Returns
| Type | Description |
|---|---|
| InstancesResource.AddAccessConfigRequest |
AddResourcePolicies(InstancesAddResourcePoliciesRequest, String, String, String)
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.
Declaration
public virtual InstancesResource.AddResourcePoliciesRequest AddResourcePolicies(InstancesAddResourcePoliciesRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesAddResourcePoliciesRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.AddResourcePoliciesRequest |
AggregatedList(String)
Retrieves aggregated list of all of the instances in your project across all regions and zones.
Declaration
public virtual InstancesResource.AggregatedListRequest AggregatedList(string project)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.AggregatedListRequest |
AttachDisk(AttachedDisk, String, String, String)
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.
Declaration
public virtual InstancesResource.AttachDiskRequest AttachDisk(AttachedDisk body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachedDisk | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.AttachDiskRequest |
Delete(String, String, String)
Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
Declaration
public virtual InstancesResource.DeleteRequest Delete(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to delete. |
Returns
| Type | Description |
|---|---|
| InstancesResource.DeleteRequest |
DeleteAccessConfig(String, String, String, String, String)
Deletes an access config from an instance's network interface.
Declaration
public virtual InstancesResource.DeleteAccessConfigRequest DeleteAccessConfig(string project, string zone, string instance, string accessConfig, string networkInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
| System.String | accessConfig | The name of the access config to delete. |
| System.String | networkInterface | The name of the network interface. |
Returns
| Type | Description |
|---|---|
| InstancesResource.DeleteAccessConfigRequest |
DetachDisk(String, String, String, String)
Detaches a disk from an instance.
Declaration
public virtual InstancesResource.DetachDiskRequest DetachDisk(string project, string zone, string instance, string deviceName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Instance name for this request. |
| System.String | deviceName | The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. |
Returns
| Type | Description |
|---|---|
| InstancesResource.DetachDiskRequest |
Get(String, String, String)
Returns the specified Instance resource. Gets a list of available instances by making a list() request.
Declaration
public virtual InstancesResource.GetRequest Get(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to return. |
Returns
| Type | Description |
|---|---|
| InstancesResource.GetRequest |
GetGuestAttributes(String, String, String)
Returns the specified guest attributes entry.
Declaration
public virtual InstancesResource.GetGuestAttributesRequest GetGuestAttributes(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.GetGuestAttributesRequest |
GetIamPolicy(String, String, String)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Declaration
public virtual InstancesResource.GetIamPolicyRequest GetIamPolicy(string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.GetIamPolicyRequest |
GetSerialPortOutput(String, String, String)
Returns the last 1 MB of serial port output from the specified instance.
Declaration
public virtual InstancesResource.GetSerialPortOutputRequest GetSerialPortOutput(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.GetSerialPortOutputRequest |
GetShieldedInstanceIdentity(String, String, String)
Returns the Shielded Instance Identity of an instance
Declaration
public virtual InstancesResource.GetShieldedInstanceIdentityRequest GetShieldedInstanceIdentity(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name or id of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.GetShieldedInstanceIdentityRequest |
Insert(Instance, String, String)
Creates an instance resource in the specified project using the data included in the request.
Declaration
public virtual InstancesResource.InsertRequest Insert(Instance body, string project, string zone)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.InsertRequest |
List(String, String)
Retrieves the list of instances contained within the specified zone.
Declaration
public virtual InstancesResource.ListRequest List(string project, string zone)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.ListRequest |
ListReferrers(String, String, String)
Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.
Declaration
public virtual InstancesResource.ListReferrersRequest ListReferrers(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. |
Returns
| Type | Description |
|---|---|
| InstancesResource.ListReferrersRequest |
RemoveResourcePolicies(InstancesRemoveResourcePoliciesRequest, String, String, String)
Removes resource policies from an instance.
Declaration
public virtual InstancesResource.RemoveResourcePoliciesRequest RemoveResourcePolicies(InstancesRemoveResourcePoliciesRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesRemoveResourcePoliciesRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.RemoveResourcePoliciesRequest |
Reset(String, String, String)
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.
Declaration
public virtual InstancesResource.ResetRequest Reset(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.ResetRequest |
SetDeletionProtection(String, String, String)
Sets deletion protection on the instance.
Declaration
public virtual InstancesResource.SetDeletionProtectionRequest SetDeletionProtection(string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetDeletionProtectionRequest |
SetDiskAutoDelete(String, String, String, Boolean, String)
Sets the auto-delete flag for a disk attached to an instance.
Declaration
public virtual InstancesResource.SetDiskAutoDeleteRequest SetDiskAutoDelete(string project, string zone, string instance, bool autoDelete, string deviceName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
| System.Boolean | autoDelete | Whether to auto-delete the disk when the instance is deleted. |
| System.String | deviceName | The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetDiskAutoDeleteRequest |
SetIamPolicy(ZoneSetPolicyRequest, String, String, String)
Sets the access control policy on the specified resource. Replaces any existing policy.
Declaration
public virtual InstancesResource.SetIamPolicyRequest SetIamPolicy(ZoneSetPolicyRequest body, string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoneSetPolicyRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetIamPolicyRequest |
SetLabels(InstancesSetLabelsRequest, String, String, String)
Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
Declaration
public virtual InstancesResource.SetLabelsRequest SetLabels(InstancesSetLabelsRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesSetLabelsRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetLabelsRequest |
SetMachineResources(InstancesSetMachineResourcesRequest, String, String, String)
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
Declaration
public virtual InstancesResource.SetMachineResourcesRequest SetMachineResources(InstancesSetMachineResourcesRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesSetMachineResourcesRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetMachineResourcesRequest |
SetMachineType(InstancesSetMachineTypeRequest, String, String, String)
Changes the machine type for a stopped instance to the machine type specified in the request.
Declaration
public virtual InstancesResource.SetMachineTypeRequest SetMachineType(InstancesSetMachineTypeRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesSetMachineTypeRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetMachineTypeRequest |
SetMetadata(Metadata, String, String, String)
Sets metadata for the specified instance to the data included in the request.
Declaration
public virtual InstancesResource.SetMetadataRequest SetMetadata(Metadata body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Metadata | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetMetadataRequest |
SetMinCpuPlatform(InstancesSetMinCpuPlatformRequest, String, String, String)
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.
Declaration
public virtual InstancesResource.SetMinCpuPlatformRequest SetMinCpuPlatform(InstancesSetMinCpuPlatformRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesSetMinCpuPlatformRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetMinCpuPlatformRequest |
SetScheduling(Scheduling, String, String, String)
Sets an instance's scheduling options.
Declaration
public virtual InstancesResource.SetSchedulingRequest SetScheduling(Scheduling body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Scheduling | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Instance name for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetSchedulingRequest |
SetServiceAccount(InstancesSetServiceAccountRequest, String, String, String)
Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
Declaration
public virtual InstancesResource.SetServiceAccountRequest SetServiceAccount(InstancesSetServiceAccountRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesSetServiceAccountRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to start. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetServiceAccountRequest |
SetShieldedInstanceIntegrityPolicy(ShieldedInstanceIntegrityPolicy, String, String, String)
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.
Declaration
public virtual InstancesResource.SetShieldedInstanceIntegrityPolicyRequest SetShieldedInstanceIntegrityPolicy(ShieldedInstanceIntegrityPolicy body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| ShieldedInstanceIntegrityPolicy | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name or id of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetShieldedInstanceIntegrityPolicyRequest |
SetTags(Tags, String, String, String)
Sets network tags for the specified instance to the data included in the request.
Declaration
public virtual InstancesResource.SetTagsRequest SetTags(Tags body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Tags | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SetTagsRequest |
SimulateMaintenanceEvent(String, String, String)
Simulates a maintenance event on the instance.
Declaration
public virtual InstancesResource.SimulateMaintenanceEventRequest SimulateMaintenanceEvent(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.SimulateMaintenanceEventRequest |
Start(String, String, String)
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
Declaration
public virtual InstancesResource.StartRequest Start(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to start. |
Returns
| Type | Description |
|---|---|
| InstancesResource.StartRequest |
StartWithEncryptionKey(InstancesStartWithEncryptionKeyRequest, String, String, String)
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
Declaration
public virtual InstancesResource.StartWithEncryptionKeyRequest StartWithEncryptionKey(InstancesStartWithEncryptionKeyRequest body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| InstancesStartWithEncryptionKeyRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to start. |
Returns
| Type | Description |
|---|---|
| InstancesResource.StartWithEncryptionKeyRequest |
Stop(String, String, String)
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.
Declaration
public virtual InstancesResource.StopRequest Stop(string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to stop. |
Returns
| Type | Description |
|---|---|
| InstancesResource.StopRequest |
TestIamPermissions(TestPermissionsRequest, String, String, String)
Returns permissions that a caller has on the specified resource.
Declaration
public virtual InstancesResource.TestIamPermissionsRequest TestIamPermissions(TestPermissionsRequest body, string project, string zone, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| TestPermissionsRequest | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | resource | Name or id of the resource for this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.TestIamPermissionsRequest |
Update(Instance, String, String, String)
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.
Declaration
public virtual InstancesResource.UpdateRequest Update(Instance body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| Instance | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance resource to update. |
Returns
| Type | Description |
|---|---|
| InstancesResource.UpdateRequest |
UpdateAccessConfig(AccessConfig, String, String, String, String)
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.
Declaration
public virtual InstancesResource.UpdateAccessConfigRequest UpdateAccessConfig(AccessConfig body, string project, string zone, string instance, string networkInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| AccessConfig | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
| System.String | networkInterface | The name of the network interface where the access config is attached. |
Returns
| Type | Description |
|---|---|
| InstancesResource.UpdateAccessConfigRequest |
UpdateDisplayDevice(DisplayDevice, String, String, String)
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.
Declaration
public virtual InstancesResource.UpdateDisplayDeviceRequest UpdateDisplayDevice(DisplayDevice body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayDevice | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.UpdateDisplayDeviceRequest |
UpdateNetworkInterface(NetworkInterface, String, String, String, String)
Updates an instance's network interface. This method follows PATCH semantics.
Declaration
public virtual InstancesResource.UpdateNetworkInterfaceRequest UpdateNetworkInterface(NetworkInterface body, string project, string zone, string instance, string networkInterface)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkInterface | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | The instance name for this request. |
| System.String | networkInterface | The name of the network interface to update. |
Returns
| Type | Description |
|---|---|
| InstancesResource.UpdateNetworkInterfaceRequest |
UpdateShieldedInstanceConfig(ShieldedInstanceConfig, String, String, String)
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.
Declaration
public virtual InstancesResource.UpdateShieldedInstanceConfigRequest UpdateShieldedInstanceConfig(ShieldedInstanceConfig body, string project, string zone, string instance)
Parameters
| Type | Name | Description |
|---|---|---|
| ShieldedInstanceConfig | body | The body of the request. |
| System.String | project | Project ID for this request. |
| System.String | zone | The name of the zone for this request. |
| System.String | instance | Name or id of the instance scoping this request. |
Returns
| Type | Description |
|---|---|
| InstancesResource.UpdateShieldedInstanceConfigRequest |