| GitHub Repository | Product Reference |
Service Description: The InstantSnapshotGroups 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
InstantSnapshotGroup response =
instantSnapshotGroupsClient.get(project, zone, instantSnapshotGroup);
}
Note: close() needs to be called on the InstantSnapshotGroupsClient 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 Zonal 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 zone. |
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 |
inserts a Zonal 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 zone. |
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 InstantSnapshotGroupsSettings 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
InstantSnapshotGroupsSettings instantSnapshotGroupsSettings =
InstantSnapshotGroupsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create(instantSnapshotGroupsSettings);
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
InstantSnapshotGroupsSettings instantSnapshotGroupsSettings =
InstantSnapshotGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create(instantSnapshotGroupsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final InstantSnapshotGroupsClient create()Constructs an instance of InstantSnapshotGroupsClient with default settings.
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(InstantSnapshotGroupsSettings settings)
public static final InstantSnapshotGroupsClient create(InstantSnapshotGroupsSettings settings)Constructs an instance of InstantSnapshotGroupsClient, 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 |
InstantSnapshotGroupsSettings |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(InstantSnapshotGroupsStub stub)
public static final InstantSnapshotGroupsClient create(InstantSnapshotGroupsStub stub)Constructs an instance of InstantSnapshotGroupsClient, using the given stub for making calls. This is for advanced usage - prefer using create(InstantSnapshotGroupsSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
InstantSnapshotGroupsStub |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsClient |
|
Constructors
InstantSnapshotGroupsClient(InstantSnapshotGroupsSettings settings)
protected InstantSnapshotGroupsClient(InstantSnapshotGroupsSettings settings)Constructs an instance of InstantSnapshotGroupsClient, 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 |
InstantSnapshotGroupsSettings |
InstantSnapshotGroupsClient(InstantSnapshotGroupsStub stub)
protected InstantSnapshotGroupsClient(InstantSnapshotGroupsStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
InstantSnapshotGroupsStub |
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(DeleteInstantSnapshotGroupRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteInstantSnapshotGroupRequest request)deletes a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
DeleteInstantSnapshotGroupRequest request =
DeleteInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
Operation response = instantSnapshotGroupsClient.deleteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteAsync(String project, String zone, String instantSnapshotGroup)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String zone, String instantSnapshotGroup)deletes a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
Operation response =
instantSnapshotGroupsClient.deleteAsync(project, zone, instantSnapshotGroup).get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone for this request. |
instantSnapshotGroup |
StringName of the InstantSnapshot resource to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteCallable()
public final UnaryCallable<DeleteInstantSnapshotGroupRequest,Operation> deleteCallable()deletes a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
DeleteInstantSnapshotGroupRequest request =
DeleteInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instantSnapshotGroupsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteInstantSnapshotGroupRequest,Operation> |
|
deleteOperationCallable()
public final OperationCallable<DeleteInstantSnapshotGroupRequest,Operation,Operation> deleteOperationCallable()deletes a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
DeleteInstantSnapshotGroupRequest request =
DeleteInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instantSnapshotGroupsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteInstantSnapshotGroupRequest,Operation,Operation> |
|
get(GetInstantSnapshotGroupRequest request)
public final InstantSnapshotGroup get(GetInstantSnapshotGroupRequest request)returns the specified InstantSnapshotGroup resource in the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
GetInstantSnapshotGroupRequest request =
GetInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
InstantSnapshotGroup response = instantSnapshotGroupsClient.get(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroup |
|
get(String project, String zone, String instantSnapshotGroup)
public final InstantSnapshotGroup get(String project, String zone, String instantSnapshotGroup)returns the specified InstantSnapshotGroup resource in the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String instantSnapshotGroup = "instantSnapshotGroup500796090";
InstantSnapshotGroup response =
instantSnapshotGroupsClient.get(project, zone, instantSnapshotGroup);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone for this request. |
instantSnapshotGroup |
StringName of the InstantSnapshotGroup resource to return. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroup |
|
getCallable()
public final UnaryCallable<GetInstantSnapshotGroupRequest,InstantSnapshotGroup> getCallable()returns the specified InstantSnapshotGroup resource in the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
GetInstantSnapshotGroupRequest request =
GetInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroup("instantSnapshotGroup500796090")
.setProject("project-309310695")
.setZone("zone3744684")
.build();
ApiFuture<InstantSnapshotGroup> future =
instantSnapshotGroupsClient.getCallable().futureCall(request);
// Do something.
InstantSnapshotGroup response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetInstantSnapshotGroupRequest,InstantSnapshotGroup> |
|
getIamPolicy(GetIamPolicyInstantSnapshotGroupRequest request)
public final Policy getIamPolicy(GetIamPolicyInstantSnapshotGroupRequest 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
GetIamPolicyInstantSnapshotGroupRequest request =
GetIamPolicyInstantSnapshotGroupRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
Policy response = instantSnapshotGroupsClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetIamPolicyInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
getIamPolicy(String project, String zone, String resource)
public final Policy getIamPolicy(String project, String zone, 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
Policy response = instantSnapshotGroupsClient.getIamPolicy(project, zone, resource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone for this request. |
resource |
StringName or id of the resource for this request. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyInstantSnapshotGroupRequest,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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
GetIamPolicyInstantSnapshotGroupRequest request =
GetIamPolicyInstantSnapshotGroupRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.build();
ApiFuture<Policy> future =
instantSnapshotGroupsClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetIamPolicyInstantSnapshotGroupRequest,Policy> |
|
getSettings()
public final @Nullable InstantSnapshotGroupsSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.compute.v1.InstantSnapshotGroupsSettings |
|
getStub()
public InstantSnapshotGroupsStub getStub()| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsStub |
|
insertAsync(InsertInstantSnapshotGroupRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertInstantSnapshotGroupRequest request)inserts a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
InsertInstantSnapshotGroupRequest request =
InsertInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.setZone("zone3744684")
.build();
Operation response = instantSnapshotGroupsClient.insertAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
InsertInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertAsync(String project, String zone, InstantSnapshotGroup instantSnapshotGroupResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, String zone, InstantSnapshotGroup instantSnapshotGroupResource)inserts a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
InstantSnapshotGroup instantSnapshotGroupResource = InstantSnapshotGroup.newBuilder().build();
Operation response =
instantSnapshotGroupsClient
.insertAsync(project, zone, instantSnapshotGroupResource)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringName of the zone for this request. |
instantSnapshotGroupResource |
InstantSnapshotGroupThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertCallable()
public final UnaryCallable<InsertInstantSnapshotGroupRequest,Operation> insertCallable()inserts a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
InsertInstantSnapshotGroupRequest request =
InsertInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.setZone("zone3744684")
.build();
ApiFuture<Operation> future =
instantSnapshotGroupsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<InsertInstantSnapshotGroupRequest,Operation> |
|
insertOperationCallable()
public final OperationCallable<InsertInstantSnapshotGroupRequest,Operation,Operation> insertOperationCallable()inserts a Zonal 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
InsertInstantSnapshotGroupRequest request =
InsertInstantSnapshotGroupRequest.newBuilder()
.setInstantSnapshotGroupResource(InstantSnapshotGroup.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceConsistencyGroup("sourceConsistencyGroup-2056893054")
.setZone("zone3744684")
.build();
OperationFuture<Operation, Operation> future =
instantSnapshotGroupsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<InsertInstantSnapshotGroupRequest,Operation,Operation> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
list(ListInstantSnapshotGroupsRequest request)
public final InstantSnapshotGroupsClient.ListPagedResponse list(ListInstantSnapshotGroupsRequest request)retrieves the list of InstantSnapshotGroup resources contained within the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
ListInstantSnapshotGroupsRequest request =
ListInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
for (InstantSnapshotGroup element : instantSnapshotGroupsClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListInstantSnapshotGroupsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsClient.ListPagedResponse |
|
list(String project, String zone)
public final InstantSnapshotGroupsClient.ListPagedResponse list(String project, String zone)retrieves the list of InstantSnapshotGroup resources contained within the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
for (InstantSnapshotGroup element :
instantSnapshotGroupsClient.list(project, zone).iterateAll()) {
// doThingsWith(element);
}
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone for this request. |
| Returns | |
|---|---|
| Type | Description |
InstantSnapshotGroupsClient.ListPagedResponse |
|
listCallable()
public final UnaryCallable<ListInstantSnapshotGroupsRequest,ListInstantSnapshotGroups> listCallable()retrieves the list of InstantSnapshotGroup resources contained within the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
ListInstantSnapshotGroupsRequest request =
ListInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
while (true) {
ListInstantSnapshotGroups response =
instantSnapshotGroupsClient.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<ListInstantSnapshotGroupsRequest,ListInstantSnapshotGroups> |
|
listPagedCallable()
public final UnaryCallable<ListInstantSnapshotGroupsRequest,InstantSnapshotGroupsClient.ListPagedResponse> listPagedCallable()retrieves the list of InstantSnapshotGroup resources contained within the specified zone.
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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
ListInstantSnapshotGroupsRequest request =
ListInstantSnapshotGroupsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setZone("zone3744684")
.build();
ApiFuture<InstantSnapshotGroup> future =
instantSnapshotGroupsClient.listPagedCallable().futureCall(request);
// Do something.
for (InstantSnapshotGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListInstantSnapshotGroupsRequest,ListPagedResponse> |
|
setIamPolicy(SetIamPolicyInstantSnapshotGroupRequest request)
public final Policy setIamPolicy(SetIamPolicyInstantSnapshotGroupRequest 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
SetIamPolicyInstantSnapshotGroupRequest request =
SetIamPolicyInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
.build();
Policy response = instantSnapshotGroupsClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
SetIamPolicyInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
setIamPolicy(String project, String zone, String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)
public final Policy setIamPolicy(String project, String zone, String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
Policy response =
instantSnapshotGroupsClient.setIamPolicy(
project, zone, resource, zoneSetPolicyRequestResource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone for this request. |
resource |
StringName or id of the resource for this request. |
zoneSetPolicyRequestResource |
ZoneSetPolicyRequestThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
Policy |
|
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyInstantSnapshotGroupRequest,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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
SetIamPolicyInstantSnapshotGroupRequest request =
SetIamPolicyInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setZone("zone3744684")
.setZoneSetPolicyRequestResource(ZoneSetPolicyRequest.newBuilder().build())
.build();
ApiFuture<Policy> future =
instantSnapshotGroupsClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<SetIamPolicyInstantSnapshotGroupRequest,Policy> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()testIamPermissions(TestIamPermissionsInstantSnapshotGroupRequest request)
public final TestPermissionsResponse testIamPermissions(TestIamPermissionsInstantSnapshotGroupRequest 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
TestIamPermissionsInstantSnapshotGroupRequest request =
TestIamPermissionsInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
TestPermissionsResponse response = instantSnapshotGroupsClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
TestIamPermissionsInstantSnapshotGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
TestPermissionsResponse |
|
testIamPermissions(String project, String zone, String resource, TestPermissionsRequest testPermissionsRequestResource)
public final TestPermissionsResponse testIamPermissions(String project, String zone, 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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
String project = "project-309310695";
String zone = "zone3744684";
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
instantSnapshotGroupsClient.testIamPermissions(
project, zone, resource, testPermissionsRequestResource);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
zone |
StringThe name of the zone 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<TestIamPermissionsInstantSnapshotGroupRequest,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 (InstantSnapshotGroupsClient instantSnapshotGroupsClient =
InstantSnapshotGroupsClient.create()) {
TestIamPermissionsInstantSnapshotGroupRequest request =
TestIamPermissionsInstantSnapshotGroupRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.setZone("zone3744684")
.build();
ApiFuture<TestPermissionsResponse> future =
instantSnapshotGroupsClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<TestIamPermissionsInstantSnapshotGroupRequest,TestPermissionsResponse> |
|