@BetaApi @Generated(value="by gapic-generator-java") public class AlloyDBAdminClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
| Method | Description | Method 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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportCluster |
Exports data from the cluster. Imperative only. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportCluster |
Imports data to the cluster. Imperative only. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpgradeCluster |
Upgrades a single Cluster. Imperative only. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCluster |
Deletes a single Cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SwitchoverCluster |
Switches the roles of PRIMARY and SECONDARY clusters without any data loss. This promotes the SECONDARY cluster to PRIMARY and sets up the original PRIMARY cluster to replicate from this newly promoted cluster. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteInstance |
Deletes a single Instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExecuteSql |
Executes a SQL statement in a database inside an AlloyDB instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteBackup |
Deletes a single Backup. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteUser |
Deletes a single User. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDatabase |
Creates a new Database 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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
| Modifier | Constructor and Description |
|---|---|
protected |
AlloyDBAdminClient(AlloyDBAdminSettings settings)
Constructs an instance of AlloyDBAdminClient, using the given settings.
|
protected |
AlloyDBAdminClient(AlloyDBAdminStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<BatchCreateInstancesResponse,OperationMetadata> |
batchCreateInstancesAsync(BatchCreateInstancesRequest request)
Creates new instances under the given project, location and cluster.
|
com.google.api.gax.rpc.UnaryCallable<BatchCreateInstancesRequest,com.google.longrunning.Operation> |
batchCreateInstancesCallable()
Creates new instances under the given project, location and cluster.
|
com.google.api.gax.rpc.OperationCallable<BatchCreateInstancesRequest,BatchCreateInstancesResponse,OperationMetadata> |
batchCreateInstancesOperationCallable()
Creates new instances under the given project, location and cluster.
|
void |
close() |
static AlloyDBAdminClient |
create()
Constructs an instance of AlloyDBAdminClient with default settings.
|
static AlloyDBAdminClient |
create(AlloyDBAdminSettings settings)
Constructs an instance of AlloyDBAdminClient, using the given settings.
|
static AlloyDBAdminClient |
create(AlloyDBAdminStub stub)
Constructs an instance of AlloyDBAdminClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(CreateBackupRequest request)
Creates a new Backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(LocationName parent,
Backup backup,
String backupId)
Creates a new Backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
createBackupAsync(String parent,
Backup backup,
String backupId)
Creates a new Backup in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateBackupRequest,com.google.longrunning.Operation> |
createBackupCallable()
Creates a new Backup in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateBackupRequest,Backup,OperationMetadata> |
createBackupOperationCallable()
Creates a new Backup in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(CreateClusterRequest request)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(LocationName parent,
Cluster cluster,
String clusterId)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(String parent,
Cluster cluster,
String clusterId)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,com.google.longrunning.Operation> |
createClusterCallable()
Creates a new Cluster in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateClusterRequest,Cluster,OperationMetadata> |
createClusterOperationCallable()
Creates a new Cluster in a given project and location.
|
Database |
createDatabase(ClusterName parent,
Database database,
String databaseId)
Creates a new Database in a given project, location, and cluster.
|
Database |
createDatabase(CreateDatabaseRequest request)
Creates a new Database in a given project, location, and cluster.
|
Database |
createDatabase(String parent,
Database database,
String databaseId)
Creates a new Database in a given project, location, and cluster.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatabaseRequest,Database> |
createDatabaseCallable()
Creates a new Database in a given project, location, and cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createInstanceAsync(ClusterName parent,
Instance instance,
String instanceId)
Creates a new Instance in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createInstanceAsync(CreateInstanceRequest request)
Creates a new Instance in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createInstanceAsync(String parent,
Instance instance,
String instanceId)
Creates a new Instance in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateInstanceRequest,com.google.longrunning.Operation> |
createInstanceCallable()
Creates a new Instance in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> |
createInstanceOperationCallable()
Creates a new Instance in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createSecondaryClusterAsync(CreateSecondaryClusterRequest request)
Creates a cluster of type SECONDARY in the given location using the primary cluster as the
source.
|
com.google.api.gax.longrunning.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.
|
com.google.api.gax.longrunning.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.
|
com.google.api.gax.rpc.UnaryCallable<CreateSecondaryClusterRequest,com.google.longrunning.Operation> |
createSecondaryClusterCallable()
Creates a cluster of type SECONDARY in the given location using the primary cluster as the
source.
|
com.google.api.gax.rpc.OperationCallable<CreateSecondaryClusterRequest,Cluster,OperationMetadata> |
createSecondaryClusterOperationCallable()
Creates a cluster of type SECONDARY in the given location using the primary cluster as the
source.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createSecondaryInstanceAsync(ClusterName parent,
Instance instance,
String instanceId)
Creates a new SECONDARY Instance in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createSecondaryInstanceAsync(CreateSecondaryInstanceRequest request)
Creates a new SECONDARY Instance in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
createSecondaryInstanceAsync(String parent,
Instance instance,
String instanceId)
Creates a new SECONDARY Instance in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateSecondaryInstanceRequest,com.google.longrunning.Operation> |
createSecondaryInstanceCallable()
Creates a new SECONDARY Instance in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateSecondaryInstanceRequest,Instance,OperationMetadata> |
createSecondaryInstanceOperationCallable()
Creates a new SECONDARY Instance in a given project and location.
|
User |
createUser(ClusterName parent,
User user,
String userId)
Creates a new User in a given project, location, and cluster.
|
User |
createUser(CreateUserRequest request)
Creates a new User in a given project, location, and cluster.
|
User |
createUser(String parent,
User user,
String userId)
Creates a new User in a given project, location, and cluster.
|
com.google.api.gax.rpc.UnaryCallable<CreateUserRequest,User> |
createUserCallable()
Creates a new User in a given project, location, and cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(BackupName name)
Deletes a single Backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(DeleteBackupRequest request)
Deletes a single Backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteBackupAsync(String name)
Deletes a single Backup.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBackupRequest,com.google.longrunning.Operation> |
deleteBackupCallable()
Deletes a single Backup.
|
com.google.api.gax.rpc.OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteBackupOperationCallable()
Deletes a single Backup.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(ClusterName name)
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(DeleteClusterRequest request)
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(String name)
Deletes a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,com.google.longrunning.Operation> |
deleteClusterCallable()
Deletes a single Cluster.
|
com.google.api.gax.rpc.OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteClusterOperationCallable()
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteInstanceAsync(DeleteInstanceRequest request)
Deletes a single Instance.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteInstanceAsync(InstanceName name)
Deletes a single Instance.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteInstanceAsync(String name)
Deletes a single Instance.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,com.google.longrunning.Operation> |
deleteInstanceCallable()
Deletes a single Instance.
|
com.google.api.gax.rpc.OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteInstanceOperationCallable()
Deletes a single Instance.
|
void |
deleteUser(DeleteUserRequest request)
Deletes a single User.
|
void |
deleteUser(String name)
Deletes a single User.
|
void |
deleteUser(UserName name)
Deletes a single User.
|
com.google.api.gax.rpc.UnaryCallable<DeleteUserRequest,com.google.protobuf.Empty> |
deleteUserCallable()
Deletes a single User.
|
ExecuteSqlResponse |
executeSql(ExecuteSqlRequest request)
Executes a SQL statement in a database inside an AlloyDB instance.
|
ExecuteSqlResponse |
executeSql(InstanceName instance,
String database,
String user,
String sqlStatement,
String password)
Executes a SQL statement in a database inside an AlloyDB instance.
|
ExecuteSqlResponse |
executeSql(String instance,
String database,
String user,
String sqlStatement,
String password)
Executes a SQL statement in a database inside an AlloyDB instance.
|
com.google.api.gax.rpc.UnaryCallable<ExecuteSqlRequest,ExecuteSqlResponse> |
executeSqlCallable()
Executes a SQL statement in a database inside an AlloyDB instance.
|
com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> |
exportClusterAsync(ClusterName name,
GcsDestination gcsDestination,
String database,
ExportClusterRequest.CsvExportOptions csvExportOptions,
ExportClusterRequest.SqlExportOptions sqlExportOptions)
Exports data from the cluster.
|
com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> |
exportClusterAsync(ExportClusterRequest request)
Exports data from the cluster.
|
com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> |
exportClusterAsync(String name,
GcsDestination gcsDestination,
String database,
ExportClusterRequest.CsvExportOptions csvExportOptions,
ExportClusterRequest.SqlExportOptions sqlExportOptions)
Exports data from the cluster.
|
com.google.api.gax.rpc.UnaryCallable<ExportClusterRequest,com.google.longrunning.Operation> |
exportClusterCallable()
Exports data from the cluster.
|
com.google.api.gax.rpc.OperationCallable<ExportClusterRequest,ExportClusterResponse,OperationMetadata> |
exportClusterOperationCallable()
Exports data from the cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
failoverInstanceAsync(FailoverInstanceRequest request)
Forces a Failover for a highly available instance.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
failoverInstanceAsync(InstanceName name)
Forces a Failover for a highly available instance.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
failoverInstanceAsync(String name)
Forces a Failover for a highly available instance.
|
com.google.api.gax.rpc.UnaryCallable<FailoverInstanceRequest,com.google.longrunning.Operation> |
failoverInstanceCallable()
Forces a Failover for a highly available instance.
|
com.google.api.gax.rpc.OperationCallable<FailoverInstanceRequest,Instance,OperationMetadata> |
failoverInstanceOperationCallable()
Forces a Failover for a highly available instance.
|
GenerateClientCertificateResponse |
generateClientCertificate(ClusterName parent)
Generate a client certificate signed by a Cluster CA.
|
GenerateClientCertificateResponse |
generateClientCertificate(GenerateClientCertificateRequest request)
Generate a client certificate signed by a Cluster CA.
|
GenerateClientCertificateResponse |
generateClientCertificate(String parent)
Generate a client certificate signed by a Cluster CA.
|
com.google.api.gax.rpc.UnaryCallable<GenerateClientCertificateRequest,GenerateClientCertificateResponse> |
generateClientCertificateCallable()
Generate a client certificate signed by a Cluster CA.
|
Backup |
getBackup(BackupName name)
Gets details of a single Backup.
|
Backup |
getBackup(GetBackupRequest request)
Gets details of a single Backup.
|
Backup |
getBackup(String name)
Gets details of a single Backup.
|
com.google.api.gax.rpc.UnaryCallable<GetBackupRequest,Backup> |
getBackupCallable()
Gets details of a single Backup.
|
Cluster |
getCluster(ClusterName name)
Gets details of a single Cluster.
|
Cluster |
getCluster(GetClusterRequest request)
Gets details of a single Cluster.
|
Cluster |
getCluster(String name)
Gets details of a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,Cluster> |
getClusterCallable()
Gets details of a single Cluster.
|
ConnectionInfo |
getConnectionInfo(GetConnectionInfoRequest request)
Get instance metadata used for a connection.
|
ConnectionInfo |
getConnectionInfo(InstanceName parent)
Get instance metadata used for a connection.
|
ConnectionInfo |
getConnectionInfo(String parent)
Get instance metadata used for a connection.
|
com.google.api.gax.rpc.UnaryCallable<GetConnectionInfoRequest,ConnectionInfo> |
getConnectionInfoCallable()
Get instance metadata used for a connection.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Instance |
getInstance(GetInstanceRequest request)
Gets details of a single Instance.
|
Instance |
getInstance(InstanceName name)
Gets details of a single Instance.
|
Instance |
getInstance(String name)
Gets details of a single Instance.
|
com.google.api.gax.rpc.UnaryCallable<GetInstanceRequest,Instance> |
getInstanceCallable()
Gets details of a single Instance.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
AlloyDBAdminSettings |
getSettings() |
AlloyDBAdminStub |
getStub() |
User |
getUser(GetUserRequest request)
Gets details of a single User.
|
User |
getUser(String name)
Gets details of a single User.
|
User |
getUser(UserName name)
Gets details of a single User.
|
com.google.api.gax.rpc.UnaryCallable<GetUserRequest,User> |
getUserCallable()
Gets details of a single User.
|
com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> |
importClusterAsync(ClusterName name,
String gcsUri,
String database,
String user)
Imports data to the cluster.
|
com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> |
importClusterAsync(ImportClusterRequest request)
Imports data to the cluster.
|
com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> |
importClusterAsync(String name,
String gcsUri,
String database,
String user)
Imports data to the cluster.
|
com.google.api.gax.rpc.UnaryCallable<ImportClusterRequest,com.google.longrunning.Operation> |
importClusterCallable()
Imports data to the cluster.
|
com.google.api.gax.rpc.OperationCallable<ImportClusterRequest,ImportClusterResponse,OperationMetadata> |
importClusterOperationCallable()
Imports data to the cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
injectFaultAsync(InjectFaultRequest.FaultType faultType,
InstanceName name)
Injects fault in an instance.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
injectFaultAsync(InjectFaultRequest.FaultType faultType,
String name)
Injects fault in an instance.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
injectFaultAsync(InjectFaultRequest request)
Injects fault in an instance.
|
com.google.api.gax.rpc.UnaryCallable<InjectFaultRequest,com.google.longrunning.Operation> |
injectFaultCallable()
Injects fault in an instance.
|
com.google.api.gax.rpc.OperationCallable<InjectFaultRequest,Instance,OperationMetadata> |
injectFaultOperationCallable()
Injects fault in an instance.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
AlloyDBAdminClient.ListBackupsPagedResponse |
listBackups(ListBackupsRequest request)
Lists Backups in a given project and location.
|
AlloyDBAdminClient.ListBackupsPagedResponse |
listBackups(LocationName parent)
Lists Backups in a given project and location.
|
AlloyDBAdminClient.ListBackupsPagedResponse |
listBackups(String parent)
Lists Backups in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,ListBackupsResponse> |
listBackupsCallable()
Lists Backups in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,AlloyDBAdminClient.ListBackupsPagedResponse> |
listBackupsPagedCallable()
Lists Backups in a given project and location.
|
AlloyDBAdminClient.ListClustersPagedResponse |
listClusters(ListClustersRequest request)
Lists Clusters in a given project and location.
|
AlloyDBAdminClient.ListClustersPagedResponse |
listClusters(LocationName parent)
Lists Clusters in a given project and location.
|
AlloyDBAdminClient.ListClustersPagedResponse |
listClusters(String parent)
Lists Clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,ListClustersResponse> |
listClustersCallable()
Lists Clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,AlloyDBAdminClient.ListClustersPagedResponse> |
listClustersPagedCallable()
Lists Clusters in a given project and location.
|
AlloyDBAdminClient.ListDatabasesPagedResponse |
listDatabases(ClusterName parent)
Lists Databases in a given project and location.
|
AlloyDBAdminClient.ListDatabasesPagedResponse |
listDatabases(ListDatabasesRequest request)
Lists Databases in a given project and location.
|
AlloyDBAdminClient.ListDatabasesPagedResponse |
listDatabases(String parent)
Lists Databases in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListDatabasesRequest,ListDatabasesResponse> |
listDatabasesCallable()
Lists Databases in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListDatabasesRequest,AlloyDBAdminClient.ListDatabasesPagedResponse> |
listDatabasesPagedCallable()
Lists Databases in a given project and location.
|
AlloyDBAdminClient.ListInstancesPagedResponse |
listInstances(ClusterName parent)
Lists Instances in a given project and location.
|
AlloyDBAdminClient.ListInstancesPagedResponse |
listInstances(ListInstancesRequest request)
Lists Instances in a given project and location.
|
AlloyDBAdminClient.ListInstancesPagedResponse |
listInstances(String parent)
Lists Instances in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,ListInstancesResponse> |
listInstancesCallable()
Lists Instances in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,AlloyDBAdminClient.ListInstancesPagedResponse> |
listInstancesPagedCallable()
Lists Instances in a given project and location.
|
AlloyDBAdminClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,AlloyDBAdminClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse |
listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest request)
Lists SupportedDatabaseFlags for a given project and location.
|
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse |
listSupportedDatabaseFlags(LocationName parent)
Lists SupportedDatabaseFlags for a given project and location.
|
AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse |
listSupportedDatabaseFlags(String parent)
Lists SupportedDatabaseFlags for a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSupportedDatabaseFlagsRequest,ListSupportedDatabaseFlagsResponse> |
listSupportedDatabaseFlagsCallable()
Lists SupportedDatabaseFlags for a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSupportedDatabaseFlagsRequest,AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse> |
listSupportedDatabaseFlagsPagedCallable()
Lists SupportedDatabaseFlags for a given project and location.
|
AlloyDBAdminClient.ListUsersPagedResponse |
listUsers(ClusterName parent)
Lists Users in a given project and location.
|
AlloyDBAdminClient.ListUsersPagedResponse |
listUsers(ListUsersRequest request)
Lists Users in a given project and location.
|
AlloyDBAdminClient.ListUsersPagedResponse |
listUsers(String parent)
Lists Users in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListUsersRequest,ListUsersResponse> |
listUsersCallable()
Lists Users in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListUsersRequest,AlloyDBAdminClient.ListUsersPagedResponse> |
listUsersPagedCallable()
Lists Users in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
promoteClusterAsync(ClusterName name)
Promotes a SECONDARY cluster.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
promoteClusterAsync(PromoteClusterRequest request)
Promotes a SECONDARY cluster.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
promoteClusterAsync(String name)
Promotes a SECONDARY cluster.
|
com.google.api.gax.rpc.UnaryCallable<PromoteClusterRequest,com.google.longrunning.Operation> |
promoteClusterCallable()
Promotes a SECONDARY cluster.
|
com.google.api.gax.rpc.OperationCallable<PromoteClusterRequest,Cluster,OperationMetadata> |
promoteClusterOperationCallable()
Promotes a SECONDARY cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
restartInstanceAsync(InstanceName name)
Restart an Instance in a cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
restartInstanceAsync(RestartInstanceRequest request)
Restart an Instance in a cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
restartInstanceAsync(String name)
Restart an Instance in a cluster.
|
com.google.api.gax.rpc.UnaryCallable<RestartInstanceRequest,com.google.longrunning.Operation> |
restartInstanceCallable()
Restart an Instance in a cluster.
|
com.google.api.gax.rpc.OperationCallable<RestartInstanceRequest,Instance,OperationMetadata> |
restartInstanceOperationCallable()
Restart an Instance in a cluster.
|
com.google.api.gax.longrunning.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.
|
com.google.api.gax.rpc.UnaryCallable<RestoreClusterRequest,com.google.longrunning.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.
|
com.google.api.gax.rpc.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.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
switchoverClusterAsync(ClusterName name)
Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
switchoverClusterAsync(String name)
Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
switchoverClusterAsync(SwitchoverClusterRequest request)
Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
com.google.api.gax.rpc.UnaryCallable<SwitchoverClusterRequest,com.google.longrunning.Operation> |
switchoverClusterCallable()
Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
com.google.api.gax.rpc.OperationCallable<SwitchoverClusterRequest,Cluster,OperationMetadata> |
switchoverClusterOperationCallable()
Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
updateBackupAsync(Backup backup,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Backup.
|
com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> |
updateBackupAsync(UpdateBackupRequest request)
Updates the parameters of a single Backup.
|
com.google.api.gax.rpc.UnaryCallable<UpdateBackupRequest,com.google.longrunning.Operation> |
updateBackupCallable()
Updates the parameters of a single Backup.
|
com.google.api.gax.rpc.OperationCallable<UpdateBackupRequest,Backup,OperationMetadata> |
updateBackupOperationCallable()
Updates the parameters of a single Backup.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
updateClusterAsync(Cluster cluster,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
updateClusterAsync(UpdateClusterRequest request)
Updates the parameters of a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,com.google.longrunning.Operation> |
updateClusterCallable()
Updates the parameters of a single Cluster.
|
com.google.api.gax.rpc.OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata> |
updateClusterOperationCallable()
Updates the parameters of a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
updateInstanceAsync(Instance instance,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Instance.
|
com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> |
updateInstanceAsync(UpdateInstanceRequest request)
Updates the parameters of a single Instance.
|
com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,com.google.longrunning.Operation> |
updateInstanceCallable()
Updates the parameters of a single Instance.
|
com.google.api.gax.rpc.OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata> |
updateInstanceOperationCallable()
Updates the parameters of a single Instance.
|
User |
updateUser(UpdateUserRequest request)
Updates the parameters of a single User.
|
User |
updateUser(User user,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single User.
|
com.google.api.gax.rpc.UnaryCallable<UpdateUserRequest,User> |
updateUserCallable()
Updates the parameters of a single User.
|
com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> |
upgradeClusterAsync(ClusterName name,
DatabaseVersion version)
Upgrades a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> |
upgradeClusterAsync(String name,
DatabaseVersion version)
Upgrades a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> |
upgradeClusterAsync(UpgradeClusterRequest request)
Upgrades a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpgradeClusterRequest,com.google.longrunning.Operation> |
upgradeClusterCallable()
Upgrades a single Cluster.
|
com.google.api.gax.rpc.OperationCallable<UpgradeClusterRequest,UpgradeClusterResponse,OperationMetadata> |
upgradeClusterOperationCallable()
Upgrades a single Cluster.
|
protected AlloyDBAdminClient(AlloyDBAdminSettings settings) throws IOException
IOExceptionprotected AlloyDBAdminClient(AlloyDBAdminStub stub)
public static final AlloyDBAdminClient create() throws IOException
IOExceptionpublic static final AlloyDBAdminClient create(AlloyDBAdminSettings settings) throws IOException
IOExceptionpublic static final AlloyDBAdminClient create(AlloyDBAdminStub stub)
public final AlloyDBAdminSettings getSettings()
public AlloyDBAdminStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final AlloyDBAdminClient.ListClustersPagedResponse listClusters(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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/-com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListClustersPagedResponse listClusters(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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/-com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListClustersPagedResponse listClusters(ListClustersRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,AlloyDBAdminClient.ListClustersPagedResponse> listClustersPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,ListClustersResponse> listClustersCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final Cluster getCluster(ClusterName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Cluster getCluster(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Cluster getCluster(GetClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(LocationName parent, Cluster cluster, String clusterId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The location of the new cluster. For the required format, see the
comment on the Cluster.name field.cluster - Required. The resource being createdclusterId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(String parent, Cluster cluster, String clusterId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The location of the new cluster. For the required format, see the
comment on the Cluster.name field.cluster - Required. The resource being createdclusterId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(CreateClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateClusterRequest,Cluster,OperationMetadata> createClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,com.google.longrunning.Operation> createClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> updateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
cluster - Required. The resource being updatedupdateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> updateClusterAsync(UpdateClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata> updateClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,com.google.longrunning.Operation> updateClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> exportClusterAsync(ClusterName name, GcsDestination gcsDestination, String database, ExportClusterRequest.CsvExportOptions csvExportOptions, ExportClusterRequest.SqlExportOptions sqlExportOptions)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
GcsDestination gcsDestination = GcsDestination.newBuilder().build();
String database = "database1789464955";
ExportClusterRequest.CsvExportOptions csvExportOptions =
ExportClusterRequest.CsvExportOptions.newBuilder().build();
ExportClusterRequest.SqlExportOptions sqlExportOptions =
ExportClusterRequest.SqlExportOptions.newBuilder().build();
ExportClusterResponse response =
alloyDBAdminClient
.exportClusterAsync(
name, gcsDestination, database, csvExportOptions, sqlExportOptions)
.get();
}
name - Required. The resource name of the cluster.gcsDestination - Required. Option to export data to cloud storage.database - Required. Name of the database where the export command will be executed. Note
- Value provided should be the same as expected from `SELECT current_database();` and NOT
as a resource reference.csvExportOptions - Options for exporting data in CSV format. Required field to be set for
CSV file type.sqlExportOptions - Options for exporting data in SQL format. Required field to be set for
SQL file type.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> exportClusterAsync(String name, GcsDestination gcsDestination, String database, ExportClusterRequest.CsvExportOptions csvExportOptions, ExportClusterRequest.SqlExportOptions sqlExportOptions)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
GcsDestination gcsDestination = GcsDestination.newBuilder().build();
String database = "database1789464955";
ExportClusterRequest.CsvExportOptions csvExportOptions =
ExportClusterRequest.CsvExportOptions.newBuilder().build();
ExportClusterRequest.SqlExportOptions sqlExportOptions =
ExportClusterRequest.SqlExportOptions.newBuilder().build();
ExportClusterResponse response =
alloyDBAdminClient
.exportClusterAsync(
name, gcsDestination, database, csvExportOptions, sqlExportOptions)
.get();
}
name - Required. The resource name of the cluster.gcsDestination - Required. Option to export data to cloud storage.database - Required. Name of the database where the export command will be executed. Note
- Value provided should be the same as expected from `SELECT current_database();` and NOT
as a resource reference.csvExportOptions - Options for exporting data in CSV format. Required field to be set for
CSV file type.sqlExportOptions - Options for exporting data in SQL format. Required field to be set for
SQL file type.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ExportClusterResponse,OperationMetadata> exportClusterAsync(ExportClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ExportClusterRequest request =
ExportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setDatabase("database1789464955")
.build();
ExportClusterResponse response = alloyDBAdminClient.exportClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ExportClusterRequest,ExportClusterResponse,OperationMetadata> exportClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ExportClusterRequest request =
ExportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setDatabase("database1789464955")
.build();
OperationFuture<ExportClusterResponse, OperationMetadata> future =
alloyDBAdminClient.exportClusterOperationCallable().futureCall(request);
// Do something.
ExportClusterResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ExportClusterRequest,com.google.longrunning.Operation> exportClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ExportClusterRequest request =
ExportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setDatabase("database1789464955")
.build();
ApiFuture<Operation> future = alloyDBAdminClient.exportClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> importClusterAsync(ClusterName name, String gcsUri, String database, String 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()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
String gcsUri = "gcsUri-1251224875";
String database = "database1789464955";
String user = "user3599307";
ImportClusterResponse response =
alloyDBAdminClient.importClusterAsync(name, gcsUri, database, user).get();
}
name - Required. The resource name of the cluster.gcsUri - Required. The path to the file in Google Cloud Storage where the source file for
import will be stored. The URI is in the form `gs://bucketName/fileName`.database - Optional. Name of the database to which the import will be done. For import
from SQL file, this is required only if the file does not specify a database. Note - Value
provided should be the same as expected from `SELECT current_database();` and NOT as a
resource reference.user - Optional. Database user to be used for importing the data. Note - Value provided
should be the same as expected from `SELECT current_user;` and NOT as a resource reference.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> importClusterAsync(String name, String gcsUri, String database, String 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 = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
String gcsUri = "gcsUri-1251224875";
String database = "database1789464955";
String user = "user3599307";
ImportClusterResponse response =
alloyDBAdminClient.importClusterAsync(name, gcsUri, database, user).get();
}
name - Required. The resource name of the cluster.gcsUri - Required. The path to the file in Google Cloud Storage where the source file for
import will be stored. The URI is in the form `gs://bucketName/fileName`.database - Optional. Name of the database to which the import will be done. For import
from SQL file, this is required only if the file does not specify a database. Note - Value
provided should be the same as expected from `SELECT current_database();` and NOT as a
resource reference.user - Optional. Database user to be used for importing the data. Note - Value provided
should be the same as expected from `SELECT current_user;` and NOT as a resource reference.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportClusterResponse,OperationMetadata> importClusterAsync(ImportClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ImportClusterRequest request =
ImportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setGcsUri("gcsUri-1251224875")
.setDatabase("database1789464955")
.setUser("user3599307")
.build();
ImportClusterResponse response = alloyDBAdminClient.importClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportClusterRequest,ImportClusterResponse,OperationMetadata> importClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ImportClusterRequest request =
ImportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setGcsUri("gcsUri-1251224875")
.setDatabase("database1789464955")
.setUser("user3599307")
.build();
OperationFuture<ImportClusterResponse, OperationMetadata> future =
alloyDBAdminClient.importClusterOperationCallable().futureCall(request);
// Do something.
ImportClusterResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportClusterRequest,com.google.longrunning.Operation> importClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ImportClusterRequest request =
ImportClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setGcsUri("gcsUri-1251224875")
.setDatabase("database1789464955")
.setUser("user3599307")
.build();
ApiFuture<Operation> future = alloyDBAdminClient.importClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> upgradeClusterAsync(ClusterName name, DatabaseVersion version)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
DatabaseVersion version = DatabaseVersion.forNumber(0);
UpgradeClusterResponse response = alloyDBAdminClient.upgradeClusterAsync(name, version).get();
}
name - Required. The resource name of the cluster.version - Required. The version the cluster is going to be upgraded to.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> upgradeClusterAsync(String name, DatabaseVersion version)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
DatabaseVersion version = DatabaseVersion.forNumber(0);
UpgradeClusterResponse response = alloyDBAdminClient.upgradeClusterAsync(name, version).get();
}
name - Required. The resource name of the cluster.version - Required. The version the cluster is going to be upgraded to.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UpgradeClusterResponse,OperationMetadata> upgradeClusterAsync(UpgradeClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpgradeClusterRequest request =
UpgradeClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setVersion(DatabaseVersion.forNumber(0))
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
UpgradeClusterResponse response = alloyDBAdminClient.upgradeClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpgradeClusterRequest,UpgradeClusterResponse,OperationMetadata> upgradeClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpgradeClusterRequest request =
UpgradeClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setVersion(DatabaseVersion.forNumber(0))
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<UpgradeClusterResponse, OperationMetadata> future =
alloyDBAdminClient.upgradeClusterOperationCallable().futureCall(request);
// Do something.
UpgradeClusterResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpgradeClusterRequest,com.google.longrunning.Operation> upgradeClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpgradeClusterRequest request =
UpgradeClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setVersion(DatabaseVersion.forNumber(0))
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation> future = alloyDBAdminClient.upgradeClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(ClusterName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(DeleteClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty,OperationMetadata> deleteClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,com.google.longrunning.Operation> deleteClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(ClusterName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name fieldcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name fieldcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> promoteClusterAsync(PromoteClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PromoteClusterRequest,Cluster,OperationMetadata> promoteClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<PromoteClusterRequest,com.google.longrunning.Operation> promoteClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> switchoverClusterAsync(ClusterName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.switchoverClusterAsync(name).get();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name fieldcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> switchoverClusterAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.switchoverClusterAsync(name).get();
}
name - Required. The name of the resource. For the required format, see the comment on the
Cluster.name fieldcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> switchoverClusterAsync(SwitchoverClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SwitchoverClusterRequest request =
SwitchoverClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
Cluster response = alloyDBAdminClient.switchoverClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SwitchoverClusterRequest,Cluster,OperationMetadata> switchoverClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SwitchoverClusterRequest request =
SwitchoverClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
OperationFuture<Cluster, OperationMetadata> future =
alloyDBAdminClient.switchoverClusterOperationCallable().futureCall(request);
// Do something.
Cluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SwitchoverClusterRequest,com.google.longrunning.Operation> switchoverClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SwitchoverClusterRequest request =
SwitchoverClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future =
alloyDBAdminClient.switchoverClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> restoreClusterAsync(RestoreClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RestoreClusterRequest,Cluster,OperationMetadata> restoreClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<RestoreClusterRequest,com.google.longrunning.Operation> restoreClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(LocationName parent, Cluster cluster, String clusterId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The location of the new cluster. For the required format, see the
comment on the Cluster.name field.cluster - Required. Configuration of the requesting object (the secondary cluster).clusterId - Required. ID of the requesting object (the secondary cluster).com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(String parent, Cluster cluster, String clusterId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The location of the new cluster. For the required format, see the
comment on the Cluster.name field.cluster - Required. Configuration of the requesting object (the secondary cluster).clusterId - Required. ID of the requesting object (the secondary cluster).com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createSecondaryClusterAsync(CreateSecondaryClusterRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateSecondaryClusterRequest,Cluster,OperationMetadata> createSecondaryClusterOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateSecondaryClusterRequest,com.google.longrunning.Operation> createSecondaryClusterCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(ClusterName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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/-com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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/-com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,AlloyDBAdminClient.ListInstancesPagedResponse> listInstancesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final Instance getInstance(InstanceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Instance getInstance(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Instance getInstance(GetInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createInstanceAsync(ClusterName parent, Instance instance, String instanceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The name of the parent resource. For the required format, see the
comment on the Instance.name field.instance - Required. The resource being createdinstanceId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The name of the parent resource. For the required format, see the
comment on the Instance.name field.instance - Required. The resource being createdinstanceId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> createInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateInstanceRequest,com.google.longrunning.Operation> createInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(ClusterName parent, Instance instance, String instanceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The name of the parent resource. For the required format, see the
comment on the Instance.name field.instance - Required. The resource being createdinstanceId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(String parent, Instance instance, String instanceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. The name of the parent resource. For the required format, see the
comment on the Instance.name field.instance - Required. The resource being createdinstanceId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> createSecondaryInstanceAsync(CreateSecondaryInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateSecondaryInstanceRequest,Instance,OperationMetadata> createSecondaryInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateSecondaryInstanceRequest,com.google.longrunning.Operation> createSecondaryInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<BatchCreateInstancesResponse,OperationMetadata> batchCreateInstancesAsync(BatchCreateInstancesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<BatchCreateInstancesRequest,BatchCreateInstancesResponse,OperationMetadata> batchCreateInstancesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<BatchCreateInstancesRequest,com.google.longrunning.Operation> batchCreateInstancesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
instance - Required. The resource being updatedupdateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> updateInstanceAsync(UpdateInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata> updateInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,com.google.longrunning.Operation> updateInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(InstanceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty,OperationMetadata> deleteInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteInstanceRequest,com.google.longrunning.Operation> deleteInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(InstanceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> failoverInstanceAsync(FailoverInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<FailoverInstanceRequest,Instance,OperationMetadata> failoverInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<FailoverInstanceRequest,com.google.longrunning.Operation> failoverInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest.FaultType faultType, InstanceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
faultType - Required. The type of fault to be injected in an instance.name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest.FaultType faultType, String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
faultType - Required. The type of fault to be injected in an instance.name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> injectFaultAsync(InjectFaultRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InjectFaultRequest,Instance,OperationMetadata> injectFaultOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<InjectFaultRequest,com.google.longrunning.Operation> injectFaultCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> restartInstanceAsync(InstanceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> restartInstanceAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the resource. For the required format, see the comment on the
Instance.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> restartInstanceAsync(RestartInstanceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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)
.addAllNodeIds(new ArrayList<String>())
.build();
Instance response = alloyDBAdminClient.restartInstanceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RestartInstanceRequest,Instance,OperationMetadata> restartInstanceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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)
.addAllNodeIds(new ArrayList<String>())
.build();
OperationFuture<Instance, OperationMetadata> future =
alloyDBAdminClient.restartInstanceOperationCallable().futureCall(request);
// Do something.
Instance response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RestartInstanceRequest,com.google.longrunning.Operation> restartInstanceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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)
.addAllNodeIds(new ArrayList<String>())
.build();
ApiFuture<Operation> future =
alloyDBAdminClient.restartInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final ExecuteSqlResponse executeSql(InstanceName instance, String database, String user, String sqlStatement, String password)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 instance = InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]");
String database = "database1789464955";
String user = "user3599307";
String sqlStatement = "sqlStatement937767745";
String password = "password1216985755";
ExecuteSqlResponse response =
alloyDBAdminClient.executeSql(instance, database, user, sqlStatement, password);
}
instance - Required. The instance where the SQL will be executed. For the required format,
see the comment on the Instance.name field.database - Required. Name of the database where the query will be executed. Note - Value
provided should be the same as expected from `SELECT current_database();` and NOT as a
resource reference.user - Required. Database user to be used for executing the SQL. Note - Value provided
should be the same as expected from `SELECT current_user;` and NOT as a resource reference.sqlStatement - Required. SQL statement to execute on database. Any valid statement is
permitted, including DDL, DML, DQL statements.password - Optional. The database native user’s password.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ExecuteSqlResponse executeSql(String instance, String database, String user, String sqlStatement, String password)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 instance =
InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString();
String database = "database1789464955";
String user = "user3599307";
String sqlStatement = "sqlStatement937767745";
String password = "password1216985755";
ExecuteSqlResponse response =
alloyDBAdminClient.executeSql(instance, database, user, sqlStatement, password);
}
instance - Required. The instance where the SQL will be executed. For the required format,
see the comment on the Instance.name field.database - Required. Name of the database where the query will be executed. Note - Value
provided should be the same as expected from `SELECT current_database();` and NOT as a
resource reference.user - Required. Database user to be used for executing the SQL. Note - Value provided
should be the same as expected from `SELECT current_user;` and NOT as a resource reference.sqlStatement - Required. SQL statement to execute on database. Any valid statement is
permitted, including DDL, DML, DQL statements.password - Optional. The database native user’s password.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ExecuteSqlResponse executeSql(ExecuteSqlRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ExecuteSqlRequest request =
ExecuteSqlRequest.newBuilder()
.setInstance(
InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
.setDatabase("database1789464955")
.setUser("user3599307")
.setSqlStatement("sqlStatement937767745")
.setValidateOnly(true)
.build();
ExecuteSqlResponse response = alloyDBAdminClient.executeSql(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ExecuteSqlRequest,ExecuteSqlResponse> executeSqlCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ExecuteSqlRequest request =
ExecuteSqlRequest.newBuilder()
.setInstance(
InstanceName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[INSTANCE]").toString())
.setDatabase("database1789464955")
.setUser("user3599307")
.setSqlStatement("sqlStatement937767745")
.setValidateOnly(true)
.build();
ApiFuture<ExecuteSqlResponse> future =
alloyDBAdminClient.executeSqlCallable().futureCall(request);
// Do something.
ExecuteSqlResponse response = future.get();
}
public final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. Parent value for ListBackupsRequestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. Parent value for ListBackupsRequestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,AlloyDBAdminClient.ListBackupsPagedResponse> listBackupsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final Backup getBackup(BackupName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. Name of the resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final Backup getBackup(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. Name of the resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final Backup getBackup(GetBackupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBackupRequest,Backup> getBackupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(LocationName parent, Backup backup, String backupId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. Value for parent.backup - Required. The resource being createdbackupId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(String parent, Backup backup, String backupId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
parent - Required. Value for parent.backup - Required. The resource being createdbackupId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> createBackupAsync(CreateBackupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateBackupRequest,Backup,OperationMetadata> createBackupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateBackupRequest,com.google.longrunning.Operation> createBackupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> updateBackupAsync(Backup backup, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
backup - Required. The resource being updatedupdateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Backup,OperationMetadata> updateBackupAsync(UpdateBackupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateBackupRequest,Backup,OperationMetadata> updateBackupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateBackupRequest,com.google.longrunning.Operation> updateBackupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(BackupName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. Name of the resource. For the required format, see the comment on the
Backup.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. Name of the resource. For the required format, see the comment on the
Backup.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteBackupRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteBackupRequest,com.google.longrunning.Operation> deleteBackupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSupportedDatabaseFlagsRequest,AlloyDBAdminClient.ListSupportedDatabaseFlagsPagedResponse> listSupportedDatabaseFlagsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSupportedDatabaseFlagsRequest,ListSupportedDatabaseFlagsResponse> listSupportedDatabaseFlagsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final GenerateClientCertificateResponse generateClientCertificate(ClusterName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The name of the parent resource. The required format is: *
projects/{project}/locations/{location}/clusters/{cluster}com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateClientCertificateResponse generateClientCertificate(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The name of the parent resource. The required format is: *
projects/{project}/locations/{location}/clusters/{cluster}com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateClientCertificateResponse generateClientCertificate(GenerateClientCertificateRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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")
.setUseMetadataExchange(true)
.build();
GenerateClientCertificateResponse response =
alloyDBAdminClient.generateClientCertificate(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GenerateClientCertificateRequest,GenerateClientCertificateResponse> generateClientCertificateCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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")
.setUseMetadataExchange(true)
.build();
ApiFuture<GenerateClientCertificateResponse> future =
alloyDBAdminClient.generateClientCertificateCallable().futureCall(request);
// Do something.
GenerateClientCertificateResponse response = future.get();
}
public final ConnectionInfo getConnectionInfo(InstanceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The name of the parent resource. The required format is:
projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConnectionInfo getConnectionInfo(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The name of the parent resource. The required format is:
projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConnectionInfo getConnectionInfo(GetConnectionInfoRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetConnectionInfoRequest,ConnectionInfo> getConnectionInfoCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final AlloyDBAdminClient.ListUsersPagedResponse listUsers(ClusterName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. Parent value for ListUsersRequestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListUsersPagedResponse listUsers(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
parent - Required. Parent value for ListUsersRequestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListUsersPagedResponse listUsers(ListUsersRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListUsersRequest,AlloyDBAdminClient.ListUsersPagedResponse> listUsersPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListUsersRequest,ListUsersResponse> listUsersCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final User getUser(UserName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
User.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final User getUser(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
User.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final User getUser(GetUserRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetUserRequest,User> getUserCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final User createUser(ClusterName parent, User user, String userId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. Value for parent.user - Required. The resource being createduserId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final User createUser(String parent, User user, String userId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. Value for parent.user - Required. The resource being createduserId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final User createUser(CreateUserRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateUserRequest,User> createUserCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final User updateUser(User user, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
user - Required. The resource being updatedupdateMask - 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final User updateUser(UpdateUserRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateUserRequest,User> updateUserCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void deleteUser(UserName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
User.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteUser(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the resource. For the required format, see the comment on the
User.name field.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteUser(DeleteUserRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteUserRequest,com.google.protobuf.Empty> deleteUserCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final AlloyDBAdminClient.ListDatabasesPagedResponse listDatabases(ClusterName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListDatabasesRequest.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListDatabasesPagedResponse listDatabases(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 (Database element : alloyDBAdminClient.listDatabases(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListDatabasesRequest.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AlloyDBAdminClient.ListDatabasesPagedResponse listDatabases(ListDatabasesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDatabasesRequest request =
ListDatabasesRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (Database element : alloyDBAdminClient.listDatabases(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDatabasesRequest,AlloyDBAdminClient.ListDatabasesPagedResponse> listDatabasesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDatabasesRequest request =
ListDatabasesRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<Database> future =
alloyDBAdminClient.listDatabasesPagedCallable().futureCall(request);
// Do something.
for (Database element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDatabasesRequest,ListDatabasesResponse> listDatabasesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDatabasesRequest request =
ListDatabasesRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListDatabasesResponse response = alloyDBAdminClient.listDatabasesCallable().call(request);
for (Database element : response.getDatabasesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Database createDatabase(ClusterName parent, Database database, String databaseId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
Database database = Database.newBuilder().build();
String databaseId = "databaseId1688905718";
Database response = alloyDBAdminClient.createDatabase(parent, database, databaseId);
}
parent - Required. Value for parent.database - Required. The resource being created.databaseId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Database createDatabase(String parent, Database database, String databaseId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
Database database = Database.newBuilder().build();
String databaseId = "databaseId1688905718";
Database response = alloyDBAdminClient.createDatabase(parent, database, databaseId);
}
parent - Required. Value for parent.database - Required. The resource being created.databaseId - Required. ID of the requesting object.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Database createDatabase(CreateDatabaseRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
CreateDatabaseRequest request =
CreateDatabaseRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setDatabaseId("databaseId1688905718")
.setDatabase(Database.newBuilder().build())
.build();
Database response = alloyDBAdminClient.createDatabase(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDatabaseRequest,Database> createDatabaseCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
CreateDatabaseRequest request =
CreateDatabaseRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setDatabaseId("databaseId1688905718")
.setDatabase(Database.newBuilder().build())
.build();
ApiFuture<Database> future = alloyDBAdminClient.createDatabaseCallable().futureCall(request);
// Do something.
Database response = future.get();
}
public final AlloyDBAdminClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,AlloyDBAdminClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2026 Google LLC. All rights reserved.