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

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

There is a newer version: v1-rev20250320-2.0.0
Show newest version






Compute.Disks (Compute Engine API v1-rev20250107-2.0.0)












com.google.api.services.compute

Class Compute.Disks

  • Enclosing class:
    Compute


    public class Compute.Disks
    extends Object
    The "disks" collection of methods.
    • Constructor Detail

      • Disks

        public Disks()
    • Method Detail

      • addResourcePolicies

        public Compute.Disks.AddResourcePolicies addResourcePolicies(String project,
                                                                     String zone,
                                                                     String disk,
                                                                     DisksAddResourcePoliciesRequest content)
                                                              throws IOException
        Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. Create a request for the method "disks.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.
        disk - The disk name for this request.
        content - the DisksAddResourcePoliciesRequest
        Returns:
        the request
        Throws:
        IOException
      • aggregatedList

        public Compute.Disks.AggregatedList aggregatedList(String project)
                                                    throws IOException
        Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. Create a request for the method "disks.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
      • bulkInsert

        public Compute.Disks.BulkInsert bulkInsert(String project,
                                                   String zone,
                                                   BulkInsertDiskResource content)
                                            throws IOException
        Bulk create a set of disks. Create a request for the method "disks.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 BulkInsertDiskResource
        Returns:
        the request
        Throws:
        IOException
      • createSnapshot

        public Compute.Disks.CreateSnapshot createSnapshot(String project,
                                                           String zone,
                                                           String disk,
                                                           Snapshot content)
                                                    throws IOException
        Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. Create a request for the method "disks.createSnapshot". 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.
        disk - Name of the persistent disk to snapshot.
        content - the Snapshot
        Returns:
        the request
        Throws:
        IOException
      • delete

        public Compute.Disks.Delete delete(String project,
                                           String zone,
                                           String disk)
                                    throws IOException
        Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. Create a request for the method "disks.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.
        disk - Name of the persistent disk to delete.
        Returns:
        the request
        Throws:
        IOException
      • get

        public Compute.Disks.Get get(String project,
                                     String zone,
                                     String disk)
                              throws IOException
        Returns the specified persistent disk. Create a request for the method "disks.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.
        disk - Name of the persistent disk to return.
        Returns:
        the request
        Throws:
        IOException
      • getIamPolicy

        public Compute.Disks.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 "disks.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
      • insert

        public Compute.Disks.Insert insert(String project,
                                           String zone,
                                           Disk content)
                                    throws IOException
        Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. Create a request for the method "disks.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 Disk
        Returns:
        the request
        Throws:
        IOException
      • list

        public Compute.Disks.List list(String project,
                                       String zone)
                                throws IOException
        Retrieves a list of persistent disks contained within the specified zone. Create a request for the method "disks.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
      • removeResourcePolicies

        public Compute.Disks.RemoveResourcePolicies removeResourcePolicies(String project,
                                                                           String zone,
                                                                           String disk,
                                                                           DisksRemoveResourcePoliciesRequest content)
                                                                    throws IOException
        Removes resource policies from a disk. Create a request for the method "disks.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.
        disk - The disk name for this request.
        content - the DisksRemoveResourcePoliciesRequest
        Returns:
        the request
        Throws:
        IOException
      • resize

        public Compute.Disks.Resize resize(String project,
                                           String zone,
                                           String disk,
                                           DisksResizeRequest content)
                                    throws IOException
        Resizes the specified persistent disk. You can only increase the size of the disk. Create a request for the method "disks.resize". 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.
        disk - The name of the persistent disk.
        content - the DisksResizeRequest
        Returns:
        the request
        Throws:
        IOException
      • setIamPolicy

        public Compute.Disks.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 "disks.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.Disks.SetLabels setLabels(String project,
                                                 String zone,
                                                 String resource,
                                                 ZoneSetLabelsRequest content)
                                          throws IOException
        Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. Create a request for the method "disks.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.
        resource - Name or id of the resource for this request.
        content - the ZoneSetLabelsRequest
        Returns:
        the request
        Throws:
        IOException
      • startAsyncReplication

        public Compute.Disks.StartAsyncReplication startAsyncReplication(String project,
                                                                         String zone,
                                                                         String disk,
                                                                         DisksStartAsyncReplicationRequest content)
                                                                  throws IOException
        Starts asynchronous replication. Must be invoked on the primary disk. Create a request for the method "disks.startAsyncReplication". 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.
        disk - The name of the persistent disk.
        content - the DisksStartAsyncReplicationRequest
        Returns:
        the request
        Throws:
        IOException
      • stopAsyncReplication

        public Compute.Disks.StopAsyncReplication stopAsyncReplication(String project,
                                                                       String zone,
                                                                       String disk)
                                                                throws IOException
        Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. Create a request for the method "disks.stopAsyncReplication". 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.
        disk - The name of the persistent disk.
        Returns:
        the request
        Throws:
        IOException
      • stopGroupAsyncReplication

        public Compute.Disks.StopGroupAsyncReplication stopGroupAsyncReplication(String project,
                                                                                 String zone,
                                                                                 DisksStopGroupAsyncReplicationResource content)
                                                                          throws IOException
        Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope. Create a request for the method "disks.stopGroupAsyncReplication". 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. This must be the zone of the primary or secondary disks in the consistency group.
        content - the DisksStopGroupAsyncReplicationResource
        Returns:
        the request
        Throws:
        IOException
      • testIamPermissions

        public Compute.Disks.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 "disks.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.Disks.Update update(String project,
                                           String zone,
                                           String disk,
                                           Disk content)
                                    throws IOException
        Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license. Create a request for the method "disks.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.
        disk - The disk name for this request.
        content - the Disk
        Returns:
        the request
        Throws:
        IOException

Copyright © 2011–2025 Google. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy