Class AlloyDBAdminClient (0.23.0)

GitHub RepositoryProduct ReferenceREST Documentation

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

Methods
MethodDescriptionMethod Variants

ListClusters

Lists Clusters in a given project and location.

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

  • listClusters(ListClustersRequest request)

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

  • listClusters(LocationName parent)

  • listClusters(String parent)

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

  • listClustersPagedCallable()

  • listClustersCallable()

GetCluster

Gets details of a single Cluster.

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

  • getCluster(GetClusterRequest request)

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

  • getCluster(ClusterName name)

  • getCluster(String name)

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

  • getClusterCallable()

CreateCluster

Creates a new Cluster in a given project and location.

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

  • createClusterAsync(CreateClusterRequest request)

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

  • createClusterAsync(LocationName parent, Cluster cluster, String clusterId)

  • createClusterAsync(String parent, Cluster cluster, String clusterId)

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

  • createClusterOperationCallable()

  • createClusterCallable()

UpdateCluster

Updates the parameters of a single Cluster.

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

  • updateClusterAsync(UpdateClusterRequest request)

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

  • updateClusterAsync(Cluster cluster, FieldMask updateMask)

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

  • updateClusterOperationCallable()

  • updateClusterCallable()

DeleteCluster

Deletes a single Cluster.

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

  • deleteClusterAsync(DeleteClusterRequest request)

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

  • deleteClusterAsync(ClusterName name)

  • deleteClusterAsync(String name)

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

  • deleteClusterOperationCallable()

  • deleteClusterCallable()

PromoteCluster

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

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

  • promoteClusterAsync(PromoteClusterRequest request)

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

  • promoteClusterAsync(ClusterName name)

  • promoteClusterAsync(String name)

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

  • promoteClusterOperationCallable()

  • promoteClusterCallable()

RestoreCluster

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.

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

  • restoreClusterAsync(RestoreClusterRequest request)

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

  • restoreClusterOperationCallable()

  • restoreClusterCallable()

CreateSecondaryCluster

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

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

  • createSecondaryClusterAsync(CreateSecondaryClusterRequest request)

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

  • createSecondaryClusterAsync(LocationName parent, Cluster cluster, String clusterId)

  • createSecondaryClusterAsync(String parent, Cluster cluster, String clusterId)

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

  • createSecondaryClusterOperationCallable()

  • createSecondaryClusterCallable()

ListInstances

Lists Instances in a given project and location.

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

  • listInstances(ListInstancesRequest request)

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

  • listInstances(ClusterName parent)

  • listInstances(String parent)

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

  • listInstancesPagedCallable()

  • listInstancesCallable()

GetInstance

Gets details of a single Instance.

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

  • getInstance(GetInstanceRequest request)

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

  • getInstance(InstanceName name)

  • getInstance(String name)

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

  • getInstanceCallable()

CreateInstance

Creates a new Instance in a given project and location.

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

  • createInstanceAsync(CreateInstanceRequest request)

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

  • createInstanceAsync(ClusterName parent, Instance instance, String instanceId)

  • createInstanceAsync(String parent, Instance instance, String instanceId)

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

  • createInstanceOperationCallable()

  • createInstanceCallable()

CreateSecondaryInstance

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

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

  • createSecondaryInstanceAsync(CreateSecondaryInstanceRequest request)

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

  • createSecondaryInstanceAsync(ClusterName parent, Instance instance, String instanceId)

  • createSecondaryInstanceAsync(String parent, Instance instance, String instanceId)

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

  • createSecondaryInstanceOperationCallable()

  • createSecondaryInstanceCallable()

BatchCreateInstances

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.

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

  • batchCreateInstancesAsync(BatchCreateInstancesRequest request)

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

  • batchCreateInstancesOperationCallable()

  • batchCreateInstancesCallable()

UpdateInstance

Updates the parameters of a single Instance.

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

  • updateInstanceAsync(UpdateInstanceRequest request)

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

  • updateInstanceAsync(Instance instance, FieldMask updateMask)

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

  • updateInstanceOperationCallable()

  • updateInstanceCallable()

DeleteInstance

Deletes a single Instance.

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

  • deleteInstanceAsync(DeleteInstanceRequest request)

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

  • deleteInstanceAsync(InstanceName name)

  • deleteInstanceAsync(String name)

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

  • deleteInstanceOperationCallable()

  • deleteInstanceCallable()

FailoverInstance

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

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

  • failoverInstanceAsync(FailoverInstanceRequest request)

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

  • failoverInstanceAsync(InstanceName name)

  • failoverInstanceAsync(String name)

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

  • failoverInstanceOperationCallable()

  • failoverInstanceCallable()

InjectFault

Injects fault in an instance. Imperative only.

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

  • injectFaultAsync(InjectFaultRequest request)

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

  • injectFaultAsync(InjectFaultRequest.FaultType faultType, InstanceName name)

  • injectFaultAsync(InjectFaultRequest.FaultType faultType, String name)

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

  • injectFaultOperationCallable()

  • injectFaultCallable()

RestartInstance

Restart an Instance in a cluster. Imperative only.

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

  • restartInstanceAsync(RestartInstanceRequest request)

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

  • restartInstanceAsync(InstanceName name)

  • restartInstanceAsync(String name)

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

  • restartInstanceOperationCallable()

  • restartInstanceCallable()

ListBackups

Lists Backups in a given project and location.

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

  • listBackups(ListBackupsRequest request)

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

  • listBackups(LocationName parent)

  • listBackups(String parent)

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

  • listBackupsPagedCallable()

  • listBackupsCallable()

GetBackup

Gets details of a single Backup.

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

  • getBackup(GetBackupRequest request)

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

  • getBackup(BackupName name)

  • getBackup(String name)

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

  • getBackupCallable()

CreateBackup

Creates a new Backup in a given project and location.

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

  • createBackupAsync(CreateBackupRequest request)

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

  • createBackupAsync(LocationName parent, Backup backup, String backupId)

  • createBackupAsync(String parent, Backup backup, String backupId)

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

  • createBackupOperationCallable()

  • createBackupCallable()

UpdateBackup

Updates the parameters of a single Backup.

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

  • updateBackupAsync(UpdateBackupRequest request)

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

  • updateBackupAsync(Backup backup, FieldMask updateMask)

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

  • updateBackupOperationCallable()

  • updateBackupCallable()

DeleteBackup

Deletes a single Backup.

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

  • deleteBackupAsync(DeleteBackupRequest request)

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

  • deleteBackupAsync(BackupName name)

  • deleteBackupAsync(String name)

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

  • deleteBackupOperationCallable()

  • deleteBackupCallable()

ListSupportedDatabaseFlags

Lists SupportedDatabaseFlags for a given project and location.

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

  • listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest request)

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

  • listSupportedDatabaseFlags(LocationName parent)

  • listSupportedDatabaseFlags(String parent)

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

  • listSupportedDatabaseFlagsPagedCallable()

  • listSupportedDatabaseFlagsCallable()

GenerateClientCertificate

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

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

  • generateClientCertificate(GenerateClientCertificateRequest request)

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

  • generateClientCertificate(ClusterName parent)

  • generateClientCertificate(String parent)

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

  • generateClientCertificateCallable()

GetConnectionInfo

Get instance metadata used for a connection.

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

  • getConnectionInfo(GetConnectionInfoRequest request)

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

  • getConnectionInfo(InstanceName parent)

  • getConnectionInfo(String parent)

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

  • getConnectionInfoCallable()

ListUsers

Lists Users in a given project and location.

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

  • listUsers(ListUsersRequest request)

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

  • listUsers(ClusterName parent)

  • listUsers(String parent)

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

  • listUsersPagedCallable()

  • listUsersCallable()

GetUser

Gets details of a single User.

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

  • getUser(GetUserRequest request)

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

  • getUser(UserName name)

  • getUser(String name)

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

  • getUserCallable()

CreateUser

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

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

  • createUser(CreateUserRequest request)

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

  • createUser(ClusterName parent, User user, String userId)

  • createUser(String parent, User user, String userId)

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

  • createUserCallable()

UpdateUser

Updates the parameters of a single User.

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

  • updateUser(UpdateUserRequest request)

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

  • updateUser(User user, FieldMask updateMask)

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

  • updateUserCallable()

DeleteUser

Deletes a single User.

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

  • deleteUser(DeleteUserRequest request)

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

  • deleteUser(UserName name)

  • deleteUser(String name)

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

  • deleteUserCallable()

ListDatabases

Lists Databases in a given project and location.

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

  • listDatabases(ListDatabasesRequest request)

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

  • listDatabases(ClusterName parent)

  • listDatabases(String parent)

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

  • listDatabasesPagedCallable()

  • listDatabasesCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

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

Static Methods

create()

public static final AlloyDBAdminClient create()

Constructs an instance of AlloyDBAdminClient with default settings.

Returns
TypeDescription
AlloyDBAdminClient
Exceptions
TypeDescription
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
NameDescription
settingsAlloyDBAdminSettings
Returns
TypeDescription
AlloyDBAdminClient
Exceptions
TypeDescription
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
NameDescription
stubAlloyDBAdminStub
Returns
TypeDescription
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
NameDescription
settingsAlloyDBAdminSettings

AlloyDBAdminClient(AlloyDBAdminStub stub)

protected AlloyDBAdminClient(AlloyDBAdminStub stub)
Parameter
NameDescription
stubAlloyDBAdminStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
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
NameDescription
requestBatchCreateInstancesRequest

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestCreateBackupRequest

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

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. Value for parent.

backupBackup

Required. The resource being created

backupIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
NameDescription
parentString

Required. Value for parent.

backupBackup

Required. The resource being created

backupIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestCreateClusterRequest

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

Returns
TypeDescription
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
NameDescription
parentLocationName

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

clusterCluster

Required. The resource being created

clusterIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
NameDescription
parentString

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

clusterCluster

Required. The resource being created

clusterIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
parentClusterName

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

instanceInstance

Required. The resource being created

instanceIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
NameDescription
requestCreateInstanceRequest

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

Returns
TypeDescription
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
NameDescription
parentString

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

instanceInstance

Required. The resource being created

instanceIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestCreateSecondaryClusterRequest

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

Returns
TypeDescription
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
NameDescription
parentLocationName

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

clusterCluster

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

clusterIdString

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

Returns
TypeDescription
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
NameDescription
parentString

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

clusterCluster

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

clusterIdString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
parentClusterName

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

instanceInstance

Required. The resource being created

instanceIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
NameDescription
requestCreateSecondaryInstanceRequest

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

Returns
TypeDescription
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
NameDescription
parentString

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

instanceInstance

Required. The resource being created

instanceIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
parentClusterName

Required. Value for parent.

userUser

Required. The resource being created

userIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
NameDescription
requestCreateUserRequest

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

Returns
TypeDescription
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
NameDescription
parentString

Required. Value for parent.

userUser

Required. The resource being created

userIdString

Required. ID of the requesting object.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
nameBackupName

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

Returns
TypeDescription
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
NameDescription
requestDeleteBackupRequest

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
nameClusterName

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

Returns
TypeDescription
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
NameDescription
requestDeleteClusterRequest

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestDeleteInstanceRequest

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

Returns
TypeDescription
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
NameDescription
nameInstanceName

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>