![JAR search and dependency download from the Maven repository](/logo.png)
target.apidocs.com.google.api.services.compute.Compute.Instances.html Maven / Gradle / Ivy
Compute.Instances (Compute Engine API beta-rev20220726-2.0.0)
com.google.api.services.compute
Class Compute.Instances
- java.lang.Object
-
- com.google.api.services.compute.Compute.Instances
-
-
Nested Class Summary
-
Constructor Summary
Constructors
Constructor and Description
Instances()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Compute.Instances.AddAccessConfig
addAccessConfig(String project,
String zone,
String instance,
String networkInterface,
AccessConfig content)
Adds an access config to an instance's network interface.
Compute.Instances.AddResourcePolicies
addResourcePolicies(String project,
String zone,
String instance,
InstancesAddResourcePoliciesRequest content)
Adds existing resource policies to an instance.
Compute.Instances.AggregatedList
aggregatedList(String project)
Retrieves an aggregated list of all of the instances in your project across all regions and
zones.
Compute.Instances.AttachDisk
attachDisk(String project,
String zone,
String instance,
AttachedDisk content)
Attaches an existing Disk resource to an instance.
Compute.Instances.BulkInsert
bulkInsert(String project,
String zone,
BulkInsertInstanceResource content)
Creates multiple instances.
Compute.Instances.Delete
delete(String project,
String zone,
String instance)
Deletes the specified Instance resource.
Compute.Instances.DeleteAccessConfig
deleteAccessConfig(String project,
String zone,
String instance,
String accessConfig,
String networkInterface)
Deletes an access config from an instance's network interface.
Compute.Instances.DetachDisk
detachDisk(String project,
String zone,
String instance,
String deviceName)
Detaches a disk from an instance.
Compute.Instances.Get
get(String project,
String zone,
String instance)
Returns the specified Instance resource.
Compute.Instances.GetEffectiveFirewalls
getEffectiveFirewalls(String project,
String zone,
String instance,
String networkInterface)
Returns effective firewalls applied to an interface of the instance.
Compute.Instances.GetGuestAttributes
getGuestAttributes(String project,
String zone,
String instance)
Returns the specified guest attributes entry.
Compute.Instances.GetIamPolicy
getIamPolicy(String project,
String zone,
String resource)
Gets the access control policy for a resource.
Compute.Instances.GetScreenshot
getScreenshot(String project,
String zone,
String instance)
Returns the screenshot from the specified instance.
Compute.Instances.GetSerialPortOutput
getSerialPortOutput(String project,
String zone,
String instance)
Returns the last 1 MB of serial port output from the specified instance.
Compute.Instances.GetShieldedInstanceIdentity
getShieldedInstanceIdentity(String project,
String zone,
String instance)
Returns the Shielded Instance Identity of an instance
Create a request for the method "instances.getShieldedInstanceIdentity".
Compute.Instances.GetShieldedVmIdentity
getShieldedVmIdentity(String project,
String zone,
String instance)
Returns the Shielded VM Identity of an instance
Create a request for the method "instances.getShieldedVmIdentity".
Compute.Instances.Insert
insert(String project,
String zone,
Instance content)
Creates an instance resource in the specified project using the data included in the request.
Compute.Instances.List
list(String project,
String zone)
Retrieves the list of instances contained within the specified zone.
Compute.Instances.ListReferrers
listReferrers(String project,
String zone,
String instance)
Retrieves a list of resources that refer to the VM instance specified in the request.
Compute.Instances.RemoveResourcePolicies
removeResourcePolicies(String project,
String zone,
String instance,
InstancesRemoveResourcePoliciesRequest content)
Removes resource policies from an instance.
Compute.Instances.Reset
reset(String project,
String zone,
String instance)
Performs a reset on the instance.
Compute.Instances.Resume
resume(String project,
String zone,
String instance,
InstancesResumeRequest content)
Resumes an instance that was suspended using the instances().suspend method.
Compute.Instances.SendDiagnosticInterrupt
sendDiagnosticInterrupt(String project,
String zone,
String instance)
Sends diagnostic interrupt to the instance.
Compute.Instances.SetDeletionProtection
setDeletionProtection(String project,
String zone,
String resource)
Sets deletion protection on the instance.
Compute.Instances.SetDiskAutoDelete
setDiskAutoDelete(String project,
String zone,
String instance,
Boolean autoDelete,
String deviceName)
Sets the auto-delete flag for a disk attached to an instance.
Compute.Instances.SetIamPolicy
setIamPolicy(String project,
String zone,
String resource,
ZoneSetPolicyRequest content)
Sets the access control policy on the specified resource.
Compute.Instances.SetLabels
setLabels(String project,
String zone,
String instance,
InstancesSetLabelsRequest content)
Sets labels on an instance.
Compute.Instances.SetMachineResources
setMachineResources(String project,
String zone,
String instance,
InstancesSetMachineResourcesRequest content)
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
Compute.Instances.SetMachineType
setMachineType(String project,
String zone,
String instance,
InstancesSetMachineTypeRequest content)
Changes the machine type for a stopped instance to the machine type specified in the request.
Compute.Instances.SetMetadata
setMetadata(String project,
String zone,
String instance,
Metadata content)
Sets metadata for the specified instance to the data included in the request.
Compute.Instances.SetMinCpuPlatform
setMinCpuPlatform(String project,
String zone,
String instance,
InstancesSetMinCpuPlatformRequest content)
Changes the minimum CPU platform that this instance should use.
Compute.Instances.SetName
setName(String project,
String zone,
String instance,
InstancesSetNameRequest content)
Sets name of an instance.
Compute.Instances.SetScheduling
setScheduling(String project,
String zone,
String instance,
Scheduling content)
Sets an instance's scheduling options.
Compute.Instances.SetServiceAccount
setServiceAccount(String project,
String zone,
String instance,
InstancesSetServiceAccountRequest content)
Sets the service account on the instance.
Compute.Instances.SetShieldedInstanceIntegrityPolicy
setShieldedInstanceIntegrityPolicy(String project,
String zone,
String instance,
ShieldedInstanceIntegrityPolicy content)
Sets the Shielded Instance integrity policy for an instance.
Compute.Instances.SetShieldedVmIntegrityPolicy
setShieldedVmIntegrityPolicy(String project,
String zone,
String instance,
ShieldedVmIntegrityPolicy content)
Sets the Shielded VM integrity policy for a VM instance.
Compute.Instances.SetTags
setTags(String project,
String zone,
String instance,
Tags content)
Sets network tags for the specified instance to the data included in the request.
Compute.Instances.SimulateMaintenanceEvent
simulateMaintenanceEvent(String project,
String zone,
String instance)
Simulates a host maintenance event on a VM.
Compute.Instances.Start
start(String project,
String zone,
String instance)
Starts an instance that was stopped using the instances().stop method.
Compute.Instances.StartWithEncryptionKey
startWithEncryptionKey(String project,
String zone,
String instance,
InstancesStartWithEncryptionKeyRequest content)
Starts an instance that was stopped using the instances().stop method.
Compute.Instances.Stop
stop(String project,
String zone,
String instance)
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a
later time.
Compute.Instances.Suspend
suspend(String project,
String zone,
String instance)
This method suspends a running instance, saving its state to persistent storage, and allows you
to resume the instance at a later time.
Compute.Instances.TestIamPermissions
testIamPermissions(String project,
String zone,
String resource,
TestPermissionsRequest content)
Returns permissions that a caller has on the specified resource.
Compute.Instances.Update
update(String project,
String zone,
String instance,
Instance content)
Updates an instance only if the necessary resources are available.
Compute.Instances.UpdateAccessConfig
updateAccessConfig(String project,
String zone,
String instance,
String networkInterface,
AccessConfig content)
Updates the specified access config from an instance's network interface with the data included
in the request.
Compute.Instances.UpdateDisplayDevice
updateDisplayDevice(String project,
String zone,
String instance,
DisplayDevice content)
Updates the Display config for a VM instance.
Compute.Instances.UpdateNetworkInterface
updateNetworkInterface(String project,
String zone,
String instance,
String networkInterface,
NetworkInterface content)
Updates an instance's network interface.
Compute.Instances.UpdateShieldedInstanceConfig
updateShieldedInstanceConfig(String project,
String zone,
String instance,
ShieldedInstanceConfig content)
Updates the Shielded Instance config for an instance.
Compute.Instances.UpdateShieldedVmConfig
updateShieldedVmConfig(String project,
String zone,
String instance,
ShieldedVmConfig content)
Updates the Shielded VM config for a VM instance.
-
-
Method Detail
-
addAccessConfig
public Compute.Instances.AddAccessConfig addAccessConfig(String project,
String zone,
String instance,
String networkInterface,
AccessConfig content)
throws IOException
Adds an access config to an instance's network interface.
Create a request for the method "instances.addAccessConfig".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
networkInterface
- The name of the network interface to add to this instance.
content
- the AccessConfig
- Returns:
- the request
- Throws:
IOException
-
addResourcePolicies
public Compute.Instances.AddResourcePolicies addResourcePolicies(String project,
String zone,
String instance,
InstancesAddResourcePoliciesRequest content)
throws IOException
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.
Create a request for the method "instances.addResourcePolicies".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
content
- the InstancesAddResourcePoliciesRequest
- Returns:
- the request
- Throws:
IOException
-
aggregatedList
public Compute.Instances.AggregatedList aggregatedList(String project)
throws IOException
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.
Create a request for the method "instances.aggregatedList".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
- Returns:
- the request
- Throws:
IOException
-
attachDisk
public Compute.Instances.AttachDisk attachDisk(String project,
String zone,
String instance,
AttachedDisk content)
throws IOException
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.
Create a request for the method "instances.attachDisk".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
content
- the AttachedDisk
- Returns:
- the request
- Throws:
IOException
-
bulkInsert
public Compute.Instances.BulkInsert bulkInsert(String project,
String zone,
BulkInsertInstanceResource content)
throws IOException
Creates multiple instances. Count specifies the number of instances to create. For more
information, see About bulk creation of VMs.
Create a request for the method "instances.bulkInsert".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
content
- the BulkInsertInstanceResource
- Returns:
- the request
- Throws:
IOException
-
delete
public Compute.Instances.Delete delete(String project,
String zone,
String instance)
throws IOException
Deletes the specified Instance resource. For more information, see Deleting an instance.
Create a request for the method "instances.delete".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to delete.
- Returns:
- the request
- Throws:
IOException
-
deleteAccessConfig
public Compute.Instances.DeleteAccessConfig deleteAccessConfig(String project,
String zone,
String instance,
String accessConfig,
String networkInterface)
throws IOException
Deletes an access config from an instance's network interface.
Create a request for the method "instances.deleteAccessConfig".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
accessConfig
- The name of the access config to delete.
networkInterface
- The name of the network interface.
- Returns:
- the request
- Throws:
IOException
-
detachDisk
public Compute.Instances.DetachDisk detachDisk(String project,
String zone,
String instance,
String deviceName)
throws IOException
Detaches a disk from an instance.
Create a request for the method "instances.detachDisk".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Instance name for this request.
deviceName
- The device name of the disk to detach. Make a get() request on the instance to view currently
attached disks and device names.
- Returns:
- the request
- Throws:
IOException
-
get
public Compute.Instances.Get get(String project,
String zone,
String instance)
throws IOException
Returns the specified Instance resource. Gets a list of available instances by making a list()
request.
Create a request for the method "instances.get".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to return.
- Returns:
- the request
- Throws:
IOException
-
getEffectiveFirewalls
public Compute.Instances.GetEffectiveFirewalls getEffectiveFirewalls(String project,
String zone,
String instance,
String networkInterface)
throws IOException
Returns effective firewalls applied to an interface of the instance.
Create a request for the method "instances.getEffectiveFirewalls".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
networkInterface
- The name of the network interface to get the effective firewalls.
- Returns:
- the request
- Throws:
IOException
-
getGuestAttributes
public Compute.Instances.GetGuestAttributes getGuestAttributes(String project,
String zone,
String instance)
throws IOException
Returns the specified guest attributes entry.
Create a request for the method "instances.getGuestAttributes".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
getIamPolicy
public Compute.Instances.GetIamPolicy getIamPolicy(String project,
String zone,
String resource)
throws IOException
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Create a request for the method "instances.getIamPolicy".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
resource
- Name or id of the resource for this request.
- Returns:
- the request
- Throws:
IOException
-
getScreenshot
public Compute.Instances.GetScreenshot getScreenshot(String project,
String zone,
String instance)
throws IOException
Returns the screenshot from the specified instance.
Create a request for the method "instances.getScreenshot".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
getSerialPortOutput
public Compute.Instances.GetSerialPortOutput getSerialPortOutput(String project,
String zone,
String instance)
throws IOException
Returns the last 1 MB of serial port output from the specified instance.
Create a request for the method "instances.getSerialPortOutput".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance for this request.
- Returns:
- the request
- Throws:
IOException
-
getShieldedInstanceIdentity
public Compute.Instances.GetShieldedInstanceIdentity getShieldedInstanceIdentity(String project,
String zone,
String instance)
throws IOException
Returns the Shielded Instance Identity of an instance
Create a request for the method "instances.getShieldedInstanceIdentity".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name or id of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
getShieldedVmIdentity
public Compute.Instances.GetShieldedVmIdentity getShieldedVmIdentity(String project,
String zone,
String instance)
throws IOException
Returns the Shielded VM Identity of an instance
Create a request for the method "instances.getShieldedVmIdentity".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
insert
public Compute.Instances.Insert insert(String project,
String zone,
Instance content)
throws IOException
Creates an instance resource in the specified project using the data included in the request.
Create a request for the method "instances.insert".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
content
- the Instance
- Returns:
- the request
- Throws:
IOException
-
list
public Compute.Instances.List list(String project,
String zone)
throws IOException
Retrieves the list of instances contained within the specified zone.
Create a request for the method "instances.list".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
- Returns:
- the request
- Throws:
IOException
-
listReferrers
public Compute.Instances.ListReferrers listReferrers(String project,
String zone,
String instance)
throws IOException
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.
Create a request for the method "instances.listReferrers".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the target instance scoping this request, or '-' if the request should span over all
instances in the container.
- Returns:
- the request
- Throws:
IOException
-
removeResourcePolicies
public Compute.Instances.RemoveResourcePolicies removeResourcePolicies(String project,
String zone,
String instance,
InstancesRemoveResourcePoliciesRequest content)
throws IOException
Removes resource policies from an instance.
Create a request for the method "instances.removeResourcePolicies".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
content
- the InstancesRemoveResourcePoliciesRequest
- Returns:
- the request
- Throws:
IOException
-
reset
public Compute.Instances.Reset reset(String project,
String zone,
String instance)
throws IOException
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.
Create a request for the method "instances.reset".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
resume
public Compute.Instances.Resume resume(String project,
String zone,
String instance,
InstancesResumeRequest content)
throws IOException
Resumes an instance that was suspended using the instances().suspend method.
Create a request for the method "instances.resume".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to resume.
content
- the InstancesResumeRequest
- Returns:
- the request
- Throws:
IOException
-
sendDiagnosticInterrupt
public Compute.Instances.SendDiagnosticInterrupt sendDiagnosticInterrupt(String project,
String zone,
String instance)
throws IOException
Sends diagnostic interrupt to the instance.
Create a request for the method "instances.sendDiagnosticInterrupt".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
setDeletionProtection
public Compute.Instances.SetDeletionProtection setDeletionProtection(String project,
String zone,
String resource)
throws IOException
Sets deletion protection on the instance.
Create a request for the method "instances.setDeletionProtection".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
resource
- Name or id of the resource for this request.
- Returns:
- the request
- Throws:
IOException
-
setDiskAutoDelete
public Compute.Instances.SetDiskAutoDelete setDiskAutoDelete(String project,
String zone,
String instance,
Boolean autoDelete,
String deviceName)
throws IOException
Sets the auto-delete flag for a disk attached to an instance.
Create a request for the method "instances.setDiskAutoDelete".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
autoDelete
- Whether to auto-delete the disk when the instance is deleted.
deviceName
- The device name of the disk to modify. Make a get() request on the instance to view currently
attached disks and device names.
- Returns:
- the request
- Throws:
IOException
-
setIamPolicy
public Compute.Instances.SetIamPolicy setIamPolicy(String project,
String zone,
String resource,
ZoneSetPolicyRequest content)
throws IOException
Sets the access control policy on the specified resource. Replaces any existing policy.
Create a request for the method "instances.setIamPolicy".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
resource
- Name or id of the resource for this request.
content
- the ZoneSetPolicyRequest
- Returns:
- the request
- Throws:
IOException
-
setLabels
public Compute.Instances.SetLabels setLabels(String project,
String zone,
String instance,
InstancesSetLabelsRequest content)
throws IOException
Sets labels on an instance. To learn more about labels, read the Labeling Resources
documentation.
Create a request for the method "instances.setLabels".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the InstancesSetLabelsRequest
- Returns:
- the request
- Throws:
IOException
-
setMachineResources
public Compute.Instances.SetMachineResources setMachineResources(String project,
String zone,
String instance,
InstancesSetMachineResourcesRequest content)
throws IOException
Changes the number and/or type of accelerator for a stopped instance to the values specified in
the request.
Create a request for the method "instances.setMachineResources".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the InstancesSetMachineResourcesRequest
- Returns:
- the request
- Throws:
IOException
-
setMachineType
public Compute.Instances.SetMachineType setMachineType(String project,
String zone,
String instance,
InstancesSetMachineTypeRequest content)
throws IOException
Changes the machine type for a stopped instance to the machine type specified in the request.
Create a request for the method "instances.setMachineType".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the InstancesSetMachineTypeRequest
- Returns:
- the request
- Throws:
IOException
-
setMetadata
public Compute.Instances.SetMetadata setMetadata(String project,
String zone,
String instance,
Metadata content)
throws IOException
Sets metadata for the specified instance to the data included in the request.
Create a request for the method "instances.setMetadata".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the Metadata
- Returns:
- the request
- Throws:
IOException
-
setMinCpuPlatform
public Compute.Instances.SetMinCpuPlatform setMinCpuPlatform(String project,
String zone,
String instance,
InstancesSetMinCpuPlatformRequest content)
throws IOException
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.
Create a request for the method "instances.setMinCpuPlatform".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the InstancesSetMinCpuPlatformRequest
- Returns:
- the request
- Throws:
IOException
-
setName
public Compute.Instances.SetName setName(String project,
String zone,
String instance,
InstancesSetNameRequest content)
throws IOException
Sets name of an instance.
Create a request for the method "instances.setName".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
content
- the InstancesSetNameRequest
- Returns:
- the request
- Throws:
IOException
-
setScheduling
public Compute.Instances.SetScheduling setScheduling(String project,
String zone,
String instance,
Scheduling content)
throws IOException
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.
Create a request for the method "instances.setScheduling".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Instance name for this request.
content
- the Scheduling
- Returns:
- the request
- Throws:
IOException
-
setServiceAccount
public Compute.Instances.SetServiceAccount setServiceAccount(String project,
String zone,
String instance,
InstancesSetServiceAccountRequest content)
throws IOException
Sets the service account on the instance. For more information, read Changing the service account
and access scopes for an instance.
Create a request for the method "instances.setServiceAccount".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to start.
content
- the InstancesSetServiceAccountRequest
- Returns:
- the request
- Throws:
IOException
-
setShieldedInstanceIntegrityPolicy
public Compute.Instances.SetShieldedInstanceIntegrityPolicy setShieldedInstanceIntegrityPolicy(String project,
String zone,
String instance,
ShieldedInstanceIntegrityPolicy content)
throws IOException
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.
Create a request for the method "instances.setShieldedInstanceIntegrityPolicy".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the
remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name or id of the instance scoping this request.
content
- the ShieldedInstanceIntegrityPolicy
- Returns:
- the request
- Throws:
IOException
-
setShieldedVmIntegrityPolicy
public Compute.Instances.SetShieldedVmIntegrityPolicy setShieldedVmIntegrityPolicy(String project,
String zone,
String instance,
ShieldedVmIntegrityPolicy content)
throws IOException
Sets the Shielded VM integrity policy for a VM instance. You can only use this method on a
running VM instance. This method supports PATCH semantics and uses the JSON merge patch format
and processing rules.
Create a request for the method "instances.setShieldedVmIntegrityPolicy".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the ShieldedVmIntegrityPolicy
- Returns:
- the request
- Throws:
IOException
-
setTags
public Compute.Instances.SetTags setTags(String project,
String zone,
String instance,
Tags content)
throws IOException
Sets network tags for the specified instance to the data included in the request.
Create a request for the method "instances.setTags".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the Tags
- Returns:
- the request
- Throws:
IOException
-
simulateMaintenanceEvent
public Compute.Instances.SimulateMaintenanceEvent simulateMaintenanceEvent(String project,
String zone,
String instance)
throws IOException
Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance
event.
Create a request for the method "instances.simulateMaintenanceEvent".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
- Returns:
- the request
- Throws:
IOException
-
start
public Compute.Instances.Start start(String project,
String zone,
String instance)
throws IOException
Starts an instance that was stopped using the instances().stop method. For more information, see
Restart an instance.
Create a request for the method "instances.start".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to start.
- Returns:
- the request
- Throws:
IOException
-
startWithEncryptionKey
public Compute.Instances.StartWithEncryptionKey startWithEncryptionKey(String project,
String zone,
String instance,
InstancesStartWithEncryptionKeyRequest content)
throws IOException
Starts an instance that was stopped using the instances().stop method. For more information, see
Restart an instance.
Create a request for the method "instances.startWithEncryptionKey".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to start.
content
- the InstancesStartWithEncryptionKeyRequest
- Returns:
- the request
- Throws:
IOException
-
stop
public Compute.Instances.Stop stop(String project,
String zone,
String instance)
throws IOException
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.
Create a request for the method "instances.stop".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to stop.
- Returns:
- the request
- Throws:
IOException
-
suspend
public Compute.Instances.Suspend suspend(String project,
String zone,
String instance)
throws IOException
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.
Create a request for the method "instances.suspend".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to suspend.
- Returns:
- the request
- Throws:
IOException
-
testIamPermissions
public Compute.Instances.TestIamPermissions testIamPermissions(String project,
String zone,
String resource,
TestPermissionsRequest content)
throws IOException
Returns permissions that a caller has on the specified resource.
Create a request for the method "instances.testIamPermissions".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
resource
- Name or id of the resource for this request.
content
- the TestPermissionsRequest
- Returns:
- the request
- Throws:
IOException
-
update
public Compute.Instances.Update update(String project,
String zone,
String instance,
Instance content)
throws IOException
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.
Create a request for the method "instances.update".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance resource to update.
content
- the Instance
- Returns:
- the request
- Throws:
IOException
-
updateAccessConfig
public Compute.Instances.UpdateAccessConfig updateAccessConfig(String project,
String zone,
String instance,
String networkInterface,
AccessConfig content)
throws IOException
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.
Create a request for the method "instances.updateAccessConfig".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
networkInterface
- The name of the network interface where the access config is attached.
content
- the AccessConfig
- Returns:
- the request
- Throws:
IOException
-
updateDisplayDevice
public Compute.Instances.UpdateDisplayDevice updateDisplayDevice(String project,
String zone,
String instance,
DisplayDevice content)
throws IOException
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.
Create a request for the method "instances.updateDisplayDevice".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the DisplayDevice
- Returns:
- the request
- Throws:
IOException
-
updateNetworkInterface
public Compute.Instances.UpdateNetworkInterface updateNetworkInterface(String project,
String zone,
String instance,
String networkInterface,
NetworkInterface content)
throws IOException
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.
Create a request for the method "instances.updateNetworkInterface".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- The instance name for this request.
networkInterface
- The name of the network interface to update.
content
- the NetworkInterface
- Returns:
- the request
- Throws:
IOException
-
updateShieldedInstanceConfig
public Compute.Instances.UpdateShieldedInstanceConfig updateShieldedInstanceConfig(String project,
String zone,
String instance,
ShieldedInstanceConfig content)
throws IOException
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.
Create a request for the method "instances.updateShieldedInstanceConfig".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name or id of the instance scoping this request.
content
- the ShieldedInstanceConfig
- Returns:
- the request
- Throws:
IOException
-
updateShieldedVmConfig
public Compute.Instances.UpdateShieldedVmConfig updateShieldedVmConfig(String project,
String zone,
String instance,
ShieldedVmConfig content)
throws IOException
Updates the Shielded VM 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.
Create a request for the method "instances.updateShieldedVmConfig".
This request holds the parameters needed by the compute server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote
operation.
- Parameters:
project
- Project ID for this request.
zone
- The name of the zone for this request.
instance
- Name of the instance scoping this request.
content
- the ShieldedVmConfig
- Returns:
- the request
- Throws:
IOException
Copyright © 2011–2022 Google. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy