All Downloads are FREE. Search and download functionalities are using the official Maven repository.

target.apidocs.com.google.api.services.compute.Compute.Instances.html Maven / Gradle / Ivy

The newest version!






Compute.Instances (Compute Engine API v1-rev20250320-2.0.0)












com.google.api.services.compute

Class Compute.Instances

  • Enclosing class:
    Compute


    public class Compute.Instances
    extends Object
    The "instances" collection of methods.
    • Constructor Detail

      • Instances

        public Instances()
    • 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. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. 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. 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
      • 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
      • performMaintenance

        public Compute.Instances.PerformMaintenance performMaintenance(String project,
                                                                       String zone,
                                                                       String instance)
                                                                throws IOException
        Perform a manual maintenance on the instance. Create a request for the method "instances.performMaintenance". 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
      • reportHostAsFaulty

        public Compute.Instances.ReportHostAsFaulty reportHostAsFaulty(String project,
                                                                       String zone,
                                                                       String instance,
                                                                       InstancesReportHostAsFaultyRequest content)
                                                                throws IOException
        Mark the host as faulty and try to restart the instance on a new host. Create a request for the method "instances.reportHostAsFaulty". 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 InstancesReportHostAsFaultyRequest
        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)
                                        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.
        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
      • setSecurityPolicy

        public Compute.Instances.SetSecurityPolicy setSecurityPolicy(String project,
                                                                     String zone,
                                                                     String instance,
                                                                     InstancesSetSecurityPolicyRequest content)
                                                              throws IOException
        Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview Create a request for the method "instances.setSecurityPolicy". 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 - Name of the zone scoping this request.
        instance - Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035.
        content - the InstancesSetSecurityPolicyRequest
        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
      • 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

Copyright © 2011–2025 Google. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy