- 1.63.0 (latest)
- 1.62.0
- 1.61.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.1
- 1.11.0
- 1.9.1
- 1.8.1
- 1.7.2
- 1.6.0-beta
public class RegionDisksClient implements 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:
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:
RegionDisksSettings regionDisksSettings =
RegionDisksSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionDisksClient regionDisksClient = RegionDisksClient.create(regionDisksSettings);
To customize the endpoint:
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.
Implements
BackgroundResourceStatic Methods
create()
public static final RegionDisksClient create()
Constructs an instance of RegionDisksClient with default settings.
Type | Description |
RegionDisksClient |
Type | Description |
IOException |
create(RegionDisksSettings settings)
public static final RegionDisksClient create(RegionDisksSettings settings)
Constructs an instance of RegionDisksClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | RegionDisksSettings |
Type | Description |
RegionDisksClient |
Type | Description |
IOException |
create(RegionDisksStub stub)
public static final RegionDisksClient create(RegionDisksStub stub)
Constructs an instance of RegionDisksClient, using the given stub for making calls. This is for advanced usage - prefer using create(RegionDisksSettings).
Name | Description |
stub | RegionDisksStub |
Type | Description |
RegionDisksClient |
Constructors
RegionDisksClient(RegionDisksSettings settings)
protected RegionDisksClient(RegionDisksSettings settings)
Constructs an instance of RegionDisksClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | RegionDisksSettings |
RegionDisksClient(RegionDisksStub stub)
protected RegionDisksClient(RegionDisksStub stub)
Name | Description |
stub | RegionDisksStub |
Methods
addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)
public final OperationFuture<Operation,Operation> addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest request)
Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Sample code:
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();
}
Name | Description |
request | AddResourcePoliciesRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)
public final OperationFuture<Operation,Operation> addResourcePoliciesAsync(String project, String region, String disk, RegionDisksAddResourcePoliciesRequest regionDisksAddResourcePoliciesRequestResource)
Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Sample code:
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();
}
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
disk | String The disk name for this request. |
regionDisksAddResourcePoliciesRequestResource | RegionDisksAddResourcePoliciesRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
addResourcePoliciesCallable()
public final UnaryCallable<AddResourcePoliciesRegionDiskRequest,Operation> addResourcePoliciesCallable()
Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Sample code:
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();
}
Type | Description |
UnaryCallable<AddResourcePoliciesRegionDiskRequest,Operation> |
addResourcePoliciesOperationCallable()
public final OperationCallable<AddResourcePoliciesRegionDiskRequest,Operation,Operation> addResourcePoliciesOperationCallable()
Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
Sample code:
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
Type | Description |
OperationCallable<AddResourcePoliciesRegionDiskRequest,Operation,Operation> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
createSnapshotAsync(CreateSnapshotRegionDiskRequest request)
public final OperationFuture<Operation,Operation> createSnapshotAsync(CreateSnapshotRegionDiskRequest request)
Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Sample code:
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();
}
Name | Description |
request | CreateSnapshotRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)
public final OperationFuture<Operation,Operation> createSnapshotAsync(String project, String region, String disk, Snapshot snapshotResource)
Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Sample code:
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();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
disk | String Name of the regional persistent disk to snapshot. |
snapshotResource | Snapshot The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
createSnapshotCallable()
public final UnaryCallable<CreateSnapshotRegionDiskRequest,Operation> createSnapshotCallable()
Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Sample code:
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();
}
Type | Description |
UnaryCallable<CreateSnapshotRegionDiskRequest,Operation> |
createSnapshotOperationCallable()
public final OperationCallable<CreateSnapshotRegionDiskRequest,Operation,Operation> createSnapshotOperationCallable()
Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
Sample code:
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
Type | Description |
OperationCallable<CreateSnapshotRegionDiskRequest,Operation,Operation> |
deleteAsync(DeleteRegionDiskRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteRegionDiskRequest request)
Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
Sample code:
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();
}
Name | Description |
request | DeleteRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteAsync(String project, String region, String disk)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String region, String disk)
Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String disk = "disk3083677";
Operation response = regionDisksClient.deleteAsync(project, region, disk).get();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
disk | String Name of the regional persistent disk to delete. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteCallable()
public final UnaryCallable<DeleteRegionDiskRequest,Operation> deleteCallable()
Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteRegionDiskRequest,Operation> |
deleteOperationCallable()
public final OperationCallable<DeleteRegionDiskRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
DeleteRegionDiskRequest request =
DeleteRegionDiskRequest.newBuilder()
.setDisk("disk3083677")
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.build();
OperationFuture
Type | Description |
OperationCallable<DeleteRegionDiskRequest,Operation,Operation> |
get(GetRegionDiskRequest request)
public final Disk get(GetRegionDiskRequest request)
Returns a specified regional persistent disk.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
GetRegionDiskRequest request =
GetRegionDiskRequest.newBuilder()
.setDisk("disk3083677")
.setProject("project-309310695")
.setRegion("region-934795532")
.build();
Disk response = regionDisksClient.get(request);
}
Name | Description |
request | GetRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
Disk |
get(String project, String region, String disk)
public final Disk get(String project, String region, String disk)
Returns a specified regional persistent disk.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String disk = "disk3083677";
Disk response = regionDisksClient.get(project, region, disk);
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
disk | String Name of the regional persistent disk to return. |
Type | Description |
Disk |
getCallable()
public final UnaryCallable<GetRegionDiskRequest,Disk> getCallable()
Returns a specified regional persistent disk.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetRegionDiskRequest,Disk> |
getIamPolicy(GetIamPolicyRegionDiskRequest request)
public final Policy getIamPolicy(GetIamPolicyRegionDiskRequest request)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
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);
}
Name | Description |
request | GetIamPolicyRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
Policy |
getIamPolicy(String project, String region, String resource)
public final Policy getIamPolicy(String project, String region, String resource)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String resource = "resource-341064690";
Policy response = regionDisksClient.getIamPolicy(project, region, resource);
}
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
resource | String Name or id of the resource for this request. |
Type | Description |
Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRegionDiskRequest,Policy> getIamPolicyCallable()
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
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();
}
Type | Description |
UnaryCallable<GetIamPolicyRegionDiskRequest,Policy> |
getSettings()
public final RegionDisksSettings getSettings()
Type | Description |
RegionDisksSettings |
getStub()
public RegionDisksStub getStub()
Type | Description |
RegionDisksStub |
insertAsync(InsertRegionDiskRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertRegionDiskRequest request)
Creates a persistent regional disk in the specified project using the data included in the request.
Sample code:
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();
}
Name | Description |
request | InsertRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
insertAsync(String project, String region, Disk diskResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, String region, Disk diskResource)
Creates a persistent regional disk in the specified project using the data included in the request.
Sample code:
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();
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
diskResource | Disk The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
insertCallable()
public final UnaryCallable<InsertRegionDiskRequest,Operation> insertCallable()
Creates a persistent regional disk in the specified project using the data included in the request.
Sample code:
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();
}
Type | Description |
UnaryCallable<InsertRegionDiskRequest,Operation> |
insertOperationCallable()
public final OperationCallable<InsertRegionDiskRequest,Operation,Operation> insertOperationCallable()
Creates a persistent regional disk in the specified project using the data included in the request.
Sample code:
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
Type | Description |
OperationCallable<InsertRegionDiskRequest,Operation,Operation> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
list(ListRegionDisksRequest request)
public final RegionDisksClient.ListPagedResponse list(ListRegionDisksRequest request)
Retrieves the list of persistent disks contained within the specified region.
Sample code:
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);
}
}
Name | Description |
request | ListRegionDisksRequest The request object containing all of the parameters for the API call. |
Type | Description |
RegionDisksClient.ListPagedResponse |
list(String project, String region)
public final RegionDisksClient.ListPagedResponse list(String project, String region)
Retrieves the list of persistent disks contained within the specified region.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
for (Disk element : regionDisksClient.list(project, region).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
project | String Project ID for this request. |
region | String Name of the region for this request. |
Type | Description |
RegionDisksClient.ListPagedResponse |
listCallable()
public final UnaryCallable<ListRegionDisksRequest,DiskList> listCallable()
Retrieves the list of persistent disks contained within the specified region.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListRegionDisksRequest,DiskList> |
listPagedCallable()
public final UnaryCallable<ListRegionDisksRequest,RegionDisksClient.ListPagedResponse> listPagedCallable()
Retrieves the list of persistent disks contained within the specified region.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListRegionDisksRequest,ListPagedResponse> |
removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)
public final OperationFuture<Operation,Operation> removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest request)
Removes resource policies from a regional disk.
Sample code:
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();
}
Name | Description |
request | RemoveResourcePoliciesRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)
public final OperationFuture<Operation,Operation> removeResourcePoliciesAsync(String project, String region, String disk, RegionDisksRemoveResourcePoliciesRequest regionDisksRemoveResourcePoliciesRequestResource)
Removes resource policies from a regional disk.
Sample code:
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();
}
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
disk | String The disk name for this request. |
regionDisksRemoveResourcePoliciesRequestResource | RegionDisksRemoveResourcePoliciesRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
removeResourcePoliciesCallable()
public final UnaryCallable<RemoveResourcePoliciesRegionDiskRequest,Operation> removeResourcePoliciesCallable()
Removes resource policies from a regional disk.
Sample code:
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();
}
Type | Description |
UnaryCallable<RemoveResourcePoliciesRegionDiskRequest,Operation> |
removeResourcePoliciesOperationCallable()
public final OperationCallable<RemoveResourcePoliciesRegionDiskRequest,Operation,Operation> removeResourcePoliciesOperationCallable()
Removes resource policies from a regional disk.
Sample code:
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
Type | Description |
OperationCallable<RemoveResourcePoliciesRegionDiskRequest,Operation,Operation> |
resizeAsync(ResizeRegionDiskRequest request)
public final OperationFuture<Operation,Operation> resizeAsync(ResizeRegionDiskRequest request)
Resizes the specified regional persistent disk.
Sample code:
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();
}
Name | Description |
request | ResizeRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)
public final OperationFuture<Operation,Operation> resizeAsync(String project, String region, String disk, RegionDisksResizeRequest regionDisksResizeRequestResource)
Resizes the specified regional persistent disk.
Sample code:
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();
}
Name | Description |
project | String The project ID for this request. |
region | String Name of the region for this request. |
disk | String Name of the regional persistent disk. |
regionDisksResizeRequestResource | RegionDisksResizeRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
resizeCallable()
public final UnaryCallable<ResizeRegionDiskRequest,Operation> resizeCallable()
Resizes the specified regional persistent disk.
Sample code:
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();
}
Type | Description |
UnaryCallable<ResizeRegionDiskRequest,Operation> |
resizeOperationCallable()
public final OperationCallable<ResizeRegionDiskRequest,Operation,Operation> resizeOperationCallable()
Resizes the specified regional persistent disk.
Sample code:
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
Type | Description |
OperationCallable<ResizeRegionDiskRequest,Operation,Operation> |
setIamPolicy(SetIamPolicyRegionDiskRequest request)
public final Policy setIamPolicy(SetIamPolicyRegionDiskRequest request)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
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);
}
Name | Description |
request | SetIamPolicyRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
Policy |
setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)
public final Policy setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
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);
}
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
resource | String Name or id of the resource for this request. |
regionSetPolicyRequestResource | RegionSetPolicyRequest The body resource for this request |
Type | Description |
Policy |
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyRegionDiskRequest,Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
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();
}
Type | Description |
UnaryCallable<SetIamPolicyRegionDiskRequest,Policy> |
setLabelsAsync(SetLabelsRegionDiskRequest request)
public final OperationFuture<Operation,Operation> setLabelsAsync(SetLabelsRegionDiskRequest request)
Sets the labels on the target regional disk.
Sample code:
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();
}
Name | Description |
request | SetLabelsRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)
public final OperationFuture<Operation,Operation> setLabelsAsync(String project, String region, String resource, RegionSetLabelsRequest regionSetLabelsRequestResource)
Sets the labels on the target regional disk.
Sample code:
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();
}
Name | Description |
project | String Project ID for this request. |
region | String The region for this request. |
resource | String Name or id of the resource for this request. |
regionSetLabelsRequestResource | RegionSetLabelsRequest The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
setLabelsCallable()
public final UnaryCallable<SetLabelsRegionDiskRequest,Operation> setLabelsCallable()
Sets the labels on the target regional disk.
Sample code:
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();
}
Type | Description |
UnaryCallable<SetLabelsRegionDiskRequest,Operation> |
setLabelsOperationCallable()
public final OperationCallable<SetLabelsRegionDiskRequest,Operation,Operation> setLabelsOperationCallable()
Sets the labels on the target regional disk.
Sample code:
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
Type | Description |
OperationCallable<SetLabelsRegionDiskRequest,Operation,Operation> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
testIamPermissions(TestIamPermissionsRegionDiskRequest request)
public final TestPermissionsResponse testIamPermissions(TestIamPermissionsRegionDiskRequest request)
Returns permissions that a caller has on the specified resource.
Sample code:
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);
}
Name | Description |
request | TestIamPermissionsRegionDiskRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestPermissionsResponse |
testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)
public final TestPermissionsResponse testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
Sample code:
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);
}
Name | Description |
project | String Project ID for this request. |
region | String The name of the region for this request. |
resource | String Name or id of the resource for this request. |
testPermissionsRequestResource | TestPermissionsRequest The body resource for this request |
Type | Description |
TestPermissionsResponse |
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsRegionDiskRequest,TestPermissionsResponse> testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
Sample code:
try (RegionDisksClient regionDisksClient = RegionDisksClient.create()) {
TestIamPermissionsRegionDiskRequest request =
TestIamPermissionsRegionDiskRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<TestIamPermissionsRegionDiskRequest,TestPermissionsResponse> |