Class RegionDisksClient
- java.lang.Object
-
- com.google.cloud.compute.v1.RegionDisksClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class RegionDisksClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RegionDisksClient.ListFixedSizeCollection
static class
RegionDisksClient.ListPage
static class
RegionDisksClient.ListPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
RegionDisksClient(RegionDisksSettings settings)
Constructs an instance of RegionDisksClient, using the given settings.protected
RegionDisksClient(RegionDisksStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)
Adds existing resource policies to a regional disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)
Adds existing resource policies to a regional disk.com.google.api.gax.rpc.UnaryCallable<AddResourcePoliciesRegionDiskRequest,Operation>
addResourcePoliciesCallable()
Adds existing resource policies to a regional disk.com.google.api.gax.rpc.OperationCallable<AddResourcePoliciesRegionDiskRequest,Operation,Operation>
addResourcePoliciesOperationCallable()
Adds existing resource policies to a regional disk.boolean
awaitTermination(long duration, TimeUnit unit)
com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
bulkInsertAsync(BulkInsertRegionDiskRequest request)
Bulk create a set of disks.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
bulkInsertAsync(String project, String region, BulkInsertDiskResource bulkInsertDiskResourceResource)
Bulk create a set of disks.com.google.api.gax.rpc.UnaryCallable<BulkInsertRegionDiskRequest,Operation>
bulkInsertCallable()
Bulk create a set of disks.com.google.api.gax.rpc.OperationCallable<BulkInsertRegionDiskRequest,Operation,Operation>
bulkInsertOperationCallable()
Bulk create a set of disks.void
close()
static RegionDisksClient
create()
Constructs an instance of RegionDisksClient with default settings.static RegionDisksClient
create(RegionDisksSettings settings)
Constructs an instance of RegionDisksClient, using the given settings.static RegionDisksClient
create(RegionDisksStub stub)
Constructs an instance of RegionDisksClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
createSnapshotAsync(CreateSnapshotRegionDiskRequest request)
Creates a snapshot of a specified persistent disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)
Creates a snapshot of a specified persistent disk.com.google.api.gax.rpc.UnaryCallable<CreateSnapshotRegionDiskRequest,Operation>
createSnapshotCallable()
Creates a snapshot of a specified persistent disk.com.google.api.gax.rpc.OperationCallable<CreateSnapshotRegionDiskRequest,Operation,Operation>
createSnapshotOperationCallable()
Creates a snapshot of a specified persistent disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteAsync(DeleteRegionDiskRequest request)
Deletes the specified regional persistent disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
deleteAsync(String project, String region, String disk)
Deletes the specified regional persistent disk.com.google.api.gax.rpc.UnaryCallable<DeleteRegionDiskRequest,Operation>
deleteCallable()
Deletes the specified regional persistent disk.com.google.api.gax.rpc.OperationCallable<DeleteRegionDiskRequest,Operation,Operation>
deleteOperationCallable()
Deletes the specified regional persistent disk.Disk
get(GetRegionDiskRequest request)
Returns a specified regional persistent disk.Disk
get(String project, String region, String disk)
Returns a specified regional persistent disk.com.google.api.gax.rpc.UnaryCallable<GetRegionDiskRequest,Disk>
getCallable()
Returns a specified regional persistent disk.Policy
getIamPolicy(GetIamPolicyRegionDiskRequest request)
Gets the access control policy for a resource.Policy
getIamPolicy(String project, String region, String resource)
Gets the access control policy for a resource.com.google.api.gax.rpc.UnaryCallable<GetIamPolicyRegionDiskRequest,Policy>
getIamPolicyCallable()
Gets the access control policy for a resource.RegionDisksSettings
getSettings()
RegionDisksStub
getStub()
com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
insertAsync(InsertRegionDiskRequest request)
Creates a persistent regional disk in the specified project using the data included in the request.com.google.api.gax.longrunning.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.com.google.api.gax.rpc.UnaryCallable<InsertRegionDiskRequest,Operation>
insertCallable()
Creates a persistent regional disk in the specified project using the data included in the request.com.google.api.gax.rpc.OperationCallable<InsertRegionDiskRequest,Operation,Operation>
insertOperationCallable()
Creates a persistent regional disk in the specified project using the data included in the request.boolean
isShutdown()
boolean
isTerminated()
RegionDisksClient.ListPagedResponse
list(ListRegionDisksRequest request)
Retrieves the list of persistent disks contained within the specified region.RegionDisksClient.ListPagedResponse
list(String project, String region)
Retrieves the list of persistent disks contained within the specified region.com.google.api.gax.rpc.UnaryCallable<ListRegionDisksRequest,DiskList>
listCallable()
Retrieves the list of persistent disks contained within the specified region.com.google.api.gax.rpc.UnaryCallable<ListRegionDisksRequest,RegionDisksClient.ListPagedResponse>
listPagedCallable()
Retrieves the list of persistent disks contained within the specified region.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)
Removes resource policies from a regional disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)
Removes resource policies from a regional disk.com.google.api.gax.rpc.UnaryCallable<RemoveResourcePoliciesRegionDiskRequest,Operation>
removeResourcePoliciesCallable()
Removes resource policies from a regional disk.com.google.api.gax.rpc.OperationCallable<RemoveResourcePoliciesRegionDiskRequest,Operation,Operation>
removeResourcePoliciesOperationCallable()
Removes resource policies from a regional disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
resizeAsync(ResizeRegionDiskRequest request)
Resizes the specified regional persistent disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)
Resizes the specified regional persistent disk.com.google.api.gax.rpc.UnaryCallable<ResizeRegionDiskRequest,Operation>
resizeCallable()
Resizes the specified regional persistent disk.com.google.api.gax.rpc.OperationCallable<ResizeRegionDiskRequest,Operation,Operation>
resizeOperationCallable()
Resizes the specified regional persistent disk.Policy
setIamPolicy(SetIamPolicyRegionDiskRequest request)
Sets the access control policy on the specified resource.Policy
setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)
Sets the access control policy on the specified resource.com.google.api.gax.rpc.UnaryCallable<SetIamPolicyRegionDiskRequest,Policy>
setIamPolicyCallable()
Sets the access control policy on the specified resource.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setLabelsAsync(SetLabelsRegionDiskRequest request)
Sets the labels on the target regional disk.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)
Sets the labels on the target regional disk.com.google.api.gax.rpc.UnaryCallable<SetLabelsRegionDiskRequest,Operation>
setLabelsCallable()
Sets the labels on the target regional disk.com.google.api.gax.rpc.OperationCallable<SetLabelsRegionDiskRequest,Operation,Operation>
setLabelsOperationCallable()
Sets the labels on the target regional disk.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
startAsyncReplicationAsync(StartAsyncReplicationRegionDiskRequest request)
Starts asynchronous replication.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
startAsyncReplicationAsync(String project, String region, String disk, RegionDisksStartAsyncReplicationRequest regionDisksStartAsyncReplicationRequestResource)
Starts asynchronous replication.com.google.api.gax.rpc.UnaryCallable<StartAsyncReplicationRegionDiskRequest,Operation>
startAsyncReplicationCallable()
Starts asynchronous replication.com.google.api.gax.rpc.OperationCallable<StartAsyncReplicationRegionDiskRequest,Operation,Operation>
startAsyncReplicationOperationCallable()
Starts asynchronous replication.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
stopAsyncReplicationAsync(StopAsyncReplicationRegionDiskRequest request)
Stops asynchronous replication.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
stopAsyncReplicationAsync(String project, String region, String disk)
Stops asynchronous replication.com.google.api.gax.rpc.UnaryCallable<StopAsyncReplicationRegionDiskRequest,Operation>
stopAsyncReplicationCallable()
Stops asynchronous replication.com.google.api.gax.rpc.OperationCallable<StopAsyncReplicationRegionDiskRequest,Operation,Operation>
stopAsyncReplicationOperationCallable()
Stops asynchronous replication.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationRegionDiskRequest request)
Stops asynchronous replication for a consistency group of disks.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
stopGroupAsyncReplicationAsync(String project, String region, DisksStopGroupAsyncReplicationResource disksStopGroupAsyncReplicationResourceResource)
Stops asynchronous replication for a consistency group of disks.com.google.api.gax.rpc.UnaryCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation>
stopGroupAsyncReplicationCallable()
Stops asynchronous replication for a consistency group of disks.com.google.api.gax.rpc.OperationCallable<StopGroupAsyncReplicationRegionDiskRequest,Operation,Operation>
stopGroupAsyncReplicationOperationCallable()
Stops asynchronous replication for a consistency group of disks.TestPermissionsResponse
testIamPermissions(TestIamPermissionsRegionDiskRequest request)
Returns permissions that a caller has on the specified resource.TestPermissionsResponse
testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsRegionDiskRequest,TestPermissionsResponse>
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
updateAsync(UpdateRegionDiskRequest request)
Update the specified disk with the data included in the request.com.google.api.gax.longrunning.OperationFuture<Operation,Operation>
updateAsync(String project, String region, String disk, Disk diskResource)
Update the specified disk with the data included in the request.com.google.api.gax.rpc.UnaryCallable<UpdateRegionDiskRequest,Operation>
updateCallable()
Update the specified disk with the data included in the request.com.google.api.gax.rpc.OperationCallable<UpdateRegionDiskRequest,Operation,Operation>
updateOperationCallable()
Update the specified disk with the data included in the request.
-
-
-
Constructor Detail
-
RegionDisksClient
protected RegionDisksClient(RegionDisksSettings settings) throws IOException
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.- Throws:
IOException
-
RegionDisksClient
protected RegionDisksClient(RegionDisksStub stub)
-
-
Method Detail
-
create
public static final RegionDisksClient create() throws IOException
Constructs an instance of RegionDisksClient with default settings.- Throws:
IOException
-
create
public static final RegionDisksClient create(RegionDisksSettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final RegionDisksSettings getSettings()
-
getStub
public RegionDisksStub getStub()
-
addResourcePoliciesAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.disk
- The disk name for this request.regionDisksAddResourcePoliciesRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
addResourcePoliciesAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
addResourcePoliciesOperationCallable
public final com.google.api.gax.rpc.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(); }
-
addResourcePoliciesCallable
public final com.google.api.gax.rpc.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(); }
-
bulkInsertAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.bulkInsertDiskResourceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
bulkInsertAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
bulkInsertOperationCallable
public final com.google.api.gax.rpc.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(); }
-
bulkInsertCallable
public final com.google.api.gax.rpc.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(); }
-
createSnapshotAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- Name of the region for this request.disk
- Name of the regional persistent disk to snapshot.snapshotResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSnapshotAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSnapshotOperationCallable
public final com.google.api.gax.rpc.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(); }
-
createSnapshotCallable
public final com.google.api.gax.rpc.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(); }
-
deleteAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- Name of the region for this request.disk
- Name of the regional persistent disk to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteOperationCallable
public final com.google.api.gax.rpc.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(); }
-
deleteCallable
public final com.google.api.gax.rpc.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(); }
-
get
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:
project
- Project ID for this request.region
- Name of the region for this request.disk
- Name of the regional persistent disk to return.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
get
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getCallable
public final com.google.api.gax.rpc.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(); }
-
getIamPolicy
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:
project
- Project ID for this request.region
- The name of the region for this request.resource
- Name or id of the resource for this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicy
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getIamPolicyCallable
public final com.google.api.gax.rpc.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(); }
-
insertAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- Name of the region for this request.diskResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
insertOperationCallable
public final com.google.api.gax.rpc.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(); }
-
insertCallable
public final com.google.api.gax.rpc.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(); }
-
list
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:
project
- Project ID for this request.region
- Name of the region for this request.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
list
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listCallable
public final com.google.api.gax.rpc.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; } } }
-
removeResourcePoliciesAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.disk
- The disk name for this request.regionDisksRemoveResourcePoliciesRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
removeResourcePoliciesAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
removeResourcePoliciesOperationCallable
public final com.google.api.gax.rpc.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(); }
-
removeResourcePoliciesCallable
public final com.google.api.gax.rpc.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(); }
-
resizeAsync
public final com.google.api.gax.longrunning.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:
project
- The project ID for this request.region
- Name of the region for this request.disk
- Name of the regional persistent disk.regionDisksResizeRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resizeAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resizeOperationCallable
public final com.google.api.gax.rpc.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(); }
-
resizeCallable
public final com.google.api.gax.rpc.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(); }
-
setIamPolicy
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:
project
- Project ID for this request.region
- The name of the region for this request.resource
- Name or id of the resource for this request.regionSetPolicyRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicy
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setIamPolicyCallable
public final com.google.api.gax.rpc.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(); }
-
setLabelsAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The region for this request.resource
- Name or id of the resource for this request.regionSetLabelsRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setLabelsAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
setLabelsOperationCallable
public final com.google.api.gax.rpc.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(); }
-
setLabelsCallable
public final com.google.api.gax.rpc.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(); }
-
startAsyncReplicationAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.disk
- The name of the persistent disk.regionDisksStartAsyncReplicationRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startAsyncReplicationAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startAsyncReplicationOperationCallable
public final com.google.api.gax.rpc.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(); }
-
startAsyncReplicationCallable
public final com.google.api.gax.rpc.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(); }
-
stopAsyncReplicationAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.disk
- The name of the persistent disk.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopAsyncReplicationAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopAsyncReplicationOperationCallable
public final com.google.api.gax.rpc.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(); }
-
stopAsyncReplicationCallable
public final com.google.api.gax.rpc.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(); }
-
stopGroupAsyncReplicationAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group.disksStopGroupAsyncReplicationResourceResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopGroupAsyncReplicationAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopGroupAsyncReplicationOperationCallable
public final com.google.api.gax.rpc.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(); }
-
stopGroupAsyncReplicationCallable
public final com.google.api.gax.rpc.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(); }
-
testIamPermissions
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:
project
- Project ID for this request.region
- The name of the region for this request.resource
- Name or id of the resource for this request.testPermissionsRequestResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissions
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
testIamPermissionsCallable
public final com.google.api.gax.rpc.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(); }
-
updateAsync
public final com.google.api.gax.longrunning.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:
project
- Project ID for this request.region
- The name of the region for this request.disk
- The disk name for this request.diskResource
- The body resource for this request- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateAsync
@BetaApi("The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateOperationCallable
public final com.google.api.gax.rpc.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(); }
-
updateCallable
public final com.google.api.gax.rpc.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(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-