| GitHub Repository | Product Reference |
Service Description: The RegionInstantSnapshotGroups 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
InstantSnapshotGroup response =
regionInstantSnapshotGroupsClient.get(project, region, instantSnapshotGroup);
}
Note: close() needs to be called on the RegionInstantSnapshotGroupsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
Delete |
deletes a Regional InstantSnapshotGroup resource |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
returns the specified InstantSnapshotGroup resource in the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. May be empty if no such policy or resource exists. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
creates a Regional InstantSnapshotGroup resource |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
retrieves the list of InstantSnapshotGroup resources contained within the specified region. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replaces any existing policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return 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 RegionInstantSnapshotGroupsSettings 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
RegionInstantSnapshotGroupsSettings regionInstantSnapshotGroupsSettings =
RegionInstantSnapshotGroupsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create(regionInstantSnapshotGroupsSettings);
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
RegionInstantSnapshotGroupsSettings regionInstantSnapshotGroupsSettings =
RegionInstantSnapshotGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create(regionInstantSnapshotGroupsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final RegionInstantSnapshotGroupsClient create()Constructs an instance of RegionInstantSnapshotGroupsClient with default settings.
| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(RegionInstantSnapshotGroupsSettings settings)
public static final RegionInstantSnapshotGroupsClient create(RegionInstantSnapshotGroupsSettings settings)Constructs an instance of RegionInstantSnapshotGroupsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
RegionInstantSnapshotGroupsSettings |
| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(RegionInstantSnapshotGroupsStub stub)
public static final RegionInstantSnapshotGroupsClient create(RegionInstantSnapshotGroupsStub stub)Constructs an instance of RegionInstantSnapshotGroupsClient, using the given stub for making calls. This is for advanced usage - prefer using create(RegionInstantSnapshotGroupsSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
RegionInstantSnapshotGroupsStub |
| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsClient |
|
Constructors
RegionInstantSnapshotGroupsClient(RegionInstantSnapshotGroupsSettings settings)
protected RegionInstantSnapshotGroupsClient(RegionInstantSnapshotGroupsSettings settings)Constructs an instance of RegionInstantSnapshotGroupsClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
RegionInstantSnapshotGroupsSettings |
RegionInstantSnapshotGroupsClient(RegionInstantSnapshotGroupsStub stub)
protected RegionInstantSnapshotGroupsClient(RegionInstantSnapshotGroupsStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
RegionInstantSnapshotGroupsStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()deleteAsync(DeleteRegionInstantSnapshotGroupRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteRegionInstantSnapshotGroupRequest request)deletes a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
DeleteRegionInstantSnapshotGroupRequest request =
DeleteRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.build();
Operation response = regionInstantSnapshotGroupsClient.deleteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteAsync(String project, String region, String instantSnapshotGroup)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String region, String instantSnapshotGroup)deletes a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
Operation response =
regionInstantSnapshotGroupsClient
.deleteAsync(project, region, instantSnapshotGroup)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
instantSnapshotGroup |
StringName of the InstantSnapshotGroup resource to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteCallable()
public final UnaryCallable<DeleteRegionInstantSnapshotGroupRequest,Operation> deleteCallable()deletes a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
DeleteRegionInstantSnapshotGroupRequest request =
DeleteRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
regionInstantSnapshotGroupsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteRegionInstantSnapshotGroupRequest,Operation> |
|
deleteOperationCallable()
public final OperationCallable<DeleteRegionInstantSnapshotGroupRequest,Operation,Operation> deleteOperationCallable()deletes a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
DeleteRegionInstantSnapshotGroupRequest request =
DeleteRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
regionInstantSnapshotGroupsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteRegionInstantSnapshotGroupRequest,Operation,Operation> |
|
get(GetRegionInstantSnapshotGroupRequest request)
public final InstantSnapshotGroup get(GetRegionInstantSnapshotGroupRequest request)returns the specified InstantSnapshotGroup resource in 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
GetRegionInstantSnapshotGroupRequest request =
GetRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRegion("region-934795532")
.build();
InstantSnapshotGroup response = regionInstantSnapshotGroupsClient.get(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroup |
|
get(String project, String region, String instantSnapshotGroup)
public final InstantSnapshotGroup get(String project, String region, String instantSnapshotGroup)returns the specified InstantSnapshotGroup resource in 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
InstantSnapshotGroup response =
regionInstantSnapshotGroupsClient.get(project, region, instantSnapshotGroup);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
instantSnapshotGroup |
StringName of the InstantSnapshotGroup resource to return. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroup |
|
getCallable()
public final UnaryCallable<GetRegionInstantSnapshotGroupRequest,InstantSnapshotGroup> getCallable()returns the specified InstantSnapshotGroup resource in 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
GetRegionInstantSnapshotGroupRequest request =
GetRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRegion("region-934795532")
.build();
ApiFuture<InstantSnapshotGroup> future =
regionInstantSnapshotGroupsClient.getCallable().futureCall(request);
// Do something.
InstantSnapshotGroup response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetRegionInstantSnapshotGroupRequest,InstantSnapshotGroup> |
|
getIamPolicy(GetIamPolicyRegionInstantSnapshotGroupRequest request)
public final Policy getIamPolicy(GetIamPolicyRegionInstantSnapshotGroupRequest 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
GetIamPolicyRegionInstantSnapshotGroupRequest request =
GetIamPolicyRegionInstantSnapshotGroupRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setRegion("region-934795532")
.setResource("resource-341064690")
.build();
Policy response = regionInstantSnapshotGroupsClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetIamPolicyRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
getIamPolicy(String project, String region, String resource)
public final Policy getIamPolicy(String project, String region, String resource)Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String resource = "resource-341064690";
Policy response = regionInstantSnapshotGroupsClient.getIamPolicy(project, region, resource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
resource |
StringName or id of the resource for this request. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRegionInstantSnapshotGroupRequest,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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
GetIamPolicyRegionInstantSnapshotGroupRequest request =
GetIamPolicyRegionInstantSnapshotGroupRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setRegion("region-934795532")
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future =
regionInstantSnapshotGroupsClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetIamPolicyRegionInstantSnapshotGroupRequest,Policy> |
|
getSettings()
public final @Nullable RegionInstantSnapshotGroupsSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.compute.v1.RegionInstantSnapshotGroupsSettings |
|
getStub()
public RegionInstantSnapshotGroupsStub getStub()| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsStub |
|
insertAsync(InsertRegionInstantSnapshotGroupRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertRegionInstantSnapshotGroupRequest request)creates a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
InsertRegionInstantSnapshotGroupRequest request =
InsertRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.build();
Operation response = regionInstantSnapshotGroupsClient.insertAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
InsertRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertAsync(String project, String region, InstantSnapshotGroup instantSnapshotGroupResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, String region, InstantSnapshotGroup instantSnapshotGroupResource)creates a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
InstantSnapshotGroup instantSnapshotGroupResource = InstantSnapshotGroup.newBuilder().build();
Operation response =
regionInstantSnapshotGroupsClient
.insertAsync(project, region, instantSnapshotGroupResource)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringName of the region for this request. |
instantSnapshotGroupResource |
InstantSnapshotGroupThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertCallable()
public final UnaryCallable<InsertRegionInstantSnapshotGroupRequest,Operation> insertCallable()creates a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
InsertRegionInstantSnapshotGroupRequest request =
InsertRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.build();
ApiFuture<Operation> future =
regionInstantSnapshotGroupsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<InsertRegionInstantSnapshotGroupRequest,Operation> |
|
insertOperationCallable()
public final OperationCallable<InsertRegionInstantSnapshotGroupRequest,Operation,Operation> insertOperationCallable()creates a Regional InstantSnapshotGroup 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
InsertRegionInstantSnapshotGroupRequest request =
InsertRegionInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRegion("region-934795532")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.build();
OperationFuture<Operation, Operation> future =
regionInstantSnapshotGroupsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<InsertRegionInstantSnapshotGroupRequest,Operation,Operation> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
list(ListRegionInstantSnapshotGroupsRequest request)
public final RegionInstantSnapshotGroupsClient.ListPagedResponse list(ListRegionInstantSnapshotGroupsRequest request)retrieves the list of InstantSnapshotGroup resources 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
ListRegionInstantSnapshotGroupsRequest request =
ListRegionInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
for (InstantSnapshotGroup element :
regionInstantSnapshotGroupsClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListRegionInstantSnapshotGroupsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsClient.ListPagedResponse |
|
list(String project, String region)
public final RegionInstantSnapshotGroupsClient.ListPagedResponse list(String project, String region)retrieves the list of InstantSnapshotGroup resources 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
for (InstantSnapshotGroup element :
regionInstantSnapshotGroupsClient.list(project, region).iterateAll()) {
// doThingsWith(element);
}
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
| Returns | |
|---|---|
| Type | Description |
RegionInstantSnapshotGroupsClient.ListPagedResponse |
|
listCallable()
public final UnaryCallable<ListRegionInstantSnapshotGroupsRequest,ListInstantSnapshotGroups> listCallable()retrieves the list of InstantSnapshotGroup resources 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
ListRegionInstantSnapshotGroupsRequest request =
ListRegionInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
while (true) {
ListInstantSnapshotGroups response =
regionInstantSnapshotGroupsClient.listCallable().call(request);
for (InstantSnapshotGroup element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRegionInstantSnapshotGroupsRequest,ListInstantSnapshotGroups> |
|
listPagedCallable()
public final UnaryCallable<ListRegionInstantSnapshotGroupsRequest,RegionInstantSnapshotGroupsClient.ListPagedResponse> listPagedCallable()retrieves the list of InstantSnapshotGroup resources 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
ListRegionInstantSnapshotGroupsRequest request =
ListRegionInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setRegion("region-934795532")
.setReturnPartialSuccess(true)
.build();
ApiFuture<InstantSnapshotGroup> future =
regionInstantSnapshotGroupsClient.listPagedCallable().futureCall(request);
// Do something.
for (InstantSnapshotGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRegionInstantSnapshotGroupsRequest,ListPagedResponse> |
|
setIamPolicy(SetIamPolicyRegionInstantSnapshotGroupRequest request)
public final Policy setIamPolicy(SetIamPolicyRegionInstantSnapshotGroupRequest 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
SetIamPolicyRegionInstantSnapshotGroupRequest request =
SetIamPolicyRegionInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRegionSetPolicyRequestResource(RegionSetPolicyRequest.newBuilder().build())
.setResource("resource-341064690")
.build();
Policy response = regionInstantSnapshotGroupsClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
SetIamPolicyRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)
public final Policy setIamPolicy(String project, String region, String resource, RegionSetPolicyRequest regionSetPolicyRequestResource)Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String resource = "resource-341064690";
RegionSetPolicyRequest regionSetPolicyRequestResource =
RegionSetPolicyRequest.newBuilder().build();
Policy response =
regionInstantSnapshotGroupsClient.setIamPolicy(
project, region, resource, regionSetPolicyRequestResource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
resource |
StringName or id of the resource for this request. |
regionSetPolicyRequestResource |
RegionSetPolicyRequestThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyRegionInstantSnapshotGroupRequest,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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
SetIamPolicyRegionInstantSnapshotGroupRequest request =
SetIamPolicyRegionInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setRegionSetPolicyRequestResource(RegionSetPolicyRequest.newBuilder().build())
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future =
regionInstantSnapshotGroupsClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<SetIamPolicyRegionInstantSnapshotGroupRequest,Policy> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()testIamPermissions(TestIamPermissionsRegionInstantSnapshotGroupRequest request)
public final TestPermissionsResponse testIamPermissions(TestIamPermissionsRegionInstantSnapshotGroupRequest 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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
TestIamPermissionsRegionInstantSnapshotGroupRequest request =
TestIamPermissionsRegionInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
TestPermissionsResponse response =
regionInstantSnapshotGroupsClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
TestIamPermissionsRegionInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
TestPermissionsResponse |
|
testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)
public final TestPermissionsResponse testIamPermissions(String project, String region, String resource, TestPermissionsRequest testPermissionsRequestResource)Returns permissions that a caller has on the specified resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String region = "region-934795532";
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
regionInstantSnapshotGroupsClient.testIamPermissions(
project, region, resource, testPermissionsRequestResource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
region |
StringThe name of the region for this request. |
resource |
StringName or id of the resource for this request. |
testPermissionsRequestResource |
TestPermissionsRequestThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
TestPermissionsResponse |
|
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsRegionInstantSnapshotGroupRequest,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 (RegionInstantSnapshotGroupsClient regionInstantSnapshotGroupsClient =
RegionInstantSnapshotGroupsClient.create()) {
TestIamPermissionsRegionInstantSnapshotGroupRequest request =
TestIamPermissionsRegionInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setRegion("region-934795532")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
ApiFuture<TestPermissionsResponse> future =
regionInstantSnapshotGroupsClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<TestIamPermissionsRegionInstantSnapshotGroupRequest,TestPermissionsResponse> |
|