Class DataMigrationServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (DataMigrationServiceClient dataMigrationServiceClient =
DataMigrationServiceClient.create()) {
MigrationJobName name = MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]");
MigrationJob response = dataMigrationServiceClient.getMigrationJob(name);
}
Note: close() needs to be called on the DataMigrationServiceClient 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 |
|---|---|---|
ListMigrationJobs |
Lists migration jobs 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.
|
GetMigrationJob |
Gets details of a single migration job. |
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.
|
CreateMigrationJob |
Creates a new migration job 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.
|
UpdateMigrationJob |
Updates the parameters of a single migration job. |
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.
|
DeleteMigrationJob |
Deletes a single migration job. |
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.
|
StartMigrationJob |
Start an already created migration job. |
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.
|
StopMigrationJob |
Stops a running migration job. |
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.
|
ResumeMigrationJob |
Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase). |
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.
|
PromoteMigrationJob |
Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database. |
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.
|
VerifyMigrationJob |
Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met. |
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.
|
RestartMigrationJob |
Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch. |
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.
|
GenerateSshScript |
Generate a SSH configuration script to configure the reverse SSH connectivity. |
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.
|
GenerateTcpProxyScript |
Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy. |
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.
|
ListConnectionProfiles |
Retrieves a list of all connection profiles 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.
|
GetConnectionProfile |
Gets details of a single connection profile. |
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.
|
CreateConnectionProfile |
Creates a new connection profile 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.
|
UpdateConnectionProfile |
Update the configuration of a single connection profile. |
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.
|
DeleteConnectionProfile |
Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs. |
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.
|
CreatePrivateConnection |
Creates a new private connection 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.
|
GetPrivateConnection |
Gets details of a single private 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.
|
ListPrivateConnections |
Retrieves a list of private connections 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.
|
DeletePrivateConnection |
Deletes a single Database Migration Service private connection. |
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.
|
GetConversionWorkspace |
Gets details of a single conversion workspace. |
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.
|
ListConversionWorkspaces |
Lists conversion workspaces 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.
|
CreateConversionWorkspace |
Creates a new conversion workspace 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.
|
UpdateConversionWorkspace |
Updates the parameters of a single conversion workspace. |
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.
|
DeleteConversionWorkspace |
Deletes a single conversion workspace. |
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.
|
CreateMappingRule |
Creates a new mapping rule for a given conversion workspace. |
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.
|
DeleteMappingRule |
Deletes a single mapping rule. |
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.
|
ListMappingRules |
Lists the mapping rules for a specific conversion workspace. |
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.
|
GetMappingRule |
Gets the details of a mapping rule. |
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.
|
SeedConversionWorkspace |
Imports a snapshot of the source database into the conversion workspace. |
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.
|
ImportMappingRules |
Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files. |
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.
|
ConvertConversionWorkspace |
Creates a draft tree schema for the destination database. |
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.
|
CommitConversionWorkspace |
Marks all the data in the conversion workspace as committed. |
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.
|
RollbackConversionWorkspace |
Rolls back a conversion workspace to the last committed snapshot. |
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.
|
ApplyConversionWorkspace |
Applies draft tree onto a specific destination database. |
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.
|
DescribeDatabaseEntities |
Describes the database entities tree for a specific conversion workspace and a specific tree type. Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database. |
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.
|
SearchBackgroundJobs |
Searches/lists the background jobs for a specific conversion workspace. The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log. |
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.
|
DescribeConversionWorkspaceRevisions |
Retrieves a list of committed revisions of a specific conversion workspace. |
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.
|
FetchStaticIps |
Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DataMigrationServiceSettings 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
DataMigrationServiceSettings dataMigrationServiceSettings =
DataMigrationServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataMigrationServiceClient dataMigrationServiceClient =
DataMigrationServiceClient.create(dataMigrationServiceSettings);
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
DataMigrationServiceSettings dataMigrationServiceSettings =
DataMigrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataMigrationServiceClient dataMigrationServiceClient =
DataMigrationServiceClient.create(dataMigrationServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of DataMigrationServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionApplies draft tree onto a specific destination database.Applies draft tree onto a specific destination database.Applies draft tree onto a specific destination database.booleanawaitTermination(long duration, TimeUnit unit) final voidclose()Marks all the data in the conversion workspace as committed.Marks all the data in the conversion workspace as committed.Marks all the data in the conversion workspace as committed.Creates a draft tree schema for the destination database.Creates a draft tree schema for the destination database.Creates a draft tree schema for the destination database.static final DataMigrationServiceClientcreate()Constructs an instance of DataMigrationServiceClient with default settings.static final DataMigrationServiceClientcreate(DataMigrationServiceSettings settings) Constructs an instance of DataMigrationServiceClient, using the given settings.static final DataMigrationServiceClientConstructs an instance of DataMigrationServiceClient, using the given stub for making calls.Creates a new connection profile in a given project and location.createConnectionProfileAsync(LocationName parent, ConnectionProfile connectionProfile, String connectionProfileId) Creates a new connection profile in a given project and location.createConnectionProfileAsync(String parent, ConnectionProfile connectionProfile, String connectionProfileId) Creates a new connection profile in a given project and location.Creates a new connection profile in a given project and location.Creates a new connection profile in a given project and location.Creates a new conversion workspace in a given project and location.createConversionWorkspaceAsync(LocationName parent, ConversionWorkspace conversionWorkspace, String conversionWorkspaceId) Creates a new conversion workspace in a given project and location.createConversionWorkspaceAsync(String parent, ConversionWorkspace conversionWorkspace, String conversionWorkspaceId) Creates a new conversion workspace in a given project and location.Creates a new conversion workspace in a given project and location.Creates a new conversion workspace in a given project and location.final MappingRulecreateMappingRule(ConversionWorkspaceName parent, MappingRule mappingRule, String mappingRuleId) Creates a new mapping rule for a given conversion workspace.final MappingRuleCreates a new mapping rule for a given conversion workspace.final MappingRulecreateMappingRule(String parent, MappingRule mappingRule, String mappingRuleId) Creates a new mapping rule for a given conversion workspace.Creates a new mapping rule for a given conversion workspace.Creates a new migration job in a given project and location.createMigrationJobAsync(LocationName parent, MigrationJob migrationJob, String migrationJobId) Creates a new migration job in a given project and location.createMigrationJobAsync(String parent, MigrationJob migrationJob, String migrationJobId) Creates a new migration job in a given project and location.Creates a new migration job in a given project and location.Creates a new migration job in a given project and location.Creates a new private connection in a given project and location.createPrivateConnectionAsync(LocationName parent, PrivateConnection privateConnection, String privateConnectionId) Creates a new private connection in a given project and location.createPrivateConnectionAsync(String parent, PrivateConnection privateConnection, String privateConnectionId) Creates a new private connection in a given project and location.Creates a new private connection in a given project and location.Creates a new private connection in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service connection profile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service connection profile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service connection profile.Deletes a single Database Migration Service connection profile.final OperationCallable<DeleteConnectionProfileRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Database Migration Service connection profile.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single conversion workspace.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single conversion workspace.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single conversion workspace.Deletes a single conversion workspace.final OperationCallable<DeleteConversionWorkspaceRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single conversion workspace.final voidDeletes a single mapping rule.final voidDeletes a single mapping rule.final voiddeleteMappingRule(String name) Deletes a single mapping rule.final UnaryCallable<DeleteMappingRuleRequest,com.google.protobuf.Empty> Deletes a single mapping rule.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single migration job.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single migration job.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single migration job.Deletes a single migration job.final OperationCallable<DeleteMigrationJobRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single migration job.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service private connection.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service private connection.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Database Migration Service private connection.Deletes a single Database Migration Service private connection.final OperationCallable<DeletePrivateConnectionRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Database Migration Service private connection.Retrieves a list of committed revisions of a specific conversion workspace.final UnaryCallable<DescribeConversionWorkspaceRevisionsRequest,DescribeConversionWorkspaceRevisionsResponse> Retrieves a list of committed revisions of a specific conversion workspace.Describes the database entities tree for a specific conversion workspace and a specific tree type.Describes the database entities tree for a specific conversion workspace and a specific tree type.final UnaryCallable<DescribeDatabaseEntitiesRequest,DataMigrationServiceClient.DescribeDatabaseEntitiesPagedResponse> Describes the database entities tree for a specific conversion workspace and a specific tree type.fetchStaticIps(FetchStaticIpsRequest request) Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.fetchStaticIps(LocationName name) Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.fetchStaticIps(String name) Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.final SshScriptGenerate a SSH configuration script to configure the reverse SSH connectivity.Generate a SSH configuration script to configure the reverse SSH connectivity.final TcpProxyScriptGenerate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy.Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy.final ConnectionProfileGets details of a single connection profile.final ConnectionProfileGets details of a single connection profile.final ConnectionProfilegetConnectionProfile(String name) Gets details of a single connection profile.Gets details of a single connection profile.final ConversionWorkspaceGets details of a single conversion workspace.final ConversionWorkspaceGets details of a single conversion workspace.final ConversionWorkspacegetConversionWorkspace(String name) Gets details of a single conversion workspace.Gets details of a single conversion workspace.final MappingRulegetMappingRule(GetMappingRuleRequest request) Gets the details of a mapping rule.final MappingRuleGets the details of a mapping rule.final MappingRulegetMappingRule(String name) Gets the details of a mapping rule.Gets the details of a mapping rule.final MigrationJobgetMigrationJob(GetMigrationJobRequest request) Gets details of a single migration job.final MigrationJobGets details of a single migration job.final MigrationJobgetMigrationJob(String name) Gets details of a single migration job.Gets details of a single migration job.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final PrivateConnectionGets details of a single private connection.final PrivateConnectionGets details of a single private connection.final PrivateConnectiongetPrivateConnection(String name) Gets details of a single private connection.Gets details of a single private connection.getStub()Imports the mapping rules for a given conversion workspace.Imports the mapping rules for a given conversion workspace.Imports the mapping rules for a given conversion workspace.booleanbooleanRetrieves a list of all connection profiles in a given project and location.listConnectionProfiles(LocationName parent) Retrieves a list of all connection profiles in a given project and location.listConnectionProfiles(String parent) Retrieves a list of all connection profiles in a given project and location.Retrieves a list of all connection profiles in a given project and location.final UnaryCallable<ListConnectionProfilesRequest,DataMigrationServiceClient.ListConnectionProfilesPagedResponse> Retrieves a list of all connection profiles in a given project and location.Lists conversion workspaces in a given project and location.listConversionWorkspaces(LocationName parent) Lists conversion workspaces in a given project and location.listConversionWorkspaces(String parent) Lists conversion workspaces in a given project and location.Lists conversion workspaces in a given project and location.final UnaryCallable<ListConversionWorkspacesRequest,DataMigrationServiceClient.ListConversionWorkspacesPagedResponse> Lists conversion workspaces in a given project and location.Lists the mapping rules for a specific conversion workspace.listMappingRules(ListMappingRulesRequest request) Lists the mapping rules for a specific conversion workspace.listMappingRules(String parent) Lists the mapping rules for a specific conversion workspace.Lists the mapping rules for a specific conversion workspace.final UnaryCallable<ListMappingRulesRequest,DataMigrationServiceClient.ListMappingRulesPagedResponse> Lists the mapping rules for a specific conversion workspace.Lists migration jobs in a given project and location.listMigrationJobs(LocationName parent) Lists migration jobs in a given project and location.listMigrationJobs(String parent) Lists migration jobs in a given project and location.Lists migration jobs in a given project and location.final UnaryCallable<ListMigrationJobsRequest,DataMigrationServiceClient.ListMigrationJobsPagedResponse> Lists migration jobs in a given project and location.Retrieves a list of private connections in a given project and location.listPrivateConnections(LocationName parent) Retrieves a list of private connections in a given project and location.listPrivateConnections(String parent) Retrieves a list of private connections in a given project and location.Retrieves a list of private connections in a given project and location.final UnaryCallable<ListPrivateConnectionsRequest,DataMigrationServiceClient.ListPrivateConnectionsPagedResponse> Retrieves a list of private connections in a given project and location.Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Rolls back a conversion workspace to the last committed snapshot.Rolls back a conversion workspace to the last committed snapshot.Rolls back a conversion workspace to the last committed snapshot.Searches/lists the background jobs for a specific conversion workspace.Searches/lists the background jobs for a specific conversion workspace.Imports a snapshot of the source database into the conversion workspace.Imports a snapshot of the source database into the conversion workspace.Imports a snapshot of the source database into the conversion workspace.voidshutdown()voidStart an already created migration job.Start an already created migration job.Start an already created migration job.Stops a running migration job.Stops a running migration job.Stops a running migration job.updateConnectionProfileAsync(ConnectionProfile connectionProfile, com.google.protobuf.FieldMask updateMask) Update the configuration of a single connection profile.Update the configuration of a single connection profile.Update the configuration of a single connection profile.Update the configuration of a single connection profile.updateConversionWorkspaceAsync(ConversionWorkspace conversionWorkspace, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single conversion workspace.Updates the parameters of a single conversion workspace.Updates the parameters of a single conversion workspace.Updates the parameters of a single conversion workspace.updateMigrationJobAsync(MigrationJob migrationJob, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single migration job.Updates the parameters of a single migration job.Updates the parameters of a single migration job.Updates the parameters of a single migration job.Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.
-
Constructor Details
-
DataMigrationServiceClient
Constructs an instance of DataMigrationServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
DataMigrationServiceClient
-
-
Method Details
-
create
Constructs an instance of DataMigrationServiceClient with default settings.- Throws:
IOException
-
create
public static final DataMigrationServiceClient create(DataMigrationServiceSettings settings) throws IOException Constructs an instance of DataMigrationServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of DataMigrationServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataMigrationServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listMigrationJobs
public final DataMigrationServiceClient.ListMigrationJobsPagedResponse listMigrationJobs(LocationName parent) Lists migration jobs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (MigrationJob element : dataMigrationServiceClient.listMigrationJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of migrationJobs.- Throws:
ApiException- if the remote call fails
-
listMigrationJobs
public final DataMigrationServiceClient.ListMigrationJobsPagedResponse listMigrationJobs(String parent) Lists migration jobs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (MigrationJob element : dataMigrationServiceClient.listMigrationJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of migrationJobs.- Throws:
ApiException- if the remote call fails
-
listMigrationJobs
public final DataMigrationServiceClient.ListMigrationJobsPagedResponse listMigrationJobs(ListMigrationJobsRequest request) Lists migration jobs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMigrationJobsRequest request = ListMigrationJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (MigrationJob element : dataMigrationServiceClient.listMigrationJobs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listMigrationJobsPagedCallable
public final UnaryCallable<ListMigrationJobsRequest,DataMigrationServiceClient.ListMigrationJobsPagedResponse> listMigrationJobsPagedCallable()Lists migration jobs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMigrationJobsRequest request = ListMigrationJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<MigrationJob> future = dataMigrationServiceClient.listMigrationJobsPagedCallable().futureCall(request); // Do something. for (MigrationJob element : future.get().iterateAll()) { // doThingsWith(element); } } -
listMigrationJobsCallable
public final UnaryCallable<ListMigrationJobsRequest,ListMigrationJobsResponse> listMigrationJobsCallable()Lists migration jobs in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMigrationJobsRequest request = ListMigrationJobsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListMigrationJobsResponse response = dataMigrationServiceClient.listMigrationJobsCallable().call(request); for (MigrationJob element : response.getMigrationJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getMigrationJob
Gets details of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { MigrationJobName name = MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]"); MigrationJob response = dataMigrationServiceClient.getMigrationJob(name); }- Parameters:
name- Required. Name of the migration job resource to get.- Throws:
ApiException- if the remote call fails
-
getMigrationJob
Gets details of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString(); MigrationJob response = dataMigrationServiceClient.getMigrationJob(name); }- Parameters:
name- Required. Name of the migration job resource to get.- Throws:
ApiException- if the remote call fails
-
getMigrationJob
Gets details of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetMigrationJobRequest request = GetMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); MigrationJob response = dataMigrationServiceClient.getMigrationJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getMigrationJobCallable
Gets details of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetMigrationJobRequest request = GetMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); ApiFuture<MigrationJob> future = dataMigrationServiceClient.getMigrationJobCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
createMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> createMigrationJobAsync(LocationName parent, MigrationJob migrationJob, String migrationJobId) Creates a new migration job in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); MigrationJob migrationJob = MigrationJob.newBuilder().build(); String migrationJobId = "migrationJobId1870575242"; MigrationJob response = dataMigrationServiceClient .createMigrationJobAsync(parent, migrationJob, migrationJobId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of migration jobs.migrationJob- Required. Represents a [migration job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) object.migrationJobId- Required. The ID of the instance to create.- Throws:
ApiException- if the remote call fails
-
createMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> createMigrationJobAsync(String parent, MigrationJob migrationJob, String migrationJobId) Creates a new migration job in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); MigrationJob migrationJob = MigrationJob.newBuilder().build(); String migrationJobId = "migrationJobId1870575242"; MigrationJob response = dataMigrationServiceClient .createMigrationJobAsync(parent, migrationJob, migrationJobId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of migration jobs.migrationJob- Required. Represents a [migration job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) object.migrationJobId- Required. The ID of the instance to create.- Throws:
ApiException- if the remote call fails
-
createMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> createMigrationJobAsync(CreateMigrationJobRequest request) Creates a new migration job in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateMigrationJobRequest request = CreateMigrationJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMigrationJobId("migrationJobId1870575242") .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); MigrationJob response = dataMigrationServiceClient.createMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createMigrationJobOperationCallable
public final OperationCallable<CreateMigrationJobRequest,MigrationJob, createMigrationJobOperationCallable()OperationMetadata> Creates a new migration job in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateMigrationJobRequest request = CreateMigrationJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMigrationJobId("migrationJobId1870575242") .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.createMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
createMigrationJobCallable
Creates a new migration job in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateMigrationJobRequest request = CreateMigrationJobRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMigrationJobId("migrationJobId1870575242") .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.createMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> updateMigrationJobAsync(MigrationJob migrationJob, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { MigrationJob migrationJob = MigrationJob.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); MigrationJob response = dataMigrationServiceClient.updateMigrationJobAsync(migrationJob, updateMask).get(); }- Parameters:
migrationJob- Required. The migration job parameters to update.updateMask- Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.- Throws:
ApiException- if the remote call fails
-
updateMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> updateMigrationJobAsync(UpdateMigrationJobRequest request) Updates the parameters of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateMigrationJobRequest request = UpdateMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); MigrationJob response = dataMigrationServiceClient.updateMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateMigrationJobOperationCallable
public final OperationCallable<UpdateMigrationJobRequest,MigrationJob, updateMigrationJobOperationCallable()OperationMetadata> Updates the parameters of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateMigrationJobRequest request = UpdateMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.updateMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
updateMigrationJobCallable
Updates the parameters of a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateMigrationJobRequest request = UpdateMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.updateMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigrationJobAsync(MigrationJobName name) Deletes a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { MigrationJobName name = MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]"); dataMigrationServiceClient.deleteMigrationJobAsync(name).get(); }- Parameters:
name- Required. Name of the migration job resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigrationJobAsync(String name) Deletes a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString(); dataMigrationServiceClient.deleteMigrationJobAsync(name).get(); }- Parameters:
name- Required. Name of the migration job resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigrationJobAsync(DeleteMigrationJobRequest request) Deletes a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteMigrationJobRequest request = DeleteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); dataMigrationServiceClient.deleteMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteMigrationJobOperationCallable
public final OperationCallable<DeleteMigrationJobRequest,com.google.protobuf.Empty, deleteMigrationJobOperationCallable()OperationMetadata> Deletes a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteMigrationJobRequest request = DeleteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = dataMigrationServiceClient.deleteMigrationJobOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteMigrationJobCallable
Deletes a single migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteMigrationJobRequest request = DeleteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.deleteMigrationJobCallable().futureCall(request); // Do something. future.get(); } -
startMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> startMigrationJobAsync(StartMigrationJobRequest request) Start an already created migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StartMigrationJobRequest request = StartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); MigrationJob response = dataMigrationServiceClient.startMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startMigrationJobOperationCallable
public final OperationCallable<StartMigrationJobRequest,MigrationJob, startMigrationJobOperationCallable()OperationMetadata> Start an already created migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StartMigrationJobRequest request = StartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.startMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
startMigrationJobCallable
Start an already created migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StartMigrationJobRequest request = StartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.startMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
stopMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> stopMigrationJobAsync(StopMigrationJobRequest request) Stops a running migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StopMigrationJobRequest request = StopMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); MigrationJob response = dataMigrationServiceClient.stopMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopMigrationJobOperationCallable
public final OperationCallable<StopMigrationJobRequest,MigrationJob, stopMigrationJobOperationCallable()OperationMetadata> Stops a running migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StopMigrationJobRequest request = StopMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.stopMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
stopMigrationJobCallable
Stops a running migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { StopMigrationJobRequest request = StopMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.stopMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
resumeMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> resumeMigrationJobAsync(ResumeMigrationJobRequest request) Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ResumeMigrationJobRequest request = ResumeMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); MigrationJob response = dataMigrationServiceClient.resumeMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resumeMigrationJobOperationCallable
public final OperationCallable<ResumeMigrationJobRequest,MigrationJob, resumeMigrationJobOperationCallable()OperationMetadata> Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ResumeMigrationJobRequest request = ResumeMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.resumeMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
resumeMigrationJobCallable
Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ResumeMigrationJobRequest request = ResumeMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.resumeMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
promoteMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> promoteMigrationJobAsync(PromoteMigrationJobRequest request) Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { PromoteMigrationJobRequest request = PromoteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); MigrationJob response = dataMigrationServiceClient.promoteMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
promoteMigrationJobOperationCallable
public final OperationCallable<PromoteMigrationJobRequest,MigrationJob, promoteMigrationJobOperationCallable()OperationMetadata> Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { PromoteMigrationJobRequest request = PromoteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.promoteMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
promoteMigrationJobCallable
Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { PromoteMigrationJobRequest request = PromoteMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.promoteMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
verifyMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> verifyMigrationJobAsync(VerifyMigrationJobRequest request) Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { VerifyMigrationJobRequest request = VerifyMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .build(); MigrationJob response = dataMigrationServiceClient.verifyMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
verifyMigrationJobOperationCallable
public final OperationCallable<VerifyMigrationJobRequest,MigrationJob, verifyMigrationJobOperationCallable()OperationMetadata> Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { VerifyMigrationJobRequest request = VerifyMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.verifyMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
verifyMigrationJobCallable
Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { VerifyMigrationJobRequest request = VerifyMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setMigrationJob(MigrationJob.newBuilder().build()) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.verifyMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
restartMigrationJobAsync
public final OperationFuture<MigrationJob,OperationMetadata> restartMigrationJobAsync(RestartMigrationJobRequest request) Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RestartMigrationJobRequest request = RestartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); MigrationJob response = dataMigrationServiceClient.restartMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
restartMigrationJobOperationCallable
public final OperationCallable<RestartMigrationJobRequest,MigrationJob, restartMigrationJobOperationCallable()OperationMetadata> Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RestartMigrationJobRequest request = RestartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); OperationFuture<MigrationJob, OperationMetadata> future = dataMigrationServiceClient.restartMigrationJobOperationCallable().futureCall(request); // Do something. MigrationJob response = future.get(); } -
restartMigrationJobCallable
Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RestartMigrationJobRequest request = RestartMigrationJobRequest.newBuilder() .setName(MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setSkipValidation(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.restartMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
generateSshScript
Generate a SSH configuration script to configure the reverse SSH connectivity.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GenerateSshScriptRequest request = GenerateSshScriptRequest.newBuilder() .setMigrationJob( MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setVm("vm3767") .setVmPort(563010825) .build(); SshScript response = dataMigrationServiceClient.generateSshScript(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateSshScriptCallable
Generate a SSH configuration script to configure the reverse SSH connectivity.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GenerateSshScriptRequest request = GenerateSshScriptRequest.newBuilder() .setMigrationJob( MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setVm("vm3767") .setVmPort(563010825) .build(); ApiFuture<SshScript> future = dataMigrationServiceClient.generateSshScriptCallable().futureCall(request); // Do something. SshScript response = future.get(); } -
generateTcpProxyScript
Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GenerateTcpProxyScriptRequest request = GenerateTcpProxyScriptRequest.newBuilder() .setMigrationJob( MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setVmName("vmName-813643294") .setVmMachineType("vmMachineType-1921917718") .setVmZone("vmZone-813272317") .setVmSubnet("vmSubnet-65857292") .build(); TcpProxyScript response = dataMigrationServiceClient.generateTcpProxyScript(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateTcpProxyScriptCallable
public final UnaryCallable<GenerateTcpProxyScriptRequest,TcpProxyScript> generateTcpProxyScriptCallable()Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GenerateTcpProxyScriptRequest request = GenerateTcpProxyScriptRequest.newBuilder() .setMigrationJob( MigrationJobName.of("[PROJECT]", "[LOCATION]", "[MIGRATION_JOB]").toString()) .setVmName("vmName-813643294") .setVmMachineType("vmMachineType-1921917718") .setVmZone("vmZone-813272317") .setVmSubnet("vmSubnet-65857292") .build(); ApiFuture<TcpProxyScript> future = dataMigrationServiceClient.generateTcpProxyScriptCallable().futureCall(request); // Do something. TcpProxyScript response = future.get(); } -
listConnectionProfiles
public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(LocationName parent) Retrieves a list of all connection profiles in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ConnectionProfile element : dataMigrationServiceClient.listConnectionProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of connection profiles.- Throws:
ApiException- if the remote call fails
-
listConnectionProfiles
public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(String parent) Retrieves a list of all connection profiles in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ConnectionProfile element : dataMigrationServiceClient.listConnectionProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of connection profiles.- Throws:
ApiException- if the remote call fails
-
listConnectionProfiles
public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(ListConnectionProfilesRequest request) Retrieves a list of all connection profiles in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConnectionProfilesRequest request = ListConnectionProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ConnectionProfile element : dataMigrationServiceClient.listConnectionProfiles(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listConnectionProfilesPagedCallable
public final UnaryCallable<ListConnectionProfilesRequest,DataMigrationServiceClient.ListConnectionProfilesPagedResponse> listConnectionProfilesPagedCallable()Retrieves a list of all connection profiles in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConnectionProfilesRequest request = ListConnectionProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ConnectionProfile> future = dataMigrationServiceClient.listConnectionProfilesPagedCallable().futureCall(request); // Do something. for (ConnectionProfile element : future.get().iterateAll()) { // doThingsWith(element); } } -
listConnectionProfilesCallable
public final UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesResponse> listConnectionProfilesCallable()Retrieves a list of all connection profiles in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConnectionProfilesRequest request = ListConnectionProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListConnectionProfilesResponse response = dataMigrationServiceClient.listConnectionProfilesCallable().call(request); for (ConnectionProfile element : response.getConnectionProfilesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getConnectionProfile
Gets details of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConnectionProfileName name = ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]"); ConnectionProfile response = dataMigrationServiceClient.getConnectionProfile(name); }- Parameters:
name- Required. Name of the connection profile resource to get.- Throws:
ApiException- if the remote call fails
-
getConnectionProfile
Gets details of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]").toString(); ConnectionProfile response = dataMigrationServiceClient.getConnectionProfile(name); }- Parameters:
name- Required. Name of the connection profile resource to get.- Throws:
ApiException- if the remote call fails
-
getConnectionProfile
Gets details of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetConnectionProfileRequest request = GetConnectionProfileRequest.newBuilder() .setName( ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]") .toString()) .build(); ConnectionProfile response = dataMigrationServiceClient.getConnectionProfile(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getConnectionProfileCallable
public final UnaryCallable<GetConnectionProfileRequest,ConnectionProfile> getConnectionProfileCallable()Gets details of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetConnectionProfileRequest request = GetConnectionProfileRequest.newBuilder() .setName( ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]") .toString()) .build(); ApiFuture<ConnectionProfile> future = dataMigrationServiceClient.getConnectionProfileCallable().futureCall(request); // Do something. ConnectionProfile response = future.get(); } -
createConnectionProfileAsync
public final OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(LocationName parent, ConnectionProfile connectionProfile, String connectionProfileId) Creates a new connection profile in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build(); String connectionProfileId = "connectionProfileId597575526"; ConnectionProfile response = dataMigrationServiceClient .createConnectionProfileAsync(parent, connectionProfile, connectionProfileId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of connection profiles.connectionProfile- Required. The create request body including the connection profile dataconnectionProfileId- Required. The connection profile identifier.- Throws:
ApiException- if the remote call fails
-
createConnectionProfileAsync
public final OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(String parent, ConnectionProfile connectionProfile, String connectionProfileId) Creates a new connection profile in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build(); String connectionProfileId = "connectionProfileId597575526"; ConnectionProfile response = dataMigrationServiceClient .createConnectionProfileAsync(parent, connectionProfile, connectionProfileId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of connection profiles.connectionProfile- Required. The create request body including the connection profile dataconnectionProfileId- Required. The connection profile identifier.- Throws:
ApiException- if the remote call fails
-
createConnectionProfileAsync
public final OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(CreateConnectionProfileRequest request) Creates a new connection profile in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConnectionProfileRequest request = CreateConnectionProfileRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectionProfileId("connectionProfileId597575526") .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); ConnectionProfile response = dataMigrationServiceClient.createConnectionProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createConnectionProfileOperationCallable
public final OperationCallable<CreateConnectionProfileRequest,ConnectionProfile, createConnectionProfileOperationCallable()OperationMetadata> Creates a new connection profile in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConnectionProfileRequest request = CreateConnectionProfileRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectionProfileId("connectionProfileId597575526") .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); OperationFuture<ConnectionProfile, OperationMetadata> future = dataMigrationServiceClient.createConnectionProfileOperationCallable().futureCall(request); // Do something. ConnectionProfile response = future.get(); } -
createConnectionProfileCallable
public final UnaryCallable<CreateConnectionProfileRequest,Operation> createConnectionProfileCallable()Creates a new connection profile in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConnectionProfileRequest request = CreateConnectionProfileRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConnectionProfileId("connectionProfileId597575526") .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.createConnectionProfileCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateConnectionProfileAsync
public final OperationFuture<ConnectionProfile,OperationMetadata> updateConnectionProfileAsync(ConnectionProfile connectionProfile, com.google.protobuf.FieldMask updateMask) Update the configuration of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ConnectionProfile response = dataMigrationServiceClient .updateConnectionProfileAsync(connectionProfile, updateMask) .get(); }- Parameters:
connectionProfile- Required. The connection profile parameters to update.updateMask- Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.- Throws:
ApiException- if the remote call fails
-
updateConnectionProfileAsync
public final OperationFuture<ConnectionProfile,OperationMetadata> updateConnectionProfileAsync(UpdateConnectionProfileRequest request) Update the configuration of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConnectionProfileRequest request = UpdateConnectionProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); ConnectionProfile response = dataMigrationServiceClient.updateConnectionProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateConnectionProfileOperationCallable
public final OperationCallable<UpdateConnectionProfileRequest,ConnectionProfile, updateConnectionProfileOperationCallable()OperationMetadata> Update the configuration of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConnectionProfileRequest request = UpdateConnectionProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); OperationFuture<ConnectionProfile, OperationMetadata> future = dataMigrationServiceClient.updateConnectionProfileOperationCallable().futureCall(request); // Do something. ConnectionProfile response = future.get(); } -
updateConnectionProfileCallable
public final UnaryCallable<UpdateConnectionProfileRequest,Operation> updateConnectionProfileCallable()Update the configuration of a single connection profile.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConnectionProfileRequest request = UpdateConnectionProfileRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConnectionProfile(ConnectionProfile.newBuilder().build()) .setRequestId("requestId693933066") .setValidateOnly(true) .setSkipValidation(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.updateConnectionProfileCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteConnectionProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(ConnectionProfileName name) Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConnectionProfileName name = ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]"); dataMigrationServiceClient.deleteConnectionProfileAsync(name).get(); }- Parameters:
name- Required. Name of the connection profile resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteConnectionProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(String name) Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]").toString(); dataMigrationServiceClient.deleteConnectionProfileAsync(name).get(); }- Parameters:
name- Required. Name of the connection profile resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteConnectionProfileAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(DeleteConnectionProfileRequest request) Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConnectionProfileRequest request = DeleteConnectionProfileRequest.newBuilder() .setName( ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); dataMigrationServiceClient.deleteConnectionProfileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteConnectionProfileOperationCallable
public final OperationCallable<DeleteConnectionProfileRequest,com.google.protobuf.Empty, deleteConnectionProfileOperationCallable()OperationMetadata> Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConnectionProfileRequest request = DeleteConnectionProfileRequest.newBuilder() .setName( ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = dataMigrationServiceClient.deleteConnectionProfileOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteConnectionProfileCallable
public final UnaryCallable<DeleteConnectionProfileRequest,Operation> deleteConnectionProfileCallable()Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConnectionProfileRequest request = DeleteConnectionProfileRequest.newBuilder() .setName( ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.deleteConnectionProfileCallable().futureCall(request); // Do something. future.get(); } -
createPrivateConnectionAsync
public final OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(LocationName parent, PrivateConnection privateConnection, String privateConnectionId) Creates a new private connection in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); PrivateConnection privateConnection = PrivateConnection.newBuilder().build(); String privateConnectionId = "privateConnectionId-1926654532"; PrivateConnection response = dataMigrationServiceClient .createPrivateConnectionAsync(parent, privateConnection, privateConnectionId) .get(); }- Parameters:
parent- Required. The parent that owns the collection of PrivateConnections.privateConnection- Required. The private connection resource to create.privateConnectionId- Required. The private connection identifier.- Throws:
ApiException- if the remote call fails
-
createPrivateConnectionAsync
public final OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(String parent, PrivateConnection privateConnection, String privateConnectionId) Creates a new private connection in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); PrivateConnection privateConnection = PrivateConnection.newBuilder().build(); String privateConnectionId = "privateConnectionId-1926654532"; PrivateConnection response = dataMigrationServiceClient .createPrivateConnectionAsync(parent, privateConnection, privateConnectionId) .get(); }- Parameters:
parent- Required. The parent that owns the collection of PrivateConnections.privateConnection- Required. The private connection resource to create.privateConnectionId- Required. The private connection identifier.- Throws:
ApiException- if the remote call fails
-
createPrivateConnectionAsync
public final OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(CreatePrivateConnectionRequest request) Creates a new private connection in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreatePrivateConnectionRequest request = CreatePrivateConnectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPrivateConnectionId("privateConnectionId-1926654532") .setPrivateConnection(PrivateConnection.newBuilder().build()) .setRequestId("requestId693933066") .setSkipValidation(true) .build(); PrivateConnection response = dataMigrationServiceClient.createPrivateConnectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createPrivateConnectionOperationCallable
public final OperationCallable<CreatePrivateConnectionRequest,PrivateConnection, createPrivateConnectionOperationCallable()OperationMetadata> Creates a new private connection in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreatePrivateConnectionRequest request = CreatePrivateConnectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPrivateConnectionId("privateConnectionId-1926654532") .setPrivateConnection(PrivateConnection.newBuilder().build()) .setRequestId("requestId693933066") .setSkipValidation(true) .build(); OperationFuture<PrivateConnection, OperationMetadata> future = dataMigrationServiceClient.createPrivateConnectionOperationCallable().futureCall(request); // Do something. PrivateConnection response = future.get(); } -
createPrivateConnectionCallable
public final UnaryCallable<CreatePrivateConnectionRequest,Operation> createPrivateConnectionCallable()Creates a new private connection in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreatePrivateConnectionRequest request = CreatePrivateConnectionRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPrivateConnectionId("privateConnectionId-1926654532") .setPrivateConnection(PrivateConnection.newBuilder().build()) .setRequestId("requestId693933066") .setSkipValidation(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.createPrivateConnectionCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getPrivateConnection
Gets details of a single private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { PrivateConnectionName name = PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]"); PrivateConnection response = dataMigrationServiceClient.getPrivateConnection(name); }- Parameters:
name- Required. The name of the private connection to get.- Throws:
ApiException- if the remote call fails
-
getPrivateConnection
Gets details of a single private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString(); PrivateConnection response = dataMigrationServiceClient.getPrivateConnection(name); }- Parameters:
name- Required. The name of the private connection to get.- Throws:
ApiException- if the remote call fails
-
getPrivateConnection
Gets details of a single private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetPrivateConnectionRequest request = GetPrivateConnectionRequest.newBuilder() .setName( PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]") .toString()) .build(); PrivateConnection response = dataMigrationServiceClient.getPrivateConnection(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getPrivateConnectionCallable
public final UnaryCallable<GetPrivateConnectionRequest,PrivateConnection> getPrivateConnectionCallable()Gets details of a single private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetPrivateConnectionRequest request = GetPrivateConnectionRequest.newBuilder() .setName( PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]") .toString()) .build(); ApiFuture<PrivateConnection> future = dataMigrationServiceClient.getPrivateConnectionCallable().futureCall(request); // Do something. PrivateConnection response = future.get(); } -
listPrivateConnections
public final DataMigrationServiceClient.ListPrivateConnectionsPagedResponse listPrivateConnections(LocationName parent) Retrieves a list of private connections in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (PrivateConnection element : dataMigrationServiceClient.listPrivateConnections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent that owns the collection of private connections.- Throws:
ApiException- if the remote call fails
-
listPrivateConnections
public final DataMigrationServiceClient.ListPrivateConnectionsPagedResponse listPrivateConnections(String parent) Retrieves a list of private connections in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (PrivateConnection element : dataMigrationServiceClient.listPrivateConnections(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent that owns the collection of private connections.- Throws:
ApiException- if the remote call fails
-
listPrivateConnections
public final DataMigrationServiceClient.ListPrivateConnectionsPagedResponse listPrivateConnections(ListPrivateConnectionsRequest request) Retrieves a list of private connections in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListPrivateConnectionsRequest request = ListPrivateConnectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (PrivateConnection element : dataMigrationServiceClient.listPrivateConnections(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listPrivateConnectionsPagedCallable
public final UnaryCallable<ListPrivateConnectionsRequest,DataMigrationServiceClient.ListPrivateConnectionsPagedResponse> listPrivateConnectionsPagedCallable()Retrieves a list of private connections in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListPrivateConnectionsRequest request = ListPrivateConnectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<PrivateConnection> future = dataMigrationServiceClient.listPrivateConnectionsPagedCallable().futureCall(request); // Do something. for (PrivateConnection element : future.get().iterateAll()) { // doThingsWith(element); } } -
listPrivateConnectionsCallable
public final UnaryCallable<ListPrivateConnectionsRequest,ListPrivateConnectionsResponse> listPrivateConnectionsCallable()Retrieves a list of private connections in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListPrivateConnectionsRequest request = ListPrivateConnectionsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListPrivateConnectionsResponse response = dataMigrationServiceClient.listPrivateConnectionsCallable().call(request); for (PrivateConnection element : response.getPrivateConnectionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deletePrivateConnectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(PrivateConnectionName name) Deletes a single Database Migration Service private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { PrivateConnectionName name = PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]"); dataMigrationServiceClient.deletePrivateConnectionAsync(name).get(); }- Parameters:
name- Required. The name of the private connection to delete.- Throws:
ApiException- if the remote call fails
-
deletePrivateConnectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(String name) Deletes a single Database Migration Service private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString(); dataMigrationServiceClient.deletePrivateConnectionAsync(name).get(); }- Parameters:
name- Required. The name of the private connection to delete.- Throws:
ApiException- if the remote call fails
-
deletePrivateConnectionAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(DeletePrivateConnectionRequest request) Deletes a single Database Migration Service private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeletePrivateConnectionRequest request = DeletePrivateConnectionRequest.newBuilder() .setName( PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]") .toString()) .setRequestId("requestId693933066") .build(); dataMigrationServiceClient.deletePrivateConnectionAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deletePrivateConnectionOperationCallable
public final OperationCallable<DeletePrivateConnectionRequest,com.google.protobuf.Empty, deletePrivateConnectionOperationCallable()OperationMetadata> Deletes a single Database Migration Service private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeletePrivateConnectionRequest request = DeletePrivateConnectionRequest.newBuilder() .setName( PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = dataMigrationServiceClient.deletePrivateConnectionOperationCallable().futureCall(request); // Do something. future.get(); } -
deletePrivateConnectionCallable
public final UnaryCallable<DeletePrivateConnectionRequest,Operation> deletePrivateConnectionCallable()Deletes a single Database Migration Service private connection.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeletePrivateConnectionRequest request = DeletePrivateConnectionRequest.newBuilder() .setName( PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.deletePrivateConnectionCallable().futureCall(request); // Do something. future.get(); } -
getConversionWorkspace
Gets details of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspaceName name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]"); ConversionWorkspace response = dataMigrationServiceClient.getConversionWorkspace(name); }- Parameters:
name- Required. Name of the conversion workspace resource to get.- Throws:
ApiException- if the remote call fails
-
getConversionWorkspace
Gets details of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString(); ConversionWorkspace response = dataMigrationServiceClient.getConversionWorkspace(name); }- Parameters:
name- Required. Name of the conversion workspace resource to get.- Throws:
ApiException- if the remote call fails
-
getConversionWorkspace
Gets details of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetConversionWorkspaceRequest request = GetConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .build(); ConversionWorkspace response = dataMigrationServiceClient.getConversionWorkspace(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getConversionWorkspaceCallable
public final UnaryCallable<GetConversionWorkspaceRequest,ConversionWorkspace> getConversionWorkspaceCallable()Gets details of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetConversionWorkspaceRequest request = GetConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .build(); ApiFuture<ConversionWorkspace> future = dataMigrationServiceClient.getConversionWorkspaceCallable().futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
listConversionWorkspaces
public final DataMigrationServiceClient.ListConversionWorkspacesPagedResponse listConversionWorkspaces(LocationName parent) Lists conversion workspaces in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ConversionWorkspace element : dataMigrationServiceClient.listConversionWorkspaces(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of conversion workspaces.- Throws:
ApiException- if the remote call fails
-
listConversionWorkspaces
public final DataMigrationServiceClient.ListConversionWorkspacesPagedResponse listConversionWorkspaces(String parent) Lists conversion workspaces in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ConversionWorkspace element : dataMigrationServiceClient.listConversionWorkspaces(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent which owns this collection of conversion workspaces.- Throws:
ApiException- if the remote call fails
-
listConversionWorkspaces
public final DataMigrationServiceClient.ListConversionWorkspacesPagedResponse listConversionWorkspaces(ListConversionWorkspacesRequest request) Lists conversion workspaces in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConversionWorkspacesRequest request = ListConversionWorkspacesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (ConversionWorkspace element : dataMigrationServiceClient.listConversionWorkspaces(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listConversionWorkspacesPagedCallable
public final UnaryCallable<ListConversionWorkspacesRequest,DataMigrationServiceClient.ListConversionWorkspacesPagedResponse> listConversionWorkspacesPagedCallable()Lists conversion workspaces in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConversionWorkspacesRequest request = ListConversionWorkspacesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<ConversionWorkspace> future = dataMigrationServiceClient.listConversionWorkspacesPagedCallable().futureCall(request); // Do something. for (ConversionWorkspace element : future.get().iterateAll()) { // doThingsWith(element); } } -
listConversionWorkspacesCallable
public final UnaryCallable<ListConversionWorkspacesRequest,ListConversionWorkspacesResponse> listConversionWorkspacesCallable()Lists conversion workspaces in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListConversionWorkspacesRequest request = ListConversionWorkspacesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListConversionWorkspacesResponse response = dataMigrationServiceClient.listConversionWorkspacesCallable().call(request); for (ConversionWorkspace element : response.getConversionWorkspacesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> createConversionWorkspaceAsync(LocationName parent, ConversionWorkspace conversionWorkspace, String conversionWorkspaceId) Creates a new conversion workspace in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ConversionWorkspace conversionWorkspace = ConversionWorkspace.newBuilder().build(); String conversionWorkspaceId = "conversionWorkspaceId-928604774"; ConversionWorkspace response = dataMigrationServiceClient .createConversionWorkspaceAsync(parent, conversionWorkspace, conversionWorkspaceId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of conversion workspaces.conversionWorkspace- Required. Represents a conversion workspace object.conversionWorkspaceId- Required. The ID of the conversion workspace to create.- Throws:
ApiException- if the remote call fails
-
createConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> createConversionWorkspaceAsync(String parent, ConversionWorkspace conversionWorkspace, String conversionWorkspaceId) Creates a new conversion workspace in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ConversionWorkspace conversionWorkspace = ConversionWorkspace.newBuilder().build(); String conversionWorkspaceId = "conversionWorkspaceId-928604774"; ConversionWorkspace response = dataMigrationServiceClient .createConversionWorkspaceAsync(parent, conversionWorkspace, conversionWorkspaceId) .get(); }- Parameters:
parent- Required. The parent which owns this collection of conversion workspaces.conversionWorkspace- Required. Represents a conversion workspace object.conversionWorkspaceId- Required. The ID of the conversion workspace to create.- Throws:
ApiException- if the remote call fails
-
createConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> createConversionWorkspaceAsync(CreateConversionWorkspaceRequest request) Creates a new conversion workspace in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConversionWorkspaceRequest request = CreateConversionWorkspaceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConversionWorkspaceId("conversionWorkspaceId-928604774") .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); ConversionWorkspace response = dataMigrationServiceClient.createConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createConversionWorkspaceOperationCallable
public final OperationCallable<CreateConversionWorkspaceRequest,ConversionWorkspace, createConversionWorkspaceOperationCallable()OperationMetadata> Creates a new conversion workspace in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConversionWorkspaceRequest request = CreateConversionWorkspaceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConversionWorkspaceId("conversionWorkspaceId-928604774") .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .createConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
createConversionWorkspaceCallable
public final UnaryCallable<CreateConversionWorkspaceRequest,Operation> createConversionWorkspaceCallable()Creates a new conversion workspace in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateConversionWorkspaceRequest request = CreateConversionWorkspaceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConversionWorkspaceId("conversionWorkspaceId-928604774") .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.createConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> updateConversionWorkspaceAsync(ConversionWorkspace conversionWorkspace, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspace conversionWorkspace = ConversionWorkspace.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ConversionWorkspace response = dataMigrationServiceClient .updateConversionWorkspaceAsync(conversionWorkspace, updateMask) .get(); }- Parameters:
conversionWorkspace- Required. The conversion workspace parameters to update.updateMask- Required. Field mask is used to specify the fields to be overwritten by the update in the conversion workspace resource.- Throws:
ApiException- if the remote call fails
-
updateConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> updateConversionWorkspaceAsync(UpdateConversionWorkspaceRequest request) Updates the parameters of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConversionWorkspaceRequest request = UpdateConversionWorkspaceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); ConversionWorkspace response = dataMigrationServiceClient.updateConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateConversionWorkspaceOperationCallable
public final OperationCallable<UpdateConversionWorkspaceRequest,ConversionWorkspace, updateConversionWorkspaceOperationCallable()OperationMetadata> Updates the parameters of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConversionWorkspaceRequest request = UpdateConversionWorkspaceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .updateConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
updateConversionWorkspaceCallable
public final UnaryCallable<UpdateConversionWorkspaceRequest,Operation> updateConversionWorkspaceCallable()Updates the parameters of a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { UpdateConversionWorkspaceRequest request = UpdateConversionWorkspaceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConversionWorkspace(ConversionWorkspace.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.updateConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteConversionWorkspaceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConversionWorkspaceAsync(ConversionWorkspaceName name) Deletes a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspaceName name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]"); dataMigrationServiceClient.deleteConversionWorkspaceAsync(name).get(); }- Parameters:
name- Required. Name of the conversion workspace resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteConversionWorkspaceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConversionWorkspaceAsync(String name) Deletes a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString(); dataMigrationServiceClient.deleteConversionWorkspaceAsync(name).get(); }- Parameters:
name- Required. Name of the conversion workspace resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteConversionWorkspaceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConversionWorkspaceAsync(DeleteConversionWorkspaceRequest request) Deletes a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConversionWorkspaceRequest request = DeleteConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); dataMigrationServiceClient.deleteConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteConversionWorkspaceOperationCallable
public final OperationCallable<DeleteConversionWorkspaceRequest,com.google.protobuf.Empty, deleteConversionWorkspaceOperationCallable()OperationMetadata> Deletes a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConversionWorkspaceRequest request = DeleteConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = dataMigrationServiceClient .deleteConversionWorkspaceOperationCallable() .futureCall(request); // Do something. future.get(); } -
deleteConversionWorkspaceCallable
public final UnaryCallable<DeleteConversionWorkspaceRequest,Operation> deleteConversionWorkspaceCallable()Deletes a single conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteConversionWorkspaceRequest request = DeleteConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRequestId("requestId693933066") .setForce(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.deleteConversionWorkspaceCallable().futureCall(request); // Do something. future.get(); } -
createMappingRule
public final MappingRule createMappingRule(ConversionWorkspaceName parent, MappingRule mappingRule, String mappingRuleId) Creates a new mapping rule for a given conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspaceName parent = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]"); MappingRule mappingRule = MappingRule.newBuilder().build(); String mappingRuleId = "mappingRuleId-900824155"; MappingRule response = dataMigrationServiceClient.createMappingRule(parent, mappingRule, mappingRuleId); }- Parameters:
parent- Required. The parent which owns this collection of mapping rules.mappingRule- Required. Represents a [mapping rule] (https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules) object.mappingRuleId- Required. The ID of the rule to create.- Throws:
ApiException- if the remote call fails
-
createMappingRule
public final MappingRule createMappingRule(String parent, MappingRule mappingRule, String mappingRuleId) Creates a new mapping rule for a given conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString(); MappingRule mappingRule = MappingRule.newBuilder().build(); String mappingRuleId = "mappingRuleId-900824155"; MappingRule response = dataMigrationServiceClient.createMappingRule(parent, mappingRule, mappingRuleId); }- Parameters:
parent- Required. The parent which owns this collection of mapping rules.mappingRule- Required. Represents a [mapping rule] (https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules) object.mappingRuleId- Required. The ID of the rule to create.- Throws:
ApiException- if the remote call fails
-
createMappingRule
Creates a new mapping rule for a given conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateMappingRuleRequest request = CreateMappingRuleRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setMappingRuleId("mappingRuleId-900824155") .setMappingRule(MappingRule.newBuilder().build()) .setRequestId("requestId693933066") .build(); MappingRule response = dataMigrationServiceClient.createMappingRule(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createMappingRuleCallable
Creates a new mapping rule for a given conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CreateMappingRuleRequest request = CreateMappingRuleRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setMappingRuleId("mappingRuleId-900824155") .setMappingRule(MappingRule.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<MappingRule> future = dataMigrationServiceClient.createMappingRuleCallable().futureCall(request); // Do something. MappingRule response = future.get(); } -
deleteMappingRule
Deletes a single mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspaceName name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]"); dataMigrationServiceClient.deleteMappingRule(name); }- Parameters:
name- Required. Name of the mapping rule resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteMappingRule
Deletes a single mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString(); dataMigrationServiceClient.deleteMappingRule(name); }- Parameters:
name- Required. Name of the mapping rule resource to delete.- Throws:
ApiException- if the remote call fails
-
deleteMappingRule
Deletes a single mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteMappingRuleRequest request = DeleteMappingRuleRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRequestId("requestId693933066") .build(); dataMigrationServiceClient.deleteMappingRule(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteMappingRuleCallable
public final UnaryCallable<DeleteMappingRuleRequest,com.google.protobuf.Empty> deleteMappingRuleCallable()Deletes a single mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DeleteMappingRuleRequest request = DeleteMappingRuleRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Empty> future = dataMigrationServiceClient.deleteMappingRuleCallable().futureCall(request); // Do something. future.get(); } -
listMappingRules
public final DataMigrationServiceClient.ListMappingRulesPagedResponse listMappingRules(ConversionWorkspaceName parent) Lists the mapping rules for a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConversionWorkspaceName parent = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]"); for (MappingRule element : dataMigrationServiceClient.listMappingRules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the conversion workspace resource whose mapping rules are listed in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.- Throws:
ApiException- if the remote call fails
-
listMappingRules
public final DataMigrationServiceClient.ListMappingRulesPagedResponse listMappingRules(String parent) Lists the mapping rules for a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String parent = ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString(); for (MappingRule element : dataMigrationServiceClient.listMappingRules(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the conversion workspace resource whose mapping rules are listed in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.- Throws:
ApiException- if the remote call fails
-
listMappingRules
public final DataMigrationServiceClient.ListMappingRulesPagedResponse listMappingRules(ListMappingRulesRequest request) Lists the mapping rules for a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMappingRulesRequest request = ListMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (MappingRule element : dataMigrationServiceClient.listMappingRules(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listMappingRulesPagedCallable
public final UnaryCallable<ListMappingRulesRequest,DataMigrationServiceClient.ListMappingRulesPagedResponse> listMappingRulesPagedCallable()Lists the mapping rules for a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMappingRulesRequest request = ListMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<MappingRule> future = dataMigrationServiceClient.listMappingRulesPagedCallable().futureCall(request); // Do something. for (MappingRule element : future.get().iterateAll()) { // doThingsWith(element); } } -
listMappingRulesCallable
public final UnaryCallable<ListMappingRulesRequest,ListMappingRulesResponse> listMappingRulesCallable()Lists the mapping rules for a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ListMappingRulesRequest request = ListMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListMappingRulesResponse response = dataMigrationServiceClient.listMappingRulesCallable().call(request); for (MappingRule element : response.getMappingRulesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getMappingRule
Gets the details of a mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { MappingRuleName name = MappingRuleName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]", "[MAPPING_RULE]"); MappingRule response = dataMigrationServiceClient.getMappingRule(name); }- Parameters:
name- Required. Name of the mapping rule resource to get. Example: conversionWorkspaces/123/mappingRules/rule123In order to retrieve a previous revision of the mapping rule, also provide the revision ID. Example: conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
- Throws:
ApiException- if the remote call fails
-
getMappingRule
Gets the details of a mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = MappingRuleName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]", "[MAPPING_RULE]") .toString(); MappingRule response = dataMigrationServiceClient.getMappingRule(name); }- Parameters:
name- Required. Name of the mapping rule resource to get. Example: conversionWorkspaces/123/mappingRules/rule123In order to retrieve a previous revision of the mapping rule, also provide the revision ID. Example: conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
- Throws:
ApiException- if the remote call fails
-
getMappingRule
Gets the details of a mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetMappingRuleRequest request = GetMappingRuleRequest.newBuilder() .setName( MappingRuleName.of( "[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]", "[MAPPING_RULE]") .toString()) .build(); MappingRule response = dataMigrationServiceClient.getMappingRule(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getMappingRuleCallable
Gets the details of a mapping rule.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { GetMappingRuleRequest request = GetMappingRuleRequest.newBuilder() .setName( MappingRuleName.of( "[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]", "[MAPPING_RULE]") .toString()) .build(); ApiFuture<MappingRule> future = dataMigrationServiceClient.getMappingRuleCallable().futureCall(request); // Do something. MappingRule response = future.get(); } -
seedConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> seedConversionWorkspaceAsync(SeedConversionWorkspaceRequest request) Imports a snapshot of the source database into the conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { SeedConversionWorkspaceRequest request = SeedConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .build(); ConversionWorkspace response = dataMigrationServiceClient.seedConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
seedConversionWorkspaceOperationCallable
public final OperationCallable<SeedConversionWorkspaceRequest,ConversionWorkspace, seedConversionWorkspaceOperationCallable()OperationMetadata> Imports a snapshot of the source database into the conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { SeedConversionWorkspaceRequest request = SeedConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient.seedConversionWorkspaceOperationCallable().futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
seedConversionWorkspaceCallable
public final UnaryCallable<SeedConversionWorkspaceRequest,Operation> seedConversionWorkspaceCallable()Imports a snapshot of the source database into the conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { SeedConversionWorkspaceRequest request = SeedConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.seedConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
importMappingRulesAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> importMappingRulesAsync(ImportMappingRulesRequest request) Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ImportMappingRulesRequest request = ImportMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRulesFormat(ImportRulesFileFormat.forNumber(0)) .addAllRulesFiles(new ArrayList<ImportMappingRulesRequest.RulesFile>()) .setAutoCommit(true) .build(); ConversionWorkspace response = dataMigrationServiceClient.importMappingRulesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importMappingRulesOperationCallable
public final OperationCallable<ImportMappingRulesRequest,ConversionWorkspace, importMappingRulesOperationCallable()OperationMetadata> Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ImportMappingRulesRequest request = ImportMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRulesFormat(ImportRulesFileFormat.forNumber(0)) .addAllRulesFiles(new ArrayList<ImportMappingRulesRequest.RulesFile>()) .setAutoCommit(true) .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient.importMappingRulesOperationCallable().futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
importMappingRulesCallable
Imports the mapping rules for a given conversion workspace. Supports various formats of external rules files.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ImportMappingRulesRequest request = ImportMappingRulesRequest.newBuilder() .setParent( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setRulesFormat(ImportRulesFileFormat.forNumber(0)) .addAllRulesFiles(new ArrayList<ImportMappingRulesRequest.RulesFile>()) .setAutoCommit(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.importMappingRulesCallable().futureCall(request); // Do something. Operation response = future.get(); } -
convertConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> convertConversionWorkspaceAsync(ConvertConversionWorkspaceRequest request) Creates a draft tree schema for the destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConvertConversionWorkspaceRequest request = ConvertConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .setFilter("filter-1274492040") .setConvertFullPath(true) .build(); ConversionWorkspace response = dataMigrationServiceClient.convertConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
convertConversionWorkspaceOperationCallable
public final OperationCallable<ConvertConversionWorkspaceRequest,ConversionWorkspace, convertConversionWorkspaceOperationCallable()OperationMetadata> Creates a draft tree schema for the destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConvertConversionWorkspaceRequest request = ConvertConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .setFilter("filter-1274492040") .setConvertFullPath(true) .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .convertConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
convertConversionWorkspaceCallable
public final UnaryCallable<ConvertConversionWorkspaceRequest,Operation> convertConversionWorkspaceCallable()Creates a draft tree schema for the destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ConvertConversionWorkspaceRequest request = ConvertConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setAutoCommit(true) .setFilter("filter-1274492040") .setConvertFullPath(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.convertConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
commitConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> commitConversionWorkspaceAsync(CommitConversionWorkspaceRequest request) Marks all the data in the conversion workspace as committed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CommitConversionWorkspaceRequest request = CommitConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setCommitName("commitName1018078306") .build(); ConversionWorkspace response = dataMigrationServiceClient.commitConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
commitConversionWorkspaceOperationCallable
public final OperationCallable<CommitConversionWorkspaceRequest,ConversionWorkspace, commitConversionWorkspaceOperationCallable()OperationMetadata> Marks all the data in the conversion workspace as committed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CommitConversionWorkspaceRequest request = CommitConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setCommitName("commitName1018078306") .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .commitConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
commitConversionWorkspaceCallable
public final UnaryCallable<CommitConversionWorkspaceRequest,Operation> commitConversionWorkspaceCallable()Marks all the data in the conversion workspace as committed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { CommitConversionWorkspaceRequest request = CommitConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setCommitName("commitName1018078306") .build(); ApiFuture<Operation> future = dataMigrationServiceClient.commitConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
rollbackConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> rollbackConversionWorkspaceAsync(RollbackConversionWorkspaceRequest request) Rolls back a conversion workspace to the last committed snapshot.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RollbackConversionWorkspaceRequest request = RollbackConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .build(); ConversionWorkspace response = dataMigrationServiceClient.rollbackConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
rollbackConversionWorkspaceOperationCallable
public final OperationCallable<RollbackConversionWorkspaceRequest,ConversionWorkspace, rollbackConversionWorkspaceOperationCallable()OperationMetadata> Rolls back a conversion workspace to the last committed snapshot.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RollbackConversionWorkspaceRequest request = RollbackConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .rollbackConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
rollbackConversionWorkspaceCallable
public final UnaryCallable<RollbackConversionWorkspaceRequest,Operation> rollbackConversionWorkspaceCallable()Rolls back a conversion workspace to the last committed snapshot.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { RollbackConversionWorkspaceRequest request = RollbackConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.rollbackConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
applyConversionWorkspaceAsync
public final OperationFuture<ConversionWorkspace,OperationMetadata> applyConversionWorkspaceAsync(ApplyConversionWorkspaceRequest request) Applies draft tree onto a specific destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ApplyConversionWorkspaceRequest request = ApplyConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setFilter("filter-1274492040") .setDryRun(true) .setAutoCommit(true) .build(); ConversionWorkspace response = dataMigrationServiceClient.applyConversionWorkspaceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
applyConversionWorkspaceOperationCallable
public final OperationCallable<ApplyConversionWorkspaceRequest,ConversionWorkspace, applyConversionWorkspaceOperationCallable()OperationMetadata> Applies draft tree onto a specific destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ApplyConversionWorkspaceRequest request = ApplyConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setFilter("filter-1274492040") .setDryRun(true) .setAutoCommit(true) .build(); OperationFuture<ConversionWorkspace, OperationMetadata> future = dataMigrationServiceClient .applyConversionWorkspaceOperationCallable() .futureCall(request); // Do something. ConversionWorkspace response = future.get(); } -
applyConversionWorkspaceCallable
public final UnaryCallable<ApplyConversionWorkspaceRequest,Operation> applyConversionWorkspaceCallable()Applies draft tree onto a specific destination database.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { ApplyConversionWorkspaceRequest request = ApplyConversionWorkspaceRequest.newBuilder() .setName( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setFilter("filter-1274492040") .setDryRun(true) .setAutoCommit(true) .build(); ApiFuture<Operation> future = dataMigrationServiceClient.applyConversionWorkspaceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
describeDatabaseEntities
public final DataMigrationServiceClient.DescribeDatabaseEntitiesPagedResponse describeDatabaseEntities(DescribeDatabaseEntitiesRequest request) Describes the database entities tree for a specific conversion workspace and a specific tree type.Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DescribeDatabaseEntitiesRequest request = DescribeDatabaseEntitiesRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setUncommitted(true) .setCommitId("commitId-602292046") .setFilter("filter-1274492040") .setView(DatabaseEntityView.forNumber(0)) .build(); for (DatabaseEntity element : dataMigrationServiceClient.describeDatabaseEntities(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
describeDatabaseEntitiesPagedCallable
public final UnaryCallable<DescribeDatabaseEntitiesRequest,DataMigrationServiceClient.DescribeDatabaseEntitiesPagedResponse> describeDatabaseEntitiesPagedCallable()Describes the database entities tree for a specific conversion workspace and a specific tree type.Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DescribeDatabaseEntitiesRequest request = DescribeDatabaseEntitiesRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setUncommitted(true) .setCommitId("commitId-602292046") .setFilter("filter-1274492040") .setView(DatabaseEntityView.forNumber(0)) .build(); ApiFuture<DatabaseEntity> future = dataMigrationServiceClient.describeDatabaseEntitiesPagedCallable().futureCall(request); // Do something. for (DatabaseEntity element : future.get().iterateAll()) { // doThingsWith(element); } } -
describeDatabaseEntitiesCallable
public final UnaryCallable<DescribeDatabaseEntitiesRequest,DescribeDatabaseEntitiesResponse> describeDatabaseEntitiesCallable()Describes the database entities tree for a specific conversion workspace and a specific tree type.Database entities are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are simple data objects describing the structure of the client database.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DescribeDatabaseEntitiesRequest request = DescribeDatabaseEntitiesRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setUncommitted(true) .setCommitId("commitId-602292046") .setFilter("filter-1274492040") .setView(DatabaseEntityView.forNumber(0)) .build(); while (true) { DescribeDatabaseEntitiesResponse response = dataMigrationServiceClient.describeDatabaseEntitiesCallable().call(request); for (DatabaseEntity element : response.getDatabaseEntitiesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
searchBackgroundJobs
Searches/lists the background jobs for a specific conversion workspace.The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { SearchBackgroundJobsRequest request = SearchBackgroundJobsRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setReturnMostRecentPerJobType(true) .setMaxSize(408072700) .setCompletedUntilTime(Timestamp.newBuilder().build()) .build(); SearchBackgroundJobsResponse response = dataMigrationServiceClient.searchBackgroundJobs(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
searchBackgroundJobsCallable
public final UnaryCallable<SearchBackgroundJobsRequest,SearchBackgroundJobsResponse> searchBackgroundJobsCallable()Searches/lists the background jobs for a specific conversion workspace.The background jobs are not resources like conversion workspaces or mapping rules, and they can't be created, updated or deleted. Instead, they are a way to expose the data plane jobs log.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { SearchBackgroundJobsRequest request = SearchBackgroundJobsRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setReturnMostRecentPerJobType(true) .setMaxSize(408072700) .setCompletedUntilTime(Timestamp.newBuilder().build()) .build(); ApiFuture<SearchBackgroundJobsResponse> future = dataMigrationServiceClient.searchBackgroundJobsCallable().futureCall(request); // Do something. SearchBackgroundJobsResponse response = future.get(); } -
describeConversionWorkspaceRevisions
public final DescribeConversionWorkspaceRevisionsResponse describeConversionWorkspaceRevisions(DescribeConversionWorkspaceRevisionsRequest request) Retrieves a list of committed revisions of a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DescribeConversionWorkspaceRevisionsRequest request = DescribeConversionWorkspaceRevisionsRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setCommitId("commitId-602292046") .build(); DescribeConversionWorkspaceRevisionsResponse response = dataMigrationServiceClient.describeConversionWorkspaceRevisions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
describeConversionWorkspaceRevisionsCallable
public final UnaryCallable<DescribeConversionWorkspaceRevisionsRequest,DescribeConversionWorkspaceRevisionsResponse> describeConversionWorkspaceRevisionsCallable()Retrieves a list of committed revisions of a specific conversion workspace.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { DescribeConversionWorkspaceRevisionsRequest request = DescribeConversionWorkspaceRevisionsRequest.newBuilder() .setConversionWorkspace( ConversionWorkspaceName.of("[PROJECT]", "[LOCATION]", "[CONVERSION_WORKSPACE]") .toString()) .setCommitId("commitId-602292046") .build(); ApiFuture<DescribeConversionWorkspaceRevisionsResponse> future = dataMigrationServiceClient .describeConversionWorkspaceRevisionsCallable() .futureCall(request); // Do something. DescribeConversionWorkspaceRevisionsResponse response = future.get(); } -
fetchStaticIps
public final DataMigrationServiceClient.FetchStaticIpsPagedResponse fetchStaticIps(LocationName name) Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); for (String element : dataMigrationServiceClient.fetchStaticIps(name).iterateAll()) { // doThingsWith(element); } }- Parameters:
name- Required. The resource name for the location for which static IPs should be returned. Must be in the format `projects/*/locations/*`.- Throws:
ApiException- if the remote call fails
-
fetchStaticIps
Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { String name = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (String element : dataMigrationServiceClient.fetchStaticIps(name).iterateAll()) { // doThingsWith(element); } }- Parameters:
name- Required. The resource name for the location for which static IPs should be returned. Must be in the format `projects/*/locations/*`.- Throws:
ApiException- if the remote call fails
-
fetchStaticIps
public final DataMigrationServiceClient.FetchStaticIpsPagedResponse fetchStaticIps(FetchStaticIpsRequest request) Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { FetchStaticIpsRequest request = FetchStaticIpsRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (String element : dataMigrationServiceClient.fetchStaticIps(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchStaticIpsPagedCallable
public final UnaryCallable<FetchStaticIpsRequest,DataMigrationServiceClient.FetchStaticIpsPagedResponse> fetchStaticIpsPagedCallable()Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { FetchStaticIpsRequest request = FetchStaticIpsRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<String> future = dataMigrationServiceClient.fetchStaticIpsPagedCallable().futureCall(request); // Do something. for (String element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchStaticIpsCallable
Fetches a set of static IP addresses that need to be allowlisted by the customer when using the static-IP connectivity method.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataMigrationServiceClient dataMigrationServiceClient = DataMigrationServiceClient.create()) { FetchStaticIpsRequest request = FetchStaticIpsRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { FetchStaticIpsResponse response = dataMigrationServiceClient.fetchStaticIpsCallable().call(request); for (String element : response.getStaticIpsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-