Class InstantSnapshotGroupsClient (1.105.0)

GitHub RepositoryProduct 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().

Methods
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.

  • deleteAsync(DeleteInstantSnapshotGroupRequest request)

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

  • deleteAsync(String project, String zone, String instantSnapshotGroup)

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

  • deleteOperationCallable()

  • deleteCallable()

Get

returns 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.

  • get(GetInstantSnapshotGroupRequest request)

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

  • get(String project, String zone, String instantSnapshotGroup)

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

  • getCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyInstantSnapshotGroupRequest request)

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

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

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

  • getIamPolicyCallable()

Insert

inserts a Zonal InstantSnapshotGroup resource

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

  • insertAsync(InsertInstantSnapshotGroupRequest request)

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

  • insertAsync(String project, String zone, InstantSnapshotGroup instantSnapshotGroupResource)

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

  • insertOperationCallable()

  • insertCallable()

List

retrieves the list of 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.

  • list(ListInstantSnapshotGroupsRequest request)

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

  • list(String project, String zone)

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

  • listPagedCallable()

  • listCallable()

SetIamPolicy

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

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

  • setIamPolicy(SetIamPolicyInstantSnapshotGroupRequest request)

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

  • setIamPolicy(String project, String zone, String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)

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

  • setIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource.

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

  • testIamPermissions(TestIamPermissionsInstantSnapshotGroupRequest request)

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

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

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

  • testIamPermissionsCallable()

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.

Inheritance

java.lang.Object > InstantSnapshotGroupsClient

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 DeleteInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

The name of the zone for this request.

instantSnapshotGroup String

Name 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 GetInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

The name of the zone for this request.

instantSnapshotGroup String

Name 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 GetIamPolicyInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

The name of the zone for this request.

resource String

Name 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 InsertInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

Name of the zone for this request.

instantSnapshotGroupResource InstantSnapshotGroup

The 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 ListInstantSnapshotGroupsRequest

The 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 String

Project ID for this request.

zone String

The 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 SetIamPolicyInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

The name of the zone for this request.

resource String

Name or id of the resource for this request.

zoneSetPolicyRequestResource ZoneSetPolicyRequest

The 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 TestIamPermissionsInstantSnapshotGroupRequest

The 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 String

Project ID for this request.

zone String

The name of the zone for this request.

resource String

Name or id of the resource for this request.

testPermissionsRequestResource TestPermissionsRequest

The body resource for this request

Returns
Type Description
TestPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<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>