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







Compute.Instances (Compute Engine API v1-rev20200104-1.30.8)












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
      • aggregatedList

        public Compute.Instances.AggregatedList aggregatedList(String project)
                                                        throws IOException
        Retrieves aggregated list of all of the instances in your project across all regions and zones. 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
      • delete

        public Compute.Instances.Delete delete(String project,
                                               String zone,
                                               String instance)
                                        throws IOException
        Deletes the specified Instance resource. For more information, see Stopping or 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
      • 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
      • 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 scoping 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 the list of referrers to instances contained within the specified zone. 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
      • 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
      • 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
      • 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
      • setScheduling

        public Compute.Instances.SetScheduling setScheduling(String project,
                                                             String zone,
                                                             String instance,
                                                             Scheduling content)
                                                      throws IOException
        Sets an instance's scheduling options. 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
      • 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 maintenance event on the instance. 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
      • 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
      • 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 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–2020 Google. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy