Class AlloyDBAdminClient (0.11.0)

public class AlloyDBAdminClient implements BackgroundResource

Service Description: Service describing handlers for resources

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   Cluster response = alloyDBAdminClient.getCluster(name);
 }
 

Note: close() needs to be called on the AlloyDBAdminClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of AlloyDBAdminSettings 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
 AlloyDBAdminSettings alloyDBAdminSettings =
     AlloyDBAdminSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
 

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
 AlloyDBAdminSettings alloyDBAdminSettings =
     AlloyDBAdminSettings.newBuilder().setEndpoint(myEndpoint).build();
 AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // 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
 AlloyDBAdminSettings alloyDBAdminSettings = AlloyDBAdminSettings.newHttpJsonBuilder().build();
 AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create(alloyDBAdminSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > AlloyDBAdminClient

Implements

BackgroundResource

Static Methods

create()

public static final AlloyDBAdminClient create()

Constructs an instance of AlloyDBAdminClient with default settings.

Returns
Type Description
AlloyDBAdminClient
Exceptions
Type Description
IOException

create(AlloyDBAdminSettings settings)

public static final AlloyDBAdminClient create(AlloyDBAdminSettings settings)

Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminSettings
Returns
Type Description
AlloyDBAdminClient
Exceptions
Type Description
IOException

create(AlloyDBAdminStub stub)

public static final AlloyDBAdminClient create(AlloyDBAdminStub stub)

Constructs an instance of AlloyDBAdminClient, using the given stub for making calls. This is for advanced usage - prefer using create(AlloyDBAdminSettings).

Parameter
Name Description
stub AlloyDBAdminStub
Returns
Type Description
AlloyDBAdminClient

Constructors

AlloyDBAdminClient(AlloyDBAdminSettings settings)

protected AlloyDBAdminClient(AlloyDBAdminSettings settings)

Constructs an instance of AlloyDBAdminClient, 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 AlloyDBAdminSettings

AlloyDBAdminClient(AlloyDBAdminStub stub)

protected AlloyDBAdminClient(AlloyDBAdminStub stub)
Parameter
Name Description
stub AlloyDBAdminStub

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

batchCreateInstancesAsync(BatchCreateInstancesRequest request)

public final OperationFuture<BatchCreateInstancesResponse,OperationMetadata> batchCreateInstancesAsync(BatchCreateInstancesRequest request)

Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   BatchCreateInstancesRequest request =
       BatchCreateInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequests(CreateInstanceRequests.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   BatchCreateInstancesResponse response =
       alloyDBAdminClient.batchCreateInstancesAsync(request).get();
 }
 
Parameter
Name Description
request BatchCreateInstancesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<BatchCreateInstancesResponse,OperationMetadata>

batchCreateInstancesCallable()

public final UnaryCallable<BatchCreateInstancesRequest,Operation> batchCreateInstancesCallable()

Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   BatchCreateInstancesRequest request =
       BatchCreateInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequests(CreateInstanceRequests.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       alloyDBAdminClient.batchCreateInstancesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateInstancesRequest,Operation>

batchCreateInstancesOperationCallable()

public final OperationCallable<BatchCreateInstancesRequest,BatchCreateInstancesResponse,OperationMetadata> batchCreateInstancesOperationCallable()

Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   BatchCreateInstancesRequest request =
       BatchCreateInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequests(CreateInstanceRequests.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<BatchCreateInstancesResponse, OperationMetadata> future =
       alloyDBAdminClient.batchCreateInstancesOperationCallable().futureCall(request);
   // Do something.
   BatchCreateInstancesResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<BatchCreateInstancesRequest,BatchCreateInstancesResponse,OperationMetadata>

close()

public final void close()

createBackupAsync(CreateBackupRequest request)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(CreateBackupRequest request)

Creates a new Backup in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateBackupRequest request =
       CreateBackupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBackupId("backupId2121930365")
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Backup response = alloyDBAdminClient.createBackupAsync(request).get();
 }
 
Parameter
Name Description
request CreateBackupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Backup,OperationMetadata>

createBackupAsync(LocationName parent, Backup backup, String backupId)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(LocationName parent, Backup backup, String backupId)

Creates a new Backup in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Backup backup = Backup.newBuilder().build();
   String backupId = "backupId2121930365";
   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. Value for parent.

backup Backup

Required. The resource being created

backupId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Backup,OperationMetadata>

createBackupAsync(String parent, Backup backup, String backupId)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(String parent, Backup backup, String backupId)

Creates a new Backup in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Backup backup = Backup.newBuilder().build();
   String backupId = "backupId2121930365";
   Backup response = alloyDBAdminClient.createBackupAsync(parent, backup, backupId).get();
 }
 
Parameters
Name Description
parent String

Required. Value for parent.

backup Backup

Required. The resource being created

backupId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Backup,OperationMetadata>

createBackupCallable()

public final UnaryCallable<CreateBackupRequest,Operation> createBackupCallable()

Creates a new Backup in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateBackupRequest request =
       CreateBackupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBackupId("backupId2121930365")
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.createBackupCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateBackupRequest,Operation>

createBackupOperationCallable()

public final OperationCallable<CreateBackupRequest,Backup,OperationMetadata> createBackupOperationCallable()

Creates a new Backup in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateBackupRequest request =
       CreateBackupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBackupId("backupId2121930365")
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Backup, OperationMetadata> future =
       alloyDBAdminClient.createBackupOperationCallable().futureCall(request);
   // Do something.
   Backup response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateBackupRequest,Backup,OperationMetadata>

createClusterAsync(CreateClusterRequest request)

public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(CreateClusterRequest request)

Creates a new Cluster in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Cluster response = alloyDBAdminClient.createClusterAsync(request).get();
 }
 
Parameter
Name Description
request CreateClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createClusterAsync(LocationName parent, Cluster cluster, String clusterId)

public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(LocationName parent, Cluster cluster, String clusterId)

Creates a new Cluster in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Cluster cluster = Cluster.newBuilder().build();
   String clusterId = "clusterId561939637";
   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.

cluster Cluster

Required. The resource being created

clusterId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createClusterAsync(String parent, Cluster cluster, String clusterId)

public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(String parent, Cluster cluster, String clusterId)

Creates a new Cluster in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Cluster cluster = Cluster.newBuilder().build();
   String clusterId = "clusterId561939637";
   Cluster response = alloyDBAdminClient.createClusterAsync(parent, cluster, clusterId).get();
 }
 
Parameters
Name Description
parent String

Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.

cluster Cluster

Required. The resource being created

clusterId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createClusterCallable()

public final UnaryCallable<CreateClusterRequest,Operation> createClusterCallable()

Creates a new Cluster in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.createClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateClusterRequest,Operation>

createClusterOperationCallable()

public final OperationCallable<CreateClusterRequest,Cluster,OperationMetadata> createClusterOperationCallable()

Creates a new Cluster in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateClusterRequest request =
       CreateClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Cluster, OperationMetadata> future =
       alloyDBAdminClient.createClusterOperationCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateClusterRequest,Cluster,OperationMetadata>

createInstanceAsync(ClusterName parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(ClusterName parent, Instance instance, String instanceId)

Creates a new Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   Instance instance = Instance.newBuilder().build();
   String instanceId = "instanceId902024336";
   Instance response =
       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
 }
 
Parameters
Name Description
parent ClusterName

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.

instance Instance

Required. The resource being created

instanceId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createInstanceAsync(CreateInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request)

Creates a new Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateInstanceRequest request =
       CreateInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Instance response = alloyDBAdminClient.createInstanceAsync(request).get();
 }
 
Parameter
Name Description
request CreateInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createInstanceAsync(String parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId)

Creates a new Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   Instance instance = Instance.newBuilder().build();
   String instanceId = "instanceId902024336";
   Instance response =
       alloyDBAdminClient.createInstanceAsync(parent, instance, instanceId).get();
 }
 
Parameters
Name Description
parent String

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.

instance Instance

Required. The resource being created

instanceId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createInstanceCallable()

public final UnaryCallable<CreateInstanceRequest,Operation> createInstanceCallable()

Creates a new Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateInstanceRequest request =
       CreateInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.createInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateInstanceRequest,Operation>

createInstanceOperationCallable()

public final OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> createInstanceOperationCallable()

Creates a new Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateInstanceRequest request =
       CreateInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.createInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateInstanceRequest,Instance,OperationMetadata>

createSecondaryClusterAsync(CreateSecondaryClusterRequest request)

public final OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(CreateSecondaryClusterRequest request)

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryClusterRequest request =
       CreateSecondaryClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Cluster response = alloyDBAdminClient.createSecondaryClusterAsync(request).get();
 }
 
Parameter
Name Description
request CreateSecondaryClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createSecondaryClusterAsync(LocationName parent, Cluster cluster, String clusterId)

public final OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(LocationName parent, Cluster cluster, String clusterId)

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Cluster cluster = Cluster.newBuilder().build();
   String clusterId = "clusterId561939637";
   Cluster response =
       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.

cluster Cluster

Required. Configuration of the requesting object (the secondary cluster).

clusterId String

Required. ID of the requesting object (the secondary cluster).

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createSecondaryClusterAsync(String parent, Cluster cluster, String clusterId)

public final OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(String parent, Cluster cluster, String clusterId)

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Cluster cluster = Cluster.newBuilder().build();
   String clusterId = "clusterId561939637";
   Cluster response =
       alloyDBAdminClient.createSecondaryClusterAsync(parent, cluster, clusterId).get();
 }
 
Parameters
Name Description
parent String

Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.

cluster Cluster

Required. Configuration of the requesting object (the secondary cluster).

clusterId String

Required. ID of the requesting object (the secondary cluster).

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

createSecondaryClusterCallable()

public final UnaryCallable<CreateSecondaryClusterRequest,Operation> createSecondaryClusterCallable()

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryClusterRequest request =
       CreateSecondaryClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future =
       alloyDBAdminClient.createSecondaryClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateSecondaryClusterRequest,Operation>

createSecondaryClusterOperationCallable()

public final OperationCallable<CreateSecondaryClusterRequest,Cluster,OperationMetadata> createSecondaryClusterOperationCallable()

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryClusterRequest request =
       CreateSecondaryClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Cluster, OperationMetadata> future =
       alloyDBAdminClient.createSecondaryClusterOperationCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateSecondaryClusterRequest,Cluster,OperationMetadata>

createSecondaryInstanceAsync(ClusterName parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(ClusterName parent, Instance instance, String instanceId)

Creates a new SECONDARY Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   Instance instance = Instance.newBuilder().build();
   String instanceId = "instanceId902024336";
   Instance response =
       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
 }
 
Parameters
Name Description
parent ClusterName

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.

instance Instance

Required. The resource being created

instanceId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createSecondaryInstanceAsync(CreateSecondaryInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(CreateSecondaryInstanceRequest request)

Creates a new SECONDARY Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryInstanceRequest request =
       CreateSecondaryInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Instance response = alloyDBAdminClient.createSecondaryInstanceAsync(request).get();
 }
 
Parameter
Name Description
request CreateSecondaryInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createSecondaryInstanceAsync(String parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(String parent, Instance instance, String instanceId)

Creates a new SECONDARY Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   Instance instance = Instance.newBuilder().build();
   String instanceId = "instanceId902024336";
   Instance response =
       alloyDBAdminClient.createSecondaryInstanceAsync(parent, instance, instanceId).get();
 }
 
Parameters
Name Description
parent String

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.

instance Instance

Required. The resource being created

instanceId String

Required. ID of the requesting object.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

createSecondaryInstanceCallable()

public final UnaryCallable<CreateSecondaryInstanceRequest,Operation> createSecondaryInstanceCallable()

Creates a new SECONDARY Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryInstanceRequest request =
       CreateSecondaryInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future =
       alloyDBAdminClient.createSecondaryInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateSecondaryInstanceRequest,Operation>

createSecondaryInstanceOperationCallable()

public final OperationCallable<CreateSecondaryInstanceRequest,Instance,OperationMetadata> createSecondaryInstanceOperationCallable()

Creates a new SECONDARY Instance in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateSecondaryInstanceRequest request =
       CreateSecondaryInstanceRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setInstanceId("instanceId902024336")
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.createSecondaryInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateSecondaryInstanceRequest,Instance,OperationMetadata>

createUser(ClusterName parent, User user, String userId)

public final User createUser(ClusterName parent, User user, String userId)

Creates a new User in a given project, location, and cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   User user = User.newBuilder().build();
   String userId = "userId-836030906";
   User response = alloyDBAdminClient.createUser(parent, user, userId);
 }
 
Parameters
Name Description
parent ClusterName

Required. Value for parent.

user User

Required. The resource being created

userId String

Required. ID of the requesting object.

Returns
Type Description
User

createUser(CreateUserRequest request)

public final User createUser(CreateUserRequest request)

Creates a new User in a given project, location, and cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateUserRequest request =
       CreateUserRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setUserId("userId-836030906")
           .setUser(User.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   User response = alloyDBAdminClient.createUser(request);
 }
 
Parameter
Name Description
request CreateUserRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
User

createUser(String parent, User user, String userId)

public final User createUser(String parent, User user, String userId)

Creates a new User in a given project, location, and cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   User user = User.newBuilder().build();
   String userId = "userId-836030906";
   User response = alloyDBAdminClient.createUser(parent, user, userId);
 }
 
Parameters
Name Description
parent String

Required. Value for parent.

user User

Required. The resource being created

userId String

Required. ID of the requesting object.

Returns
Type Description
User

createUserCallable()

public final UnaryCallable<CreateUserRequest,User> createUserCallable()

Creates a new User in a given project, location, and cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   CreateUserRequest request =
       CreateUserRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setUserId("userId-836030906")
           .setUser(User.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<User> future = alloyDBAdminClient.createUserCallable().futureCall(request);
   // Do something.
   User response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateUserRequest,User>

deleteBackupAsync(BackupName name)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(BackupName name)

Deletes a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
   alloyDBAdminClient.deleteBackupAsync(name).get();
 }
 
Parameter
Name Description
name BackupName

Required. Name of the resource. For the required format, see the comment on the Backup.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteBackupAsync(DeleteBackupRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request)

Deletes a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteBackupRequest request =
       DeleteBackupRequest.newBuilder()
           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setEtag("etag3123477")
           .build();
   alloyDBAdminClient.deleteBackupAsync(request).get();
 }
 
Parameter
Name Description
request DeleteBackupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteBackupAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(String name)

Deletes a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
   alloyDBAdminClient.deleteBackupAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. Name of the resource. For the required format, see the comment on the Backup.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteBackupCallable()

public final UnaryCallable<DeleteBackupRequest,Operation> deleteBackupCallable()

Deletes a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteBackupRequest request =
       DeleteBackupRequest.newBuilder()
           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setEtag("etag3123477")
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.deleteBackupCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteBackupRequest,Operation>

deleteBackupOperationCallable()

public final OperationCallable<DeleteBackupRequest,Empty,OperationMetadata> deleteBackupOperationCallable()

Deletes a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteBackupRequest request =
       DeleteBackupRequest.newBuilder()
           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setEtag("etag3123477")
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       alloyDBAdminClient.deleteBackupOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteBackupRequest,Empty,OperationMetadata>

deleteClusterAsync(ClusterName name)

public final OperationFuture<Empty,OperationMetadata> deleteClusterAsync(ClusterName name)

Deletes a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   alloyDBAdminClient.deleteClusterAsync(name).get();
 }
 
Parameter
Name Description
name ClusterName

Required. The name of the resource. For the required format, see the comment on the Cluster.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteClusterAsync(DeleteClusterRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteClusterAsync(DeleteClusterRequest request)

Deletes a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .setForce(true)
           .build();
   alloyDBAdminClient.deleteClusterAsync(request).get();
 }
 
Parameter
Name Description
request DeleteClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteClusterAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteClusterAsync(String name)

Deletes a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   alloyDBAdminClient.deleteClusterAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Cluster.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteClusterCallable()

public final UnaryCallable<DeleteClusterRequest,Operation> deleteClusterCallable()

Deletes a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .setForce(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.deleteClusterCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteClusterRequest,Operation>

deleteClusterOperationCallable()

public final OperationCallable<DeleteClusterRequest,Empty,OperationMetadata> deleteClusterOperationCallable()

Deletes a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteClusterRequest request =
       DeleteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .setForce(true)
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       alloyDBAdminClient.deleteClusterOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteClusterRequest,Empty,OperationMetadata>

deleteInstanceAsync(DeleteInstanceRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request)

Deletes a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   alloyDBAdminClient.deleteInstanceAsync(request).get();
 }
 
Parameter
Name Description
request DeleteInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInstanceAsync(InstanceName name)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(InstanceName name)

Deletes a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   alloyDBAdminClient.deleteInstanceAsync(name).get();
 }
 
Parameter
Name Description
name InstanceName

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInstanceAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(String name)

Deletes a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   alloyDBAdminClient.deleteInstanceAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInstanceCallable()

public final UnaryCallable<DeleteInstanceRequest,Operation> deleteInstanceCallable()

Deletes a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.deleteInstanceCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteInstanceRequest,Operation>

deleteInstanceOperationCallable()

public final OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata> deleteInstanceOperationCallable()

Deletes a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       alloyDBAdminClient.deleteInstanceOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata>

deleteUser(DeleteUserRequest request)

public final void deleteUser(DeleteUserRequest request)

Deletes a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteUserRequest request =
       DeleteUserRequest.newBuilder()
           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   alloyDBAdminClient.deleteUser(request);
 }
 
Parameter
Name Description
request DeleteUserRequest

The request object containing all of the parameters for the API call.

deleteUser(UserName name)

public final void deleteUser(UserName name)

Deletes a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]");
   alloyDBAdminClient.deleteUser(name);
 }
 
Parameter
Name Description
name UserName

Required. The name of the resource. For the required format, see the comment on the User.name field.

deleteUser(String name)

public final void deleteUser(String name)

Deletes a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString();
   alloyDBAdminClient.deleteUser(name);
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the User.name field.

deleteUserCallable()

public final UnaryCallable<DeleteUserRequest,Empty> deleteUserCallable()

Deletes a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   DeleteUserRequest request =
       DeleteUserRequest.newBuilder()
           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Empty> future = alloyDBAdminClient.deleteUserCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteUserRequest,Empty>

failoverInstanceAsync(FailoverInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(FailoverInstanceRequest request)

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   FailoverInstanceRequest request =
       FailoverInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Instance response = alloyDBAdminClient.failoverInstanceAsync(request).get();
 }
 
Parameter
Name Description
request FailoverInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

failoverInstanceAsync(InstanceName name)

public final OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(InstanceName name)

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
 }
 
Parameter
Name Description
name InstanceName

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

failoverInstanceAsync(String name)

public final OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(String name)

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   Instance response = alloyDBAdminClient.failoverInstanceAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

failoverInstanceCallable()

public final UnaryCallable<FailoverInstanceRequest,Operation> failoverInstanceCallable()

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   FailoverInstanceRequest request =
       FailoverInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future =
       alloyDBAdminClient.failoverInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<FailoverInstanceRequest,Operation>

failoverInstanceOperationCallable()

public final OperationCallable<FailoverInstanceRequest,Instance,OperationMetadata> failoverInstanceOperationCallable()

Forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   FailoverInstanceRequest request =
       FailoverInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.failoverInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<FailoverInstanceRequest,Instance,OperationMetadata>

generateClientCertificate(ClusterName parent)

public final GenerateClientCertificateResponse generateClientCertificate(ClusterName parent)

Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support the Auth Proxy client and the endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy client.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   GenerateClientCertificateResponse response =
       alloyDBAdminClient.generateClientCertificate(parent);
 }
 
Parameter
Name Description
parent ClusterName

Required. The name of the parent resource. The required format is: * projects/{project}/locations/{location}/clusters/{cluster}

Returns
Type Description
GenerateClientCertificateResponse

generateClientCertificate(GenerateClientCertificateRequest request)

public final GenerateClientCertificateResponse generateClientCertificate(GenerateClientCertificateRequest request)

Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support the Auth Proxy client and the endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy client.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GenerateClientCertificateRequest request =
       GenerateClientCertificateRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setPemCsr("pemCsr-991911478")
           .setCertDuration(Duration.newBuilder().build())
           .setPublicKey("publicKey1446899510")
           .build();
   GenerateClientCertificateResponse response =
       alloyDBAdminClient.generateClientCertificate(request);
 }
 
Parameter
Name Description
request GenerateClientCertificateRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
GenerateClientCertificateResponse

generateClientCertificate(String parent)

public final GenerateClientCertificateResponse generateClientCertificate(String parent)

Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support the Auth Proxy client and the endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy client.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   GenerateClientCertificateResponse response =
       alloyDBAdminClient.generateClientCertificate(parent);
 }
 
Parameter
Name Description
parent String

Required. The name of the parent resource. The required format is: * projects/{project}/locations/{location}/clusters/{cluster}

Returns
Type Description
GenerateClientCertificateResponse

generateClientCertificateCallable()

public final UnaryCallable<GenerateClientCertificateRequest,GenerateClientCertificateResponse> generateClientCertificateCallable()

Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support the Auth Proxy client and the endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy client.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GenerateClientCertificateRequest request =
       GenerateClientCertificateRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setPemCsr("pemCsr-991911478")
           .setCertDuration(Duration.newBuilder().build())
           .setPublicKey("publicKey1446899510")
           .build();
   ApiFuture<GenerateClientCertificateResponse> future =
       alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
   // Do something.
   GenerateClientCertificateResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GenerateClientCertificateRequest,GenerateClientCertificateResponse>

getBackup(BackupName name)

public final Backup getBackup(BackupName name)

Gets details of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   BackupName name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]");
   Backup response = alloyDBAdminClient.getBackup(name);
 }
 
Parameter
Name Description
name BackupName

Required. Name of the resource

Returns
Type Description
Backup

getBackup(GetBackupRequest request)

public final Backup getBackup(GetBackupRequest request)

Gets details of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetBackupRequest request =
       GetBackupRequest.newBuilder()
           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
           .build();
   Backup response = alloyDBAdminClient.getBackup(request);
 }
 
Parameter
Name Description
request GetBackupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Backup

getBackup(String name)

public final Backup getBackup(String name)

Gets details of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString();
   Backup response = alloyDBAdminClient.getBackup(name);
 }
 
Parameter
Name Description
name String

Required. Name of the resource

Returns
Type Description
Backup

getBackupCallable()

public final UnaryCallable<GetBackupRequest,Backup> getBackupCallable()

Gets details of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetBackupRequest request =
       GetBackupRequest.newBuilder()
           .setName(BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUP]").toString())
           .build();
   ApiFuture<Backup> future = alloyDBAdminClient.getBackupCallable().futureCall(request);
   // Do something.
   Backup response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetBackupRequest,Backup>

getCluster(ClusterName name)

public final Cluster getCluster(ClusterName name)

Gets details of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   Cluster response = alloyDBAdminClient.getCluster(name);
 }
 
Parameter
Name Description
name ClusterName

Required. The name of the resource. For the required format, see the comment on the Cluster.name field.

Returns
Type Description
Cluster

getCluster(GetClusterRequest request)

public final Cluster getCluster(GetClusterRequest request)

Gets details of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setView(ClusterView.forNumber(0))
           .build();
   Cluster response = alloyDBAdminClient.getCluster(request);
 }
 
Parameter
Name Description
request GetClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Cluster

getCluster(String name)

public final Cluster getCluster(String name)

Gets details of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   Cluster response = alloyDBAdminClient.getCluster(name);
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Cluster.name field.

Returns
Type Description
Cluster

getClusterCallable()

public final UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()

Gets details of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetClusterRequest request =
       GetClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setView(ClusterView.forNumber(0))
           .build();
   ApiFuture<Cluster> future = alloyDBAdminClient.getClusterCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetClusterRequest,Cluster>

getConnectionInfo(GetConnectionInfoRequest request)

public final ConnectionInfo getConnectionInfo(GetConnectionInfoRequest request)

Get instance metadata used for a connection.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetConnectionInfoRequest request =
       GetConnectionInfoRequest.newBuilder()
           .setParent(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .build();
   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(request);
 }
 
Parameter
Name Description
request GetConnectionInfoRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ConnectionInfo

getConnectionInfo(InstanceName parent)

public final ConnectionInfo getConnectionInfo(InstanceName parent)

Get instance metadata used for a connection.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
 }
 
Parameter
Name Description
parent InstanceName

Required. The name of the parent resource. The required format is: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}

Returns
Type Description
ConnectionInfo

getConnectionInfo(String parent)

public final ConnectionInfo getConnectionInfo(String parent)

Get instance metadata used for a connection.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   ConnectionInfo response = alloyDBAdminClient.getConnectionInfo(parent);
 }
 
Parameter
Name Description
parent String

Required. The name of the parent resource. The required format is: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}

Returns
Type Description
ConnectionInfo

getConnectionInfoCallable()

public final UnaryCallable<GetConnectionInfoRequest,ConnectionInfo> getConnectionInfoCallable()

Get instance metadata used for a connection.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetConnectionInfoRequest request =
       GetConnectionInfoRequest.newBuilder()
           .setParent(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<ConnectionInfo> future =
       alloyDBAdminClient.getConnectionInfoCallable().futureCall(request);
   // Do something.
   ConnectionInfo response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetConnectionInfoRequest,ConnectionInfo>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getInstance(GetInstanceRequest request)

public final Instance getInstance(GetInstanceRequest request)

Gets details of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setView(InstanceView.forNumber(0))
           .build();
   Instance response = alloyDBAdminClient.getInstance(request);
 }
 
Parameter
Name Description
request GetInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Instance

getInstance(InstanceName name)

public final Instance getInstance(InstanceName name)

Gets details of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   Instance response = alloyDBAdminClient.getInstance(name);
 }
 
Parameter
Name Description
name InstanceName

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
Instance

getInstance(String name)

public final Instance getInstance(String name)

Gets details of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   Instance response = alloyDBAdminClient.getInstance(name);
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
Instance

getInstanceCallable()

public final UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()

Gets details of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setView(InstanceView.forNumber(0))
           .build();
   ApiFuture<Instance> future = alloyDBAdminClient.getInstanceCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetInstanceRequest,Instance>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = alloyDBAdminClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = alloyDBAdminClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getSettings()

public final AlloyDBAdminSettings getSettings()
Returns
Type Description
AlloyDBAdminSettings

getStub()

public AlloyDBAdminStub getStub()
Returns
Type Description
AlloyDBAdminStub

getUser(GetUserRequest request)

public final User getUser(GetUserRequest request)

Gets details of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetUserRequest request =
       GetUserRequest.newBuilder()
           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
           .build();
   User response = alloyDBAdminClient.getUser(request);
 }
 
Parameter
Name Description
request GetUserRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
User

getUser(UserName name)

public final User getUser(UserName name)

Gets details of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UserName name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]");
   User response = alloyDBAdminClient.getUser(name);
 }
 
Parameter
Name Description
name UserName

Required. The name of the resource. For the required format, see the comment on the User.name field.

Returns
Type Description
User

getUser(String name)

public final User getUser(String name)

Gets details of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString();
   User response = alloyDBAdminClient.getUser(name);
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the User.name field.

Returns
Type Description
User

getUserCallable()

public final UnaryCallable<GetUserRequest,User> getUserCallable()

Gets details of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   GetUserRequest request =
       GetUserRequest.newBuilder()
           .setName(UserName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[USER]").toString())
           .build();
   ApiFuture<User> future = alloyDBAdminClient.getUserCallable().futureCall(request);
   // Do something.
   User response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetUserRequest,User>

injectFaultAsync(InjectFaultRequest request)

public final OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest request)

Injects fault in an instance. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InjectFaultRequest request =
       InjectFaultRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Instance response = alloyDBAdminClient.injectFaultAsync(request).get();
 }
 
Parameter
Name Description
request InjectFaultRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

injectFaultAsync(InjectFaultRequest.FaultType faultType, InstanceName name)

public final OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest.FaultType faultType, InstanceName name)

Injects fault in an instance. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
 }
 
Parameters
Name Description
faultType InjectFaultRequest.FaultType

Required. The type of fault to be injected in an instance.

name InstanceName

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

injectFaultAsync(InjectFaultRequest.FaultType faultType, String name)

public final OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest.FaultType faultType, String name)

Injects fault in an instance. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InjectFaultRequest.FaultType faultType = InjectFaultRequest.FaultType.forNumber(0);
   String name =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   Instance response = alloyDBAdminClient.injectFaultAsync(faultType, name).get();
 }
 
Parameters
Name Description
faultType InjectFaultRequest.FaultType

Required. The type of fault to be injected in an instance.

name String

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

injectFaultCallable()

public final UnaryCallable<InjectFaultRequest,Operation> injectFaultCallable()

Injects fault in an instance. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InjectFaultRequest request =
       InjectFaultRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.injectFaultCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<InjectFaultRequest,Operation>

injectFaultOperationCallable()

public final OperationCallable<InjectFaultRequest,Instance,OperationMetadata> injectFaultOperationCallable()

Injects fault in an instance. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InjectFaultRequest request =
       InjectFaultRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.injectFaultOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<InjectFaultRequest,Instance,OperationMetadata>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listBackups(ListBackupsRequest request)

public final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)

Lists Backups in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListBackupsRequest request =
       ListBackupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Backup element : alloyDBAdminClient.listBackups(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListBackupsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListBackupsPagedResponse

listBackups(LocationName parent)

public final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(LocationName parent)

Lists Backups in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. Parent value for ListBackupsRequest

Returns
Type Description
AlloyDBAdminClient.ListBackupsPagedResponse

listBackups(String parent)

public final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(String parent)

Lists Backups in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Backup element : alloyDBAdminClient.listBackups(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent value for ListBackupsRequest

Returns
Type Description
AlloyDBAdminClient.ListBackupsPagedResponse

listBackupsCallable()

public final UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()

Lists Backups in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListBackupsRequest request =
       ListBackupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListBackupsResponse response = alloyDBAdminClient.listBackupsCallable().call(request);
     for (Backup element : response.getBackupsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListBackupsRequest,ListBackupsResponse>

listBackupsPagedCallable()

public final UnaryCallable<ListBackupsRequest,AlloyDBAdminClient.ListBackupsPagedResponse> listBackupsPagedCallable()

Lists Backups in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListBackupsRequest request =
       ListBackupsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Backup> future = alloyDBAdminClient.listBackupsPagedCallable().futureCall(request);
   // Do something.
   for (Backup element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListBackupsRequest,ListBackupsPagedResponse>

listClusters(ListClustersRequest request)

public final AlloyDBAdminClient.ListClustersPagedResponse listClusters(ListClustersRequest request)

Lists Clusters in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Cluster element : alloyDBAdminClient.listClusters(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListClustersRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListClustersPagedResponse

listClusters(LocationName parent)

public final AlloyDBAdminClient.ListClustersPagedResponse listClusters(LocationName parent)

Lists Clusters in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. Additionally, you can perform an aggregated list operation by specifying a value with the following format: * projects/{project}/locations/-

Returns
Type Description
AlloyDBAdminClient.ListClustersPagedResponse

listClusters(String parent)

public final AlloyDBAdminClient.ListClustersPagedResponse listClusters(String parent)

Lists Clusters in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Cluster element : alloyDBAdminClient.listClusters(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The name of the parent resource. For the required format, see the comment on the Cluster.name field. Additionally, you can perform an aggregated list operation by specifying a value with the following format: * projects/{project}/locations/-

Returns
Type Description
AlloyDBAdminClient.ListClustersPagedResponse

listClustersCallable()

public final UnaryCallable<ListClustersRequest,ListClustersResponse> listClustersCallable()

Lists Clusters in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListClustersResponse response = alloyDBAdminClient.listClustersCallable().call(request);
     for (Cluster element : response.getClustersList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListClustersRequest,ListClustersResponse>

listClustersPagedCallable()

public final UnaryCallable<ListClustersRequest,AlloyDBAdminClient.ListClustersPagedResponse> listClustersPagedCallable()

Lists Clusters in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListClustersRequest request =
       ListClustersRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Cluster> future =
       alloyDBAdminClient.listClustersPagedCallable().futureCall(request);
   // Do something.
   for (Cluster element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListClustersRequest,ListClustersPagedResponse>

listInstances(ClusterName parent)

public final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(ClusterName parent)

Lists Instances in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent ClusterName

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. Additionally, you can perform an aggregated list operation by specifying a value with one of the following formats: * projects/{project}/locations/-/clusters/- * projects/{project}/locations/{region}/clusters/-

Returns
Type Description
AlloyDBAdminClient.ListInstancesPagedResponse

listInstances(ListInstancesRequest request)

public final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)

Lists Instances in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Instance element : alloyDBAdminClient.listInstances(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListInstancesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListInstancesPagedResponse

listInstances(String parent)

public final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(String parent)

Lists Instances in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   for (Instance element : alloyDBAdminClient.listInstances(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The name of the parent resource. For the required format, see the comment on the Instance.name field. Additionally, you can perform an aggregated list operation by specifying a value with one of the following formats: * projects/{project}/locations/-/clusters/- * projects/{project}/locations/{region}/clusters/-

Returns
Type Description
AlloyDBAdminClient.ListInstancesPagedResponse

listInstancesCallable()

public final UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()

Lists Instances in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListInstancesResponse response = alloyDBAdminClient.listInstancesCallable().call(request);
     for (Instance element : response.getInstancesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListInstancesRequest,ListInstancesResponse>

listInstancesPagedCallable()

public final UnaryCallable<ListInstancesRequest,AlloyDBAdminClient.ListInstancesPagedResponse> listInstancesPagedCallable()

Lists Instances in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Instance> future =
       alloyDBAdminClient.listInstancesPagedCallable().futureCall(request);
   // Do something.
   for (Instance element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListInstancesRequest,ListInstancesPagedResponse>

listLocations(ListLocationsRequest request)

public final AlloyDBAdminClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : alloyDBAdminClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = alloyDBAdminClient.listLocationsCallable().call(request);
     for (Location element : response.getLocationsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,AlloyDBAdminClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       alloyDBAdminClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest request)

public final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest request)

Lists SupportedDatabaseFlags for a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListSupportedDatabaseFlagsRequest request =
       ListSupportedDatabaseFlagsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (SupportedDatabaseFlag element :
       alloyDBAdminClient.listSupportedDatabaseFlags(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListSupportedDatabaseFlagsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse

listSupportedDatabaseFlags(LocationName parent)

public final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(LocationName parent)

Lists SupportedDatabaseFlags for a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (SupportedDatabaseFlag element :
       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The name of the parent resource. The required format is: * projects/{project}/locations/{location}

Regardless of the parent specified here, as long it is contains a valid project and location, the service will return a static list of supported flags resources. Note that we do not yet support region-specific flags.

Returns
Type Description
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse

listSupportedDatabaseFlags(String parent)

public final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent)

Lists SupportedDatabaseFlags for a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (SupportedDatabaseFlag element :
       alloyDBAdminClient.listSupportedDatabaseFlags(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The name of the parent resource. The required format is: * projects/{project}/locations/{location}

Regardless of the parent specified here, as long it is contains a valid project and location, the service will return a static list of supported flags resources. Note that we do not yet support region-specific flags.

Returns
Type Description
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse

listSupportedDatabaseFlagsCallable()

public final UnaryCallable<ListSupportedDatabaseFlagsRequest,ListSupportedDatabaseFlagsResponse> listSupportedDatabaseFlagsCallable()

Lists SupportedDatabaseFlags for a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListSupportedDatabaseFlagsRequest request =
       ListSupportedDatabaseFlagsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListSupportedDatabaseFlagsResponse response =
         alloyDBAdminClient.listSupportedDatabaseFlagsCallable().call(request);
     for (SupportedDatabaseFlag element : response.getSupportedDatabaseFlagsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListSupportedDatabaseFlagsRequest,ListSupportedDatabaseFlagsResponse>

listSupportedDatabaseFlagsPagedCallable()

public final UnaryCallable<ListSupportedDatabaseFlagsRequest,AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse> listSupportedDatabaseFlagsPagedCallable()

Lists SupportedDatabaseFlags for a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListSupportedDatabaseFlagsRequest request =
       ListSupportedDatabaseFlagsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<SupportedDatabaseFlag> future =
       alloyDBAdminClient.listSupportedDatabaseFlagsPagedCallable().futureCall(request);
   // Do something.
   for (SupportedDatabaseFlag element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListSupportedDatabaseFlagsRequest,ListSupportedDatabaseFlagsPagedResponse>

listUsers(ClusterName parent)

public final AlloyDBAdminClient.ListUsersPagedResponse listUsers(ClusterName parent)

Lists Users in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent ClusterName

Required. Parent value for ListUsersRequest

Returns
Type Description
AlloyDBAdminClient.ListUsersPagedResponse

listUsers(ListUsersRequest request)

public final AlloyDBAdminClient.ListUsersPagedResponse listUsers(ListUsersRequest request)

Lists Users in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListUsersRequest request =
       ListUsersRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (User element : alloyDBAdminClient.listUsers(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListUsersRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
AlloyDBAdminClient.ListUsersPagedResponse

listUsers(String parent)

public final AlloyDBAdminClient.ListUsersPagedResponse listUsers(String parent)

Lists Users in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   for (User element : alloyDBAdminClient.listUsers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Parent value for ListUsersRequest

Returns
Type Description
AlloyDBAdminClient.ListUsersPagedResponse

listUsersCallable()

public final UnaryCallable<ListUsersRequest,ListUsersResponse> listUsersCallable()

Lists Users in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListUsersRequest request =
       ListUsersRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListUsersResponse response = alloyDBAdminClient.listUsersCallable().call(request);
     for (User element : response.getUsersList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListUsersRequest,ListUsersResponse>

listUsersPagedCallable()

public final UnaryCallable<ListUsersRequest,AlloyDBAdminClient.ListUsersPagedResponse> listUsersPagedCallable()

Lists Users in a given project and location.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ListUsersRequest request =
       ListUsersRequest.newBuilder()
           .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<User> future = alloyDBAdminClient.listUsersPagedCallable().futureCall(request);
   // Do something.
   for (User element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListUsersRequest,ListUsersPagedResponse>

promoteClusterAsync(ClusterName name)

public final OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(ClusterName name)

Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
 }
 
Parameter
Name Description
name ClusterName

Required. The name of the resource. For the required format, see the comment on the Cluster.name field

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

promoteClusterAsync(PromoteClusterRequest request)

public final OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(PromoteClusterRequest request)

Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   PromoteClusterRequest request =
       PromoteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   Cluster response = alloyDBAdminClient.promoteClusterAsync(request).get();
 }
 
Parameter
Name Description
request PromoteClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

promoteClusterAsync(String name)

public final OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(String name)

Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
   Cluster response = alloyDBAdminClient.promoteClusterAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Cluster.name field

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

promoteClusterCallable()

public final UnaryCallable<PromoteClusterRequest,Operation> promoteClusterCallable()

Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   PromoteClusterRequest request =
       PromoteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.promoteClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<PromoteClusterRequest,Operation>

promoteClusterOperationCallable()

public final OperationCallable<PromoteClusterRequest,Cluster,OperationMetadata> promoteClusterOperationCallable()

Promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   PromoteClusterRequest request =
       PromoteClusterRequest.newBuilder()
           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
           .setRequestId("requestId693933066")
           .setEtag("etag3123477")
           .setValidateOnly(true)
           .build();
   OperationFuture<Cluster, OperationMetadata> future =
       alloyDBAdminClient.promoteClusterOperationCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
OperationCallable<PromoteClusterRequest,Cluster,OperationMetadata>

restartInstanceAsync(InstanceName name)

public final OperationFuture<Instance,OperationMetadata> restartInstanceAsync(InstanceName name)

Restart an Instance in a cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
 }
 
Parameter
Name Description
name InstanceName

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

restartInstanceAsync(RestartInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> restartInstanceAsync(RestartInstanceRequest request)

Restart an Instance in a cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestartInstanceRequest request =
       RestartInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Instance response = alloyDBAdminClient.restartInstanceAsync(request).get();
 }
 
Parameter
Name Description
request RestartInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

restartInstanceAsync(String name)

public final OperationFuture<Instance,OperationMetadata> restartInstanceAsync(String name)

Restart an Instance in a cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   String name =
       InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
   Instance response = alloyDBAdminClient.restartInstanceAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the resource. For the required format, see the comment on the Instance.name field.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

restartInstanceCallable()

public final UnaryCallable<RestartInstanceRequest,Operation> restartInstanceCallable()

Restart an Instance in a cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestartInstanceRequest request =
       RestartInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future =
       alloyDBAdminClient.restartInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RestartInstanceRequest,Operation>

restartInstanceOperationCallable()

public final OperationCallable<RestartInstanceRequest,Instance,OperationMetadata> restartInstanceOperationCallable()

Restart an Instance in a cluster. Imperative only.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestartInstanceRequest request =
       RestartInstanceRequest.newBuilder()
           .setName(
               InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<RestartInstanceRequest,Instance,OperationMetadata>

restoreClusterAsync(RestoreClusterRequest request)

public final OperationFuture<Cluster,OperationMetadata> restoreClusterAsync(RestoreClusterRequest request)

Creates a new Cluster in a given project and location, with a volume restored from the provided source, either a backup ID or a point-in-time and a source cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestoreClusterRequest request =
       RestoreClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   Cluster response = alloyDBAdminClient.restoreClusterAsync(request).get();
 }
 
Parameter
Name Description
request RestoreClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

restoreClusterCallable()

public final UnaryCallable<RestoreClusterRequest,Operation> restoreClusterCallable()

Creates a new Cluster in a given project and location, with a volume restored from the provided source, either a backup ID or a point-in-time and a source cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestoreClusterRequest request =
       RestoreClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.restoreClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RestoreClusterRequest,Operation>

restoreClusterOperationCallable()

public final OperationCallable<RestoreClusterRequest,Cluster,OperationMetadata> restoreClusterOperationCallable()

Creates a new Cluster in a given project and location, with a volume restored from the provided source, either a backup ID or a point-in-time and a source cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   RestoreClusterRequest request =
       RestoreClusterRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setClusterId("clusterId561939637")
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .build();
   OperationFuture<Cluster, OperationMetadata> future =
       alloyDBAdminClient.restoreClusterOperationCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
OperationCallable<RestoreClusterRequest,Cluster,OperationMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateBackupAsync(Backup backup, FieldMask updateMask)

public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(Backup backup, FieldMask updateMask)

Updates the parameters of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   Backup backup = Backup.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Backup response = alloyDBAdminClient.updateBackupAsync(backup, updateMask).get();
 }
 
Parameters
Name Description
backup Backup

Required. The resource being updated

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Backup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Backup,OperationMetadata>

updateBackupAsync(UpdateBackupRequest request)

public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(UpdateBackupRequest request)

Updates the parameters of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateBackupRequest request =
       UpdateBackupRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   Backup response = alloyDBAdminClient.updateBackupAsync(request).get();
 }
 
Parameter
Name Description
request UpdateBackupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Backup,OperationMetadata>

updateBackupCallable()

public final UnaryCallable<UpdateBackupRequest,Operation> updateBackupCallable()

Updates the parameters of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateBackupRequest request =
       UpdateBackupRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.updateBackupCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateBackupRequest,Operation>

updateBackupOperationCallable()

public final OperationCallable<UpdateBackupRequest,Backup,OperationMetadata> updateBackupOperationCallable()

Updates the parameters of a single Backup.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateBackupRequest request =
       UpdateBackupRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setBackup(Backup.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   OperationFuture<Backup, OperationMetadata> future =
       alloyDBAdminClient.updateBackupOperationCallable().futureCall(request);
   // Do something.
   Backup response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateBackupRequest,Backup,OperationMetadata>

updateClusterAsync(Cluster cluster, FieldMask updateMask)

public final OperationFuture<Cluster,OperationMetadata> updateClusterAsync(Cluster cluster, FieldMask updateMask)

Updates the parameters of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   Cluster cluster = Cluster.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Cluster response = alloyDBAdminClient.updateClusterAsync(cluster, updateMask).get();
 }
 
Parameters
Name Description
cluster Cluster

Required. The resource being updated

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Cluster resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

updateClusterAsync(UpdateClusterRequest request)

public final OperationFuture<Cluster,OperationMetadata> updateClusterAsync(UpdateClusterRequest request)

Updates the parameters of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateClusterRequest request =
       UpdateClusterRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   Cluster response = alloyDBAdminClient.updateClusterAsync(request).get();
 }
 
Parameter
Name Description
request UpdateClusterRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Cluster,OperationMetadata>

updateClusterCallable()

public final UnaryCallable<UpdateClusterRequest,Operation> updateClusterCallable()

Updates the parameters of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateClusterRequest request =
       UpdateClusterRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.updateClusterCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateClusterRequest,Operation>

updateClusterOperationCallable()

public final OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata> updateClusterOperationCallable()

Updates the parameters of a single Cluster.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateClusterRequest request =
       UpdateClusterRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setCluster(Cluster.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   OperationFuture<Cluster, OperationMetadata> future =
       alloyDBAdminClient.updateClusterOperationCallable().futureCall(request);
   // Do something.
   Cluster response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata>

updateInstanceAsync(Instance instance, FieldMask updateMask)

public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, FieldMask updateMask)

Updates the parameters of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   Instance instance = Instance.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Instance response = alloyDBAdminClient.updateInstanceAsync(instance, updateMask).get();
 }
 
Parameters
Name Description
instance Instance

Required. The resource being updated

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Instance resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

updateInstanceAsync(UpdateInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(UpdateInstanceRequest request)

Updates the parameters of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   Instance response = alloyDBAdminClient.updateInstanceAsync(request).get();
 }
 
Parameter
Name Description
request UpdateInstanceRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Instance,OperationMetadata>

updateInstanceCallable()

public final UnaryCallable<UpdateInstanceRequest,Operation> updateInstanceCallable()

Updates the parameters of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   ApiFuture<Operation> future = alloyDBAdminClient.updateInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateInstanceRequest,Operation>

updateInstanceOperationCallable()

public final OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata> updateInstanceOperationCallable()

Updates the parameters of a single Instance.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       alloyDBAdminClient.updateInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata>

updateUser(UpdateUserRequest request)

public final User updateUser(UpdateUserRequest request)

Updates the parameters of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateUserRequest request =
       UpdateUserRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setUser(User.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   User response = alloyDBAdminClient.updateUser(request);
 }
 
Parameter
Name Description
request UpdateUserRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
User

updateUser(User user, FieldMask updateMask)

public final User updateUser(User user, FieldMask updateMask)

Updates the parameters of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   User user = User.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   User response = alloyDBAdminClient.updateUser(user, updateMask);
 }
 
Parameters
Name Description
user User

Required. The resource being updated

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the User resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

Returns
Type Description
User

updateUserCallable()

public final UnaryCallable<UpdateUserRequest,User> updateUserCallable()

Updates the parameters of a single User.

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 (AlloyDBAdminClient alloyDBAdminClient = AlloyDBAdminClient.create()) {
   UpdateUserRequest request =
       UpdateUserRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setUser(User.newBuilder().build())
           .setRequestId("requestId693933066")
           .setValidateOnly(true)
           .setAllowMissing(true)
           .build();
   ApiFuture<User> future = alloyDBAdminClient.updateUserCallable().futureCall(request);
   // Do something.
   User response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateUserRequest,User>