Class RegionDisksClient (1.56.0)

GitHub RepositoryProduct Reference

Service Description: The RegionDisks API.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Disk response = regionDisksClient.get(project, region, disk);
 }
 

Note: close() needs to be called on the RegionDisksClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

AddResourcePolicies

Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • addResourcePoliciesOperationCallable()

  • addResourcePoliciesCallable()

BulkInsert

Bulk create a set of disks.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • bulkInsertAsync(BulkInsertRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • bulkInsertAsync(String project, String region, BulkInsertDiskResource bulkInsertDiskResourceResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • bulkInsertOperationCallable()

  • bulkInsertCallable()

CreateSnapshot

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createSnapshotAsync(CreateSnapshotRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createSnapshotOperationCallable()

  • createSnapshotCallable()

Delete

Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteAsync(DeleteRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteAsync(String project, String region, String disk)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteOperationCallable()

  • deleteCallable()

Get

Returns a specified regional persistent disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • get(GetRegionDiskRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • get(String project, String region, String disk)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getCallable()

GetIamPolicy

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRegionDiskRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getIamPolicy(String project, String region, String resource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

Insert

Creates a persistent regional disk in the specified project using the data included in the request.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • insertAsync(InsertRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • insertAsync(String project, String region, Disk diskResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • insertOperationCallable()

  • insertCallable()

List

Retrieves the list of persistent disks contained within the specified region.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • list(ListRegionDisksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • list(String project, String region)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listPagedCallable()

  • listCallable()

RemoveResourcePolicies

Removes resource policies from a regional disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • removeResourcePoliciesOperationCallable()

  • removeResourcePoliciesCallable()

Resize

Resizes the specified regional persistent disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • resizeAsync(ResizeRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • resizeOperationCallable()

  • resizeCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRegionDiskRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

SetLabels

Sets the labels on the target regional disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setLabelsAsync(SetLabelsRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setLabelsOperationCallable()

  • setLabelsCallable()

StartAsyncReplication

Starts asynchronous replication. Must be invoked on the primary disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • startAsyncReplicationAsync(StartAsyncReplicationRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • startAsyncReplicationAsync(String project, String region, String disk, RegionDisksStartAsyncReplicationRequest regionDisksStartAsyncReplicationRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • startAsyncReplicationOperationCallable()

  • startAsyncReplicationCallable()

StopAsyncReplication

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • stopAsyncReplicationAsync(StopAsyncReplicationRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • stopAsyncReplicationAsync(String project, String region, String disk)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • stopAsyncReplicationOperationCallable()

  • stopAsyncReplicationCallable()

StopGroupAsyncReplication

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • stopGroupAsyncReplicationAsync(String project, String region, DisksStopGroupAsyncReplicationResource disksStopGroupAsyncReplicationResourceResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • stopGroupAsyncReplicationOperationCallable()

  • stopGroupAsyncReplicationCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRegionDiskRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

Update

Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateAsync(UpdateRegionDiskRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateAsync(String project, String region, String disk, Disk diskResource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateOperationCallable()

  • updateCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of RegionDisksSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 RegionDisksSettings regionDisksSettings =
     RegionDisksSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 RegionDisksClient regionDisksClient = RegionDisksClient.create(regionDisksSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 RegionDisksSettings regionDisksSettings =
     RegionDisksSettings.newBuilder().setEndpoint(myEndpoint).build();
 RegionDisksClient regionDisksClient = RegionDisksClient.create(regionDisksSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > RegionDisksClient

Static Methods

create()

public static final RegionDisksClient create()

Constructs an instance of RegionDisksClient with default settings.

Returns
Type Description
RegionDisksClient
Exceptions
Type Description
IOException

create(RegionDisksSettings settings)

public static final RegionDisksClient create(RegionDisksSettings settings)

Constructs an instance of RegionDisksClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings RegionDisksSettings
Returns
Type Description
RegionDisksClient
Exceptions
Type Description
IOException

create(RegionDisksStub stub)

public static final RegionDisksClient create(RegionDisksStub stub)

Constructs an instance of RegionDisksClient, using the given stub for making calls. This is for advanced usage - prefer using create(RegionDisksSettings).

Parameter
Name Description
stub RegionDisksStub
Returns
Type Description
RegionDisksClient

Constructors

RegionDisksClient(RegionDisksSettings settings)

protected RegionDisksClient(RegionDisksSettings settings)

Constructs an instance of RegionDisksClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings RegionDisksSettings

RegionDisksClient(RegionDisksStub stub)

protected RegionDisksClient(RegionDisksStub stub)
Parameter
Name Description
stub RegionDisksStub

Methods

addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)

public final OperationFuture<Operation,Operation> addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)

Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   AddResourcePoliciesRegionDiskRequest request =
       AddResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksAddResourcePoliciesRequestResource(
               RegionDisksAddResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.addResourcePoliciesAsync(request).get();
 }
 
Parameter
Name Description
request AddResourcePoliciesRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)

public final OperationFuture<Operation,Operation> addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)

Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource =
       RegionDisksAddResourcePoliciesRequest.newBuilder().build();
   Operation response =
       regionDisksClient
           .addResourcePoliciesAsync(
               project, region, disk, regionDisksAddResourcePoliciesRequestResource)
           .get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

disk String

The disk name for this request.

regionDisksAddResourcePoliciesRequestResource RegionDisksAddResourcePoliciesRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

addResourcePoliciesCallable()

public final UnaryCallable<AddResourcePoliciesRegionDiskRequest,Operation> addResourcePoliciesCallable()

Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   AddResourcePoliciesRegionDiskRequest request =
       AddResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksAddResourcePoliciesRequestResource(
               RegionDisksAddResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       regionDisksClient.addResourcePoliciesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<AddResourcePoliciesRegionDiskRequest,Operation>

addResourcePoliciesOperationCallable()

public final OperationCallable<AddResourcePoliciesRegionDiskRequest,Operation,Operation> addResourcePoliciesOperationCallable()

Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   AddResourcePoliciesRegionDiskRequest request =
       AddResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksAddResourcePoliciesRequestResource(
               RegionDisksAddResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.addResourcePoliciesOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<AddResourcePoliciesRegionDiskRequest,Operation,Operation>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

bulkInsertAsync(BulkInsertRegionDiskRequest request)

public final OperationFuture<Operation,Operation> bulkInsertAsync(BulkInsertRegionDiskRequest request)

Bulk create a set of disks.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   BulkInsertRegionDiskRequest request =
       BulkInsertRegionDiskRequest.newBuilder()
           .setBulkInsertDiskResourceResource(BulkInsertDiskResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.bulkInsertAsync(request).get();
 }
 
Parameter
Name Description
request BulkInsertRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

bulkInsertAsync(String project, String region, BulkInsertDiskResource bulkInsertDiskResourceResource)

public final OperationFuture<Operation,Operation> bulkInsertAsync(String project, String region, BulkInsertDiskResource bulkInsertDiskResourceResource)

Bulk create a set of disks.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   BulkInsertDiskResource bulkInsertDiskResourceResource =
       BulkInsertDiskResource.newBuilder().build();
   Operation response =
       regionDisksClient.bulkInsertAsync(project, region, bulkInsertDiskResourceResource).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

bulkInsertDiskResourceResource BulkInsertDiskResource

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

bulkInsertCallable()

public final UnaryCallable<BulkInsertRegionDiskRequest,Operation> bulkInsertCallable()

Bulk create a set of disks.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   BulkInsertRegionDiskRequest request =
       BulkInsertRegionDiskRequest.newBuilder()
           .setBulkInsertDiskResourceResource(BulkInsertDiskResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = regionDisksClient.bulkInsertCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BulkInsertRegionDiskRequest,Operation>

bulkInsertOperationCallable()

public final OperationCallable<BulkInsertRegionDiskRequest,Operation,Operation> bulkInsertOperationCallable()

Bulk create a set of disks.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   BulkInsertRegionDiskRequest request =
       BulkInsertRegionDiskRequest.newBuilder()
           .setBulkInsertDiskResourceResource(BulkInsertDiskResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.bulkInsertOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<BulkInsertRegionDiskRequest,Operation,Operation>

close()

public final void close()

createSnapshotAsync(CreateSnapshotRegionDiskRequest request)

public final OperationFuture<Operation,Operation> createSnapshotAsync(CreateSnapshotRegionDiskRequest request)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   CreateSnapshotRegionDiskRequest request =
       CreateSnapshotRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSnapshotResource(Snapshot.newBuilder().build())
           .build();
   Operation response = regionDisksClient.createSnapshotAsync(request).get();
 }
 
Parameter
Name Description
request CreateSnapshotRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)

public final OperationFuture<Operation,Operation> createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Snapshot snapshotResource = Snapshot.newBuilder().build();
   Operation response =
       regionDisksClient.createSnapshotAsync(project, region, disk, snapshotResource).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

Name of the region for this request.

disk String

Name of the regional persistent disk to snapshot.

snapshotResource Snapshot

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

createSnapshotCallable()

public final UnaryCallable<CreateSnapshotRegionDiskRequest,Operation> createSnapshotCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   CreateSnapshotRegionDiskRequest request =
       CreateSnapshotRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSnapshotResource(Snapshot.newBuilder().build())
           .build();
   ApiFuture<Operation> future = regionDisksClient.createSnapshotCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateSnapshotRegionDiskRequest,Operation>

createSnapshotOperationCallable()

public final OperationCallable<CreateSnapshotRegionDiskRequest,Operation,Operation> createSnapshotOperationCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   CreateSnapshotRegionDiskRequest request =
       CreateSnapshotRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSnapshotResource(Snapshot.newBuilder().build())
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.createSnapshotOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateSnapshotRegionDiskRequest,Operation,Operation>

deleteAsync(DeleteRegionDiskRequest request)

public final OperationFuture<Operation,Operation> deleteAsync(DeleteRegionDiskRequest request)

Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   DeleteRegionDiskRequest request =
       DeleteRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.deleteAsync(request).get();
 }
 
Parameter
Name Description
request DeleteRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

deleteAsync(String project, String region, String disk)

public final OperationFuture<Operation,Operation> deleteAsync(String project, String region, String disk)

Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Operation response = regionDisksClient.deleteAsync(project, region, disk).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

Name of the region for this request.

disk String

Name of the regional persistent disk to delete.

Returns
Type Description
OperationFuture<Operation,Operation>

deleteCallable()

public final UnaryCallable<DeleteRegionDiskRequest,Operation> deleteCallable()

Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   DeleteRegionDiskRequest request =
       DeleteRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = regionDisksClient.deleteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteRegionDiskRequest,Operation>

deleteOperationCallable()

public final OperationCallable<DeleteRegionDiskRequest,Operation,Operation> deleteOperationCallable()

Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   DeleteRegionDiskRequest request =
       DeleteRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.deleteOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteRegionDiskRequest,Operation,Operation>

get(GetRegionDiskRequest request)

public final Disk get(GetRegionDiskRequest request)

Returns a specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   GetRegionDiskRequest request =
       GetRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .build();
   Disk response = regionDisksClient.get(request);
 }
 
Parameter
Name Description
request GetRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Disk

get(String project, String region, String disk)

public final Disk get(String project, String region, String disk)

Returns a specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Disk response = regionDisksClient.get(project, region, disk);
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

Name of the region for this request.

disk String

Name of the regional persistent disk to return.

Returns
Type Description
Disk

getCallable()

public final UnaryCallable<GetRegionDiskRequest,Disk> getCallable()

Returns a specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   GetRegionDiskRequest request =
       GetRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .build();
   ApiFuture<Disk> future = regionDisksClient.getCallable().futureCall(request);
   // Do something.
   Disk response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetRegionDiskRequest,Disk>

getIamPolicy(GetIamPolicyRegionDiskRequest request)

public final Policy getIamPolicy(GetIamPolicyRegionDiskRequest request)

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   GetIamPolicyRegionDiskRequest request =
       GetIamPolicyRegionDiskRequest.newBuilder()
           .setOptionsRequestedPolicyVersion(-574521795)
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setResource("resource-341064690")
           .build();
   Policy response = regionDisksClient.getIamPolicy(request);
 }
 
Parameter
Name Description
request GetIamPolicyRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Policy

getIamPolicy(String project, String region, String resource)

public final Policy getIamPolicy(String project, String region, String resource)

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String resource = "resource-341064690";
   Policy response = regionDisksClient.getIamPolicy(project, region, resource);
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

resource String

Name or id of the resource for this request.

Returns
Type Description
Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRegionDiskRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a resource. May be empty if no such policy or resource exists.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   GetIamPolicyRegionDiskRequest request =
       GetIamPolicyRegionDiskRequest.newBuilder()
           .setOptionsRequestedPolicyVersion(-574521795)
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setResource("resource-341064690")
           .build();
   ApiFuture<Policy> future = regionDisksClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetIamPolicyRegionDiskRequest,Policy>

getSettings()

public final RegionDisksSettings getSettings()
Returns
Type Description
RegionDisksSettings

getStub()

public RegionDisksStub getStub()
Returns
Type Description
RegionDisksStub

insertAsync(InsertRegionDiskRequest request)

public final OperationFuture<Operation,Operation> insertAsync(InsertRegionDiskRequest request)

Creates a persistent regional disk in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   InsertRegionDiskRequest request =
       InsertRegionDiskRequest.newBuilder()
           .setDiskResource(Disk.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSourceImage("sourceImage-105174528")
           .build();
   Operation response = regionDisksClient.insertAsync(request).get();
 }
 
Parameter
Name Description
request InsertRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

insertAsync(String project, String region, Disk diskResource)

public final OperationFuture<Operation,Operation> insertAsync(String project, String region, Disk diskResource)

Creates a persistent regional disk in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   Disk diskResource = Disk.newBuilder().build();
   Operation response = regionDisksClient.insertAsync(project, region, diskResource).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

Name of the region for this request.

diskResource Disk

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

insertCallable()

public final UnaryCallable<InsertRegionDiskRequest,Operation> insertCallable()

Creates a persistent regional disk in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   InsertRegionDiskRequest request =
       InsertRegionDiskRequest.newBuilder()
           .setDiskResource(Disk.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSourceImage("sourceImage-105174528")
           .build();
   ApiFuture<Operation> future = regionDisksClient.insertCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<InsertRegionDiskRequest,Operation>

insertOperationCallable()

public final OperationCallable<InsertRegionDiskRequest,Operation,Operation> insertOperationCallable()

Creates a persistent regional disk in the specified project using the data included in the request.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   InsertRegionDiskRequest request =
       InsertRegionDiskRequest.newBuilder()
           .setDiskResource(Disk.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setSourceImage("sourceImage-105174528")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.insertOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<InsertRegionDiskRequest,Operation,Operation>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

list(ListRegionDisksRequest request)

public final RegionDisksClient.ListPagedResponse list(ListRegionDisksRequest request)

Retrieves the list of persistent disks contained within the specified region.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ListRegionDisksRequest request =
       ListRegionDisksRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setReturnPartialSuccess(true)
           .build();
   for (Disk element : regionDisksClient.list(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListRegionDisksRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
RegionDisksClient.ListPagedResponse

list(String project, String region)

public final RegionDisksClient.ListPagedResponse list(String project, String region)

Retrieves the list of persistent disks contained within the specified region.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   for (Disk element : regionDisksClient.list(project, region).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

Name of the region for this request.

Returns
Type Description
RegionDisksClient.ListPagedResponse

listCallable()

public final UnaryCallable<ListRegionDisksRequest,DiskList> listCallable()

Retrieves the list of persistent disks contained within the specified region.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ListRegionDisksRequest request =
       ListRegionDisksRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setReturnPartialSuccess(true)
           .build();
   while (true) {
     DiskList response = regionDisksClient.listCallable().call(request);
     for (Disk element : response.getItemsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListRegionDisksRequest,DiskList>

listPagedCallable()

public final UnaryCallable<ListRegionDisksRequest,RegionDisksClient.ListPagedResponse> listPagedCallable()

Retrieves the list of persistent disks contained within the specified region.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ListRegionDisksRequest request =
       ListRegionDisksRequest.newBuilder()
           .setFilter("filter-1274492040")
           .setMaxResults(1128457243)
           .setOrderBy("orderBy-1207110587")
           .setPageToken("pageToken873572522")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setReturnPartialSuccess(true)
           .build();
   ApiFuture<Disk> future = regionDisksClient.listPagedCallable().futureCall(request);
   // Do something.
   for (Disk element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListRegionDisksRequest,ListPagedResponse>

removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)

public final OperationFuture<Operation,Operation> removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)

Removes resource policies from a regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   RemoveResourcePoliciesRegionDiskRequest request =
       RemoveResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksRemoveResourcePoliciesRequestResource(
               RegionDisksRemoveResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.removeResourcePoliciesAsync(request).get();
 }
 
Parameter
Name Description
request RemoveResourcePoliciesRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)

public final OperationFuture<Operation,Operation> removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)

Removes resource policies from a regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource =
       RegionDisksRemoveResourcePoliciesRequest.newBuilder().build();
   Operation response =
       regionDisksClient
           .removeResourcePoliciesAsync(
               project, region, disk, regionDisksRemoveResourcePoliciesRequestResource)
           .get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

disk String

The disk name for this request.

regionDisksRemoveResourcePoliciesRequestResource RegionDisksRemoveResourcePoliciesRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

removeResourcePoliciesCallable()

public final UnaryCallable<RemoveResourcePoliciesRegionDiskRequest,Operation> removeResourcePoliciesCallable()

Removes resource policies from a regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   RemoveResourcePoliciesRegionDiskRequest request =
       RemoveResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksRemoveResourcePoliciesRequestResource(
               RegionDisksRemoveResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       regionDisksClient.removeResourcePoliciesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RemoveResourcePoliciesRegionDiskRequest,Operation>

removeResourcePoliciesOperationCallable()

public final OperationCallable<RemoveResourcePoliciesRegionDiskRequest,Operation,Operation> removeResourcePoliciesOperationCallable()

Removes resource policies from a regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   RemoveResourcePoliciesRegionDiskRequest request =
       RemoveResourcePoliciesRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksRemoveResourcePoliciesRequestResource(
               RegionDisksRemoveResourcePoliciesRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.removeResourcePoliciesOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<RemoveResourcePoliciesRegionDiskRequest,Operation,Operation>

resizeAsync(ResizeRegionDiskRequest request)

public final OperationFuture<Operation,Operation> resizeAsync(ResizeRegionDiskRequest request)

Resizes the specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ResizeRegionDiskRequest request =
       ResizeRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksResizeRequestResource(RegionDisksResizeRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.resizeAsync(request).get();
 }
 
Parameter
Name Description
request ResizeRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)

public final OperationFuture<Operation,Operation> resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)

Resizes the specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   RegionDisksResizeRequest regionDisksResizeRequestResource =
       RegionDisksResizeRequest.newBuilder().build();
   Operation response =
       regionDisksClient
           .resizeAsync(project, region, disk, regionDisksResizeRequestResource)
           .get();
 }
 
Parameters
Name Description
project String

The project ID for this request.

region String

Name of the region for this request.

disk String

Name of the regional persistent disk.

regionDisksResizeRequestResource RegionDisksResizeRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

resizeCallable()

public final UnaryCallable<ResizeRegionDiskRequest,Operation> resizeCallable()

Resizes the specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ResizeRegionDiskRequest request =
       ResizeRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksResizeRequestResource(RegionDisksResizeRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future = regionDisksClient.resizeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<ResizeRegionDiskRequest,Operation>

resizeOperationCallable()

public final OperationCallable<ResizeRegionDiskRequest,Operation,Operation> resizeOperationCallable()

Resizes the specified regional persistent disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   ResizeRegionDiskRequest request =
       ResizeRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksResizeRequestResource(RegionDisksResizeRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.resizeOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<ResizeRegionDiskRequest,Operation,Operation>

setIamPolicy(SetIamPolicyRegionDiskRequest request)

public final Policy setIamPolicy(SetIamPolicyRegionDiskRequest request)

Sets the access control policy on the specified resource. Replaces any existing policy.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   SetIamPolicyRegionDiskRequest request =
       SetIamPolicyRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionSetPolicyRequestResource(RegionSetPolicyRequest.newBuilder().build())
           .setResource("resource-341064690")
           .build();
   Policy response = regionDisksClient.setIamPolicy(request);
 }
 
Parameter
Name Description
request SetIamPolicyRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Policy

setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)

public final Policy setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)

Sets the access control policy on the specified resource. Replaces any existing policy.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String resource = "resource-341064690";
   RegionSetPolicyRequest regionSetPolicyRequestResource =
       RegionSetPolicyRequest.newBuilder().build();
   Policy response =
       regionDisksClient.setIamPolicy(project, region, resource, regionSetPolicyRequestResource);
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

resource String

Name or id of the resource for this request.

regionSetPolicyRequestResource RegionSetPolicyRequest

The body resource for this request

Returns
Type Description
Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRegionDiskRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified resource. Replaces any existing policy.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   SetIamPolicyRegionDiskRequest request =
       SetIamPolicyRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionSetPolicyRequestResource(RegionSetPolicyRequest.newBuilder().build())
           .setResource("resource-341064690")
           .build();
   ApiFuture<Policy> future = regionDisksClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetIamPolicyRegionDiskRequest,Policy>

setLabelsAsync(SetLabelsRegionDiskRequest request)

public final OperationFuture<Operation,Operation> setLabelsAsync(SetLabelsRegionDiskRequest request)

Sets the labels on the target regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   SetLabelsRegionDiskRequest request =
       SetLabelsRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .setResource("resource-341064690")
           .build();
   Operation response = regionDisksClient.setLabelsAsync(request).get();
 }
 
Parameter
Name Description
request SetLabelsRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)

public final OperationFuture<Operation,Operation> setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)

Sets the labels on the target regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String resource = "resource-341064690";
   RegionSetLabelsRequest regionSetLabelsRequestResource =
       RegionSetLabelsRequest.newBuilder().build();
   Operation response =
       regionDisksClient
           .setLabelsAsync(project, region, resource, regionSetLabelsRequestResource)
           .get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The region for this request.

resource String

Name or id of the resource for this request.

regionSetLabelsRequestResource RegionSetLabelsRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

setLabelsCallable()

public final UnaryCallable<SetLabelsRegionDiskRequest,Operation> setLabelsCallable()

Sets the labels on the target regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   SetLabelsRegionDiskRequest request =
       SetLabelsRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .setResource("resource-341064690")
           .build();
   ApiFuture<Operation> future = regionDisksClient.setLabelsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<SetLabelsRegionDiskRequest,Operation>

setLabelsOperationCallable()

public final OperationCallable<SetLabelsRegionDiskRequest,Operation,Operation> setLabelsOperationCallable()

Sets the labels on the target regional disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   SetLabelsRegionDiskRequest request =
       SetLabelsRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionSetLabelsRequestResource(RegionSetLabelsRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .setResource("resource-341064690")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.setLabelsOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<SetLabelsRegionDiskRequest,Operation,Operation>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

startAsyncReplicationAsync(StartAsyncReplicationRegionDiskRequest request)

public final OperationFuture<Operation,Operation> startAsyncReplicationAsync(StartAsyncReplicationRegionDiskRequest request)

Starts asynchronous replication. Must be invoked on the primary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StartAsyncReplicationRegionDiskRequest request =
       StartAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksStartAsyncReplicationRequestResource(
               RegionDisksStartAsyncReplicationRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.startAsyncReplicationAsync(request).get();
 }
 
Parameter
Name Description
request StartAsyncReplicationRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

startAsyncReplicationAsync(String project, String region, String disk, RegionDisksStartAsyncReplicationRequest regionDisksStartAsyncReplicationRequestResource)

public final OperationFuture<Operation,Operation> startAsyncReplicationAsync(String project, String region, String disk, RegionDisksStartAsyncReplicationRequest regionDisksStartAsyncReplicationRequestResource)

Starts asynchronous replication. Must be invoked on the primary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   RegionDisksStartAsyncReplicationRequest regionDisksStartAsyncReplicationRequestResource =
       RegionDisksStartAsyncReplicationRequest.newBuilder().build();
   Operation response =
       regionDisksClient
           .startAsyncReplicationAsync(
               project, region, disk, regionDisksStartAsyncReplicationRequestResource)
           .get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

disk String

The name of the persistent disk.

regionDisksStartAsyncReplicationRequestResource RegionDisksStartAsyncReplicationRequest

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

startAsyncReplicationCallable()

public final UnaryCallable<StartAsyncReplicationRegionDiskRequest,Operation> startAsyncReplicationCallable()

Starts asynchronous replication. Must be invoked on the primary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StartAsyncReplicationRegionDiskRequest request =
       StartAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksStartAsyncReplicationRequestResource(
               RegionDisksStartAsyncReplicationRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       regionDisksClient.startAsyncReplicationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<StartAsyncReplicationRegionDiskRequest,Operation>

startAsyncReplicationOperationCallable()

public final OperationCallable<StartAsyncReplicationRegionDiskRequest,Operation,Operation> startAsyncReplicationOperationCallable()

Starts asynchronous replication. Must be invoked on the primary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StartAsyncReplicationRegionDiskRequest request =
       StartAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRegionDisksStartAsyncReplicationRequestResource(
               RegionDisksStartAsyncReplicationRequest.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.startAsyncReplicationOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<StartAsyncReplicationRegionDiskRequest,Operation,Operation>

stopAsyncReplicationAsync(StopAsyncReplicationRegionDiskRequest request)

public final OperationFuture<Operation,Operation> stopAsyncReplicationAsync(StopAsyncReplicationRegionDiskRequest request)

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopAsyncReplicationRegionDiskRequest request =
       StopAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.stopAsyncReplicationAsync(request).get();
 }
 
Parameter
Name Description
request StopAsyncReplicationRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

stopAsyncReplicationAsync(String project, String region, String disk)

public final OperationFuture<Operation,Operation> stopAsyncReplicationAsync(String project, String region, String disk)

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Operation response = regionDisksClient.stopAsyncReplicationAsync(project, region, disk).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

disk String

The name of the persistent disk.

Returns
Type Description
OperationFuture<Operation,Operation>

stopAsyncReplicationCallable()

public final UnaryCallable<StopAsyncReplicationRegionDiskRequest,Operation> stopAsyncReplicationCallable()

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopAsyncReplicationRegionDiskRequest request =
       StopAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       regionDisksClient.stopAsyncReplicationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<StopAsyncReplicationRegionDiskRequest,Operation>

stopAsyncReplicationOperationCallable()

public final OperationCallable<StopAsyncReplicationRegionDiskRequest,Operation,Operation> stopAsyncReplicationOperationCallable()

Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopAsyncReplicationRegionDiskRequest request =
       StopAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.stopAsyncReplicationOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<StopAsyncReplicationRegionDiskRequest,Operation,Operation>

stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationRegionDiskRequest request)

public final OperationFuture<Operation,Operation> stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationRegionDiskRequest request)

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopGroupAsyncReplicationRegionDiskRequest request =
       StopGroupAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisksStopGroupAsyncReplicationResourceResource(
               DisksStopGroupAsyncReplicationResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   Operation response = regionDisksClient.stopGroupAsyncReplicationAsync(request).get();
 }
 
Parameter
Name Description
request StopGroupAsyncReplicationRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

stopGroupAsyncReplicationAsync(String project, String region, DisksStopGroupAsyncReplicationResource disksStopGroupAsyncReplicationResourceResource)

public final OperationFuture<Operation,Operation> stopGroupAsyncReplicationAsync(String project, String region, DisksStopGroupAsyncReplicationResource disksStopGroupAsyncReplicationResourceResource)

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   DisksStopGroupAsyncReplicationResource disksStopGroupAsyncReplicationResourceResource =
       DisksStopGroupAsyncReplicationResource.newBuilder().build();
   Operation response =
       regionDisksClient
           .stopGroupAsyncReplicationAsync(
               project, region, disksStopGroupAsyncReplicationResourceResource)
           .get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group.

disksStopGroupAsyncReplicationResourceResource DisksStopGroupAsyncReplicationResource

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

stopGroupAsyncReplicationCallable()

public final UnaryCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation> stopGroupAsyncReplicationCallable()

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopGroupAsyncReplicationRegionDiskRequest request =
       StopGroupAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisksStopGroupAsyncReplicationResourceResource(
               DisksStopGroupAsyncReplicationResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       regionDisksClient.stopGroupAsyncReplicationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation>

stopGroupAsyncReplicationOperationCallable()

public final OperationCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation,Operation> stopGroupAsyncReplicationOperationCallable()

Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   StopGroupAsyncReplicationRegionDiskRequest request =
       StopGroupAsyncReplicationRegionDiskRequest.newBuilder()
           .setDisksStopGroupAsyncReplicationResourceResource(
               DisksStopGroupAsyncReplicationResource.newBuilder().build())
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.stopGroupAsyncReplicationOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation,Operation>

testIamPermissions(TestIamPermissionsRegionDiskRequest request)

public final TestPermissionsResponse testIamPermissions(TestIamPermissionsRegionDiskRequest request)

Returns permissions that a caller has on the specified resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   TestIamPermissionsRegionDiskRequest request =
       TestIamPermissionsRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setResource("resource-341064690")
           .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
           .build();
   TestPermissionsResponse response = regionDisksClient.testIamPermissions(request);
 }
 
Parameter
Name Description
request TestIamPermissionsRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TestPermissionsResponse

testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)

public final TestPermissionsResponse testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)

Returns permissions that a caller has on the specified resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String resource = "resource-341064690";
   TestPermissionsRequest testPermissionsRequestResource =
       TestPermissionsRequest.newBuilder().build();
   TestPermissionsResponse response =
       regionDisksClient.testIamPermissions(
           project, region, resource, testPermissionsRequestResource);
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

resource String

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

Returns
Type Description
TestPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRegionDiskRequest,TestPermissionsResponse> testIamPermissionsCallable()

Returns permissions that a caller has on the specified resource.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   TestIamPermissionsRegionDiskRequest request =
       TestIamPermissionsRegionDiskRequest.newBuilder()
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setResource("resource-341064690")
           .setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
           .build();
   ApiFuture<TestPermissionsResponse> future =
       regionDisksClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestPermissionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<TestIamPermissionsRegionDiskRequest,TestPermissionsResponse>

updateAsync(UpdateRegionDiskRequest request)

public final OperationFuture<Operation,Operation> updateAsync(UpdateRegionDiskRequest request)

Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   UpdateRegionDiskRequest request =
       UpdateRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setDiskResource(Disk.newBuilder().build())
           .setPaths("paths106438894")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setUpdateMask("updateMask-296147115")
           .build();
   Operation response = regionDisksClient.updateAsync(request).get();
 }
 
Parameter
Name Description
request UpdateRegionDiskRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Operation,Operation>

updateAsync(String project, String region, String disk, Disk diskResource)

public final OperationFuture<Operation,Operation> updateAsync(String project, String region, String disk, Disk diskResource)

Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   String project = "project-309310695";
   String region = "region-934795532";
   String disk = "disk3083677";
   Disk diskResource = Disk.newBuilder().build();
   Operation response = regionDisksClient.updateAsync(project, region, disk, diskResource).get();
 }
 
Parameters
Name Description
project String

Project ID for this request.

region String

The name of the region for this request.

disk String

The disk name for this request.

diskResource Disk

The body resource for this request

Returns
Type Description
OperationFuture<Operation,Operation>

updateCallable()

public final UnaryCallable<UpdateRegionDiskRequest,Operation> updateCallable()

Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   UpdateRegionDiskRequest request =
       UpdateRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setDiskResource(Disk.newBuilder().build())
           .setPaths("paths106438894")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setUpdateMask("updateMask-296147115")
           .build();
   ApiFuture<Operation> future = regionDisksClient.updateCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateRegionDiskRequest,Operation>

updateOperationCallable()

public final OperationCallable<UpdateRegionDiskRequest,Operation,Operation> updateOperationCallable()

Update the specified disk with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
   UpdateRegionDiskRequest request =
       UpdateRegionDiskRequest.newBuilder()
           .setDisk("disk3083677")
           .setDiskResource(Disk.newBuilder().build())
           .setPaths("paths106438894")
           .setProject("project-309310695")
           .setRegion("region-934795532")
           .setRequestId("requestId693933066")
           .setUpdateMask("updateMask-296147115")
           .build();
   OperationFuture<Operation, Operation> future =
       regionDisksClient.updateOperationCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateRegionDiskRequest,Operation,Operation>