Class DataMigrationServiceClient (2.10.0)

public class DataMigrationServiceClient implements BackgroundResource

Service Description: Database Migration service

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

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

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

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of 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.

Inheritance

java.lang.Object > DataMigrationServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final DataMigrationServiceClient create()

Constructs an instance of DataMigrationServiceClient with default settings.

Returns
TypeDescription
DataMigrationServiceClient
Exceptions
TypeDescription
IOException

create(DataMigrationServiceSettings settings)

public static final DataMigrationServiceClient create(DataMigrationServiceSettings settings)

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.

Parameter
NameDescription
settingsDataMigrationServiceSettings
Returns
TypeDescription
DataMigrationServiceClient
Exceptions
TypeDescription
IOException

create(DataMigrationServiceStub stub)

public static final DataMigrationServiceClient create(DataMigrationServiceStub stub)

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

Parameter
NameDescription
stubDataMigrationServiceStub
Returns
TypeDescription
DataMigrationServiceClient

Constructors

DataMigrationServiceClient(DataMigrationServiceSettings settings)

protected DataMigrationServiceClient(DataMigrationServiceSettings settings)

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.

Parameter
NameDescription
settingsDataMigrationServiceSettings

DataMigrationServiceClient(DataMigrationServiceStub stub)

protected DataMigrationServiceClient(DataMigrationServiceStub stub)
Parameter
NameDescription
stubDataMigrationServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createConnectionProfileAsync(ConnectionProfileName parent, ConnectionProfile connectionProfile, String connectionProfileId)

public final OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(ConnectionProfileName 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()) {
   ConnectionProfileName parent =
       ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]");
   ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build();
   String connectionProfileId = "connectionProfileId597575526";
   ConnectionProfile response =
       dataMigrationServiceClient
           .createConnectionProfileAsync(parent, connectionProfile, connectionProfileId)
           .get();
 }
 
Parameters
NameDescription
parentConnectionProfileName

Required. The parent, which owns this collection of connection profiles.

connectionProfileConnectionProfile

Required. The create request body including the connection profile data

connectionProfileIdString

Required. The connection profile identifier.

Returns
TypeDescription
OperationFuture<ConnectionProfile,OperationMetadata>

createConnectionProfileAsync(CreateConnectionProfileRequest request)

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(
               ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
                   .toString())
           .setConnectionProfileId("connectionProfileId597575526")
           .setConnectionProfile(ConnectionProfile.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ConnectionProfile response =
       dataMigrationServiceClient.createConnectionProfileAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateConnectionProfileRequest

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

Returns
TypeDescription
OperationFuture<ConnectionProfile,OperationMetadata>

createConnectionProfileAsync(String parent, ConnectionProfile connectionProfile, String connectionProfileId)

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 =
       ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]").toString();
   ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build();
   String connectionProfileId = "connectionProfileId597575526";
   ConnectionProfile response =
       dataMigrationServiceClient
           .createConnectionProfileAsync(parent, connectionProfile, connectionProfileId)
           .get();
 }
 
Parameters
NameDescription
parentString

Required. The parent, which owns this collection of connection profiles.

connectionProfileConnectionProfile

Required. The create request body including the connection profile data

connectionProfileIdString

Required. The connection profile identifier.

Returns
TypeDescription
OperationFuture<ConnectionProfile,OperationMetadata>

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(
               ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
                   .toString())
           .setConnectionProfileId("connectionProfileId597575526")
           .setConnectionProfile(ConnectionProfile.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   ApiFuture<Operation> future =
       dataMigrationServiceClient.createConnectionProfileCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateConnectionProfileRequest,Operation>

createConnectionProfileOperationCallable()

public final OperationCallable<CreateConnectionProfileRequest,ConnectionProfile,OperationMetadata> createConnectionProfileOperationCallable()

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(
               ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
                   .toString())
           .setConnectionProfileId("connectionProfileId597575526")
           .setConnectionProfile(ConnectionProfile.newBuilder().build())
           .setRequestId("requestId693933066")
           .build();
   OperationFuture<ConnectionProfile, OperationMetadata> future =
       dataMigrationServiceClient.createConnectionProfileOperationCallable().futureCall(request);
   // Do something.
   ConnectionProfile response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateConnectionProfileRequest,ConnectionProfile,OperationMetadata>

createMigrationJobAsync(CreateMigrationJobRequest request)

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();
 }
 
Parameter
NameDescription
requestCreateMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

createMigrationJobAsync(LocationName parent, MigrationJob migrationJob, String migrationJobId)

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

Required. The parent, which owns this collection of migration jobs.

migrationJobMigrationJob

Required. Represents a migration job object.

migrationJobIdString

Required. The ID of the instance to create.

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

createMigrationJobAsync(String parent, MigrationJob migrationJob, String migrationJobId)

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

Required. The parent, which owns this collection of migration jobs.

migrationJobMigrationJob

Required. Represents a migration job object.

migrationJobIdString

Required. The ID of the instance to create.

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

createMigrationJobCallable()

public final UnaryCallable<CreateMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<CreateMigrationJobRequest,Operation>

createMigrationJobOperationCallable()

public final OperationCallable<CreateMigrationJobRequest,MigrationJob,OperationMetadata> createMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<CreateMigrationJobRequest,MigrationJob,OperationMetadata>

deleteConnectionProfileAsync(ConnectionProfileName name)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
nameConnectionProfileName

Required. Name of the connection profile resource to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteConnectionProfileAsync(DeleteConnectionProfileRequest request)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
requestDeleteConnectionProfileRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteConnectionProfileAsync(String name)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
nameString

Required. Name of the connection profile resource to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

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();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteConnectionProfileRequest,Operation>

deleteConnectionProfileOperationCallable()

public final OperationCallable<DeleteConnectionProfileRequest,Empty,OperationMetadata> deleteConnectionProfileOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<DeleteConnectionProfileRequest,Empty,OperationMetadata>

deleteMigrationJobAsync(DeleteMigrationJobRequest request)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
requestDeleteMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteMigrationJobAsync(MigrationJobName name)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
nameMigrationJobName

Required. Name of the migration job resource to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteMigrationJobAsync(String name)

public final OperationFuture<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();
 }
 
Parameter
NameDescription
nameString

Required. Name of the migration job resource to delete.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteMigrationJobCallable()

public final UnaryCallable<DeleteMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteMigrationJobRequest,Operation>

deleteMigrationJobOperationCallable()

public final OperationCallable<DeleteMigrationJobRequest,Empty,OperationMetadata> deleteMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<DeleteMigrationJobRequest,Empty,OperationMetadata>

generateSshScript(GenerateSshScriptRequest request)

public final SshScript generateSshScript(GenerateSshScriptRequest request)

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);
 }
 
Parameter
NameDescription
requestGenerateSshScriptRequest

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

Returns
TypeDescription
SshScript

generateSshScriptCallable()

public final UnaryCallable<GenerateSshScriptRequest,SshScript> 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();
 }
 
Returns
TypeDescription
UnaryCallable<GenerateSshScriptRequest,SshScript>

getConnectionProfile(ConnectionProfileName name)

public final ConnectionProfile getConnectionProfile(ConnectionProfileName name)

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);
 }
 
Parameter
NameDescription
nameConnectionProfileName

Required. Name of the connection profile resource to get.

Returns
TypeDescription
ConnectionProfile

getConnectionProfile(GetConnectionProfileRequest request)

public final ConnectionProfile getConnectionProfile(GetConnectionProfileRequest request)

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);
 }
 
Parameter
NameDescription
requestGetConnectionProfileRequest

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

Returns
TypeDescription
ConnectionProfile

getConnectionProfile(String name)

public final ConnectionProfile getConnectionProfile(String name)

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);
 }
 
Parameter
NameDescription
nameString

Required. Name of the connection profile resource to get.

Returns
TypeDescription
ConnectionProfile

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();
 }
 
Returns
TypeDescription
UnaryCallable<GetConnectionProfileRequest,ConnectionProfile>

getMigrationJob(GetMigrationJobRequest request)

public final MigrationJob getMigrationJob(GetMigrationJobRequest request)

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);
 }
 
Parameter
NameDescription
requestGetMigrationJobRequest

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

Returns
TypeDescription
MigrationJob

getMigrationJob(MigrationJobName name)

public final MigrationJob getMigrationJob(MigrationJobName name)

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);
 }
 
Parameter
NameDescription
nameMigrationJobName

Required. Name of the migration job resource to get.

Returns
TypeDescription
MigrationJob

getMigrationJob(String name)

public final MigrationJob getMigrationJob(String name)

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);
 }
 
Parameter
NameDescription
nameString

Required. Name of the migration job resource to get.

Returns
TypeDescription
MigrationJob

getMigrationJobCallable()

public final UnaryCallable<GetMigrationJobRequest,MigrationJob> 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();
 }
 
Returns
TypeDescription
UnaryCallable<GetMigrationJobRequest,MigrationJob>

getOperationsClient()

public final OperationsClient getOperationsClient()

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

Returns
TypeDescription
OperationsClient

getSettings()

public final DataMigrationServiceSettings getSettings()
Returns
TypeDescription
DataMigrationServiceSettings

getStub()

public DataMigrationServiceStub getStub()
Returns
TypeDescription
DataMigrationServiceStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listConnectionProfiles(ListConnectionProfilesRequest request)

public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(ListConnectionProfilesRequest request)

Retrieve 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);
   }
 }
 
Parameter
NameDescription
requestListConnectionProfilesRequest

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

Returns
TypeDescription
DataMigrationServiceClient.ListConnectionProfilesPagedResponse

listConnectionProfiles(LocationName parent)

public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(LocationName parent)

Retrieve 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);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent, which owns this collection of connection profiles.

Returns
TypeDescription
DataMigrationServiceClient.ListConnectionProfilesPagedResponse

listConnectionProfiles(String parent)

public final DataMigrationServiceClient.ListConnectionProfilesPagedResponse listConnectionProfiles(String parent)

Retrieve 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);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent, which owns this collection of connection profiles.

Returns
TypeDescription
DataMigrationServiceClient.ListConnectionProfilesPagedResponse

listConnectionProfilesCallable()

public final UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesResponse> listConnectionProfilesCallable()

Retrieve 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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesResponse>

listConnectionProfilesPagedCallable()

public final UnaryCallable<ListConnectionProfilesRequest,DataMigrationServiceClient.ListConnectionProfilesPagedResponse> listConnectionProfilesPagedCallable()

Retrieve 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);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesPagedResponse>

listMigrationJobs(ListMigrationJobsRequest request)

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);
   }
 }
 
Parameter
NameDescription
requestListMigrationJobsRequest

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

Returns
TypeDescription
DataMigrationServiceClient.ListMigrationJobsPagedResponse

listMigrationJobs(LocationName parent)

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);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The parent, which owns this collection of migrationJobs.

Returns
TypeDescription
DataMigrationServiceClient.ListMigrationJobsPagedResponse

listMigrationJobs(String parent)

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);
   }
 }
 
Parameter
NameDescription
parentString

Required. The parent, which owns this collection of migrationJobs.

Returns
TypeDescription
DataMigrationServiceClient.ListMigrationJobsPagedResponse

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;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListMigrationJobsRequest,ListMigrationJobsResponse>

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);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListMigrationJobsRequest,ListMigrationJobsPagedResponse>

promoteMigrationJobAsync(PromoteMigrationJobRequest request)

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();
 }
 
Parameter
NameDescription
requestPromoteMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

promoteMigrationJobCallable()

public final UnaryCallable<PromoteMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<PromoteMigrationJobRequest,Operation>

promoteMigrationJobOperationCallable()

public final OperationCallable<PromoteMigrationJobRequest,MigrationJob,OperationMetadata> promoteMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<PromoteMigrationJobRequest,MigrationJob,OperationMetadata>

restartMigrationJobAsync(RestartMigrationJobRequest request)

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())
           .build();
   MigrationJob response = dataMigrationServiceClient.restartMigrationJobAsync(request).get();
 }
 
Parameter
NameDescription
requestRestartMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

restartMigrationJobCallable()

public final UnaryCallable<RestartMigrationJobRequest,Operation> 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())
           .build();
   ApiFuture<Operation> future =
       dataMigrationServiceClient.restartMigrationJobCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<RestartMigrationJobRequest,Operation>

restartMigrationJobOperationCallable()

public final OperationCallable<RestartMigrationJobRequest,MigrationJob,OperationMetadata> restartMigrationJobOperationCallable()

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())
           .build();
   OperationFuture<MigrationJob, OperationMetadata> future =
       dataMigrationServiceClient.restartMigrationJobOperationCallable().futureCall(request);
   // Do something.
   MigrationJob response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<RestartMigrationJobRequest,MigrationJob,OperationMetadata>

resumeMigrationJobAsync(ResumeMigrationJobRequest request)

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();
 }
 
Parameter
NameDescription
requestResumeMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

resumeMigrationJobCallable()

public final UnaryCallable<ResumeMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<ResumeMigrationJobRequest,Operation>

resumeMigrationJobOperationCallable()

public final OperationCallable<ResumeMigrationJobRequest,MigrationJob,OperationMetadata> resumeMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<ResumeMigrationJobRequest,MigrationJob,OperationMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

startMigrationJobAsync(StartMigrationJobRequest request)

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())
           .build();
   MigrationJob response = dataMigrationServiceClient.startMigrationJobAsync(request).get();
 }
 
Parameter
NameDescription
requestStartMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

startMigrationJobCallable()

public final UnaryCallable<StartMigrationJobRequest,Operation> 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())
           .build();
   ApiFuture<Operation> future =
       dataMigrationServiceClient.startMigrationJobCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<StartMigrationJobRequest,Operation>

startMigrationJobOperationCallable()

public final OperationCallable<StartMigrationJobRequest,MigrationJob,OperationMetadata> startMigrationJobOperationCallable()

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())
           .build();
   OperationFuture<MigrationJob, OperationMetadata> future =
       dataMigrationServiceClient.startMigrationJobOperationCallable().futureCall(request);
   // Do something.
   MigrationJob response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<StartMigrationJobRequest,MigrationJob,OperationMetadata>

stopMigrationJobAsync(StopMigrationJobRequest request)

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();
 }
 
Parameter
NameDescription
requestStopMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

stopMigrationJobCallable()

public final UnaryCallable<StopMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<StopMigrationJobRequest,Operation>

stopMigrationJobOperationCallable()

public final OperationCallable<StopMigrationJobRequest,MigrationJob,OperationMetadata> stopMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<StopMigrationJobRequest,MigrationJob,OperationMetadata>

updateConnectionProfileAsync(ConnectionProfile connectionProfile, FieldMask updateMask)

public final OperationFuture<ConnectionProfile,OperationMetadata> updateConnectionProfileAsync(ConnectionProfile connectionProfile, 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
NameDescription
connectionProfileConnectionProfile

Required. The connection profile parameters to update.

updateMaskFieldMask

Required. Field mask is used to specify the fields to be overwritten in the connection profile resource by the update.

Returns
TypeDescription
OperationFuture<ConnectionProfile,OperationMetadata>

updateConnectionProfileAsync(UpdateConnectionProfileRequest request)

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")
           .build();
   ConnectionProfile response =
       dataMigrationServiceClient.updateConnectionProfileAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateConnectionProfileRequest

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

Returns
TypeDescription
OperationFuture<ConnectionProfile,OperationMetadata>

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")
           .build();
   ApiFuture<Operation> future =
       dataMigrationServiceClient.updateConnectionProfileCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateConnectionProfileRequest,Operation>

updateConnectionProfileOperationCallable()

public final OperationCallable<UpdateConnectionProfileRequest,ConnectionProfile,OperationMetadata> updateConnectionProfileOperationCallable()

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")
           .build();
   OperationFuture<ConnectionProfile, OperationMetadata> future =
       dataMigrationServiceClient.updateConnectionProfileOperationCallable().futureCall(request);
   // Do something.
   ConnectionProfile response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateConnectionProfileRequest,ConnectionProfile,OperationMetadata>

updateMigrationJobAsync(MigrationJob migrationJob, FieldMask updateMask)

public final OperationFuture<MigrationJob,OperationMetadata> updateMigrationJobAsync(MigrationJob migrationJob, 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
NameDescription
migrationJobMigrationJob

Required. The migration job parameters to update.

updateMaskFieldMask

Required. Field mask is used to specify the fields to be overwritten in the migration job resource by the update.

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

updateMigrationJobAsync(UpdateMigrationJobRequest request)

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();
 }
 
Parameter
NameDescription
requestUpdateMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

updateMigrationJobCallable()

public final UnaryCallable<UpdateMigrationJobRequest,Operation> 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();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateMigrationJobRequest,Operation>

updateMigrationJobOperationCallable()

public final OperationCallable<UpdateMigrationJobRequest,MigrationJob,OperationMetadata> updateMigrationJobOperationCallable()

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();
 }
 
Returns
TypeDescription
OperationCallable<UpdateMigrationJobRequest,MigrationJob,OperationMetadata>

verifyMigrationJobAsync(VerifyMigrationJobRequest request)

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())
           .build();
   MigrationJob response = dataMigrationServiceClient.verifyMigrationJobAsync(request).get();
 }
 
Parameter
NameDescription
requestVerifyMigrationJobRequest

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

Returns
TypeDescription
OperationFuture<MigrationJob,OperationMetadata>

verifyMigrationJobCallable()

public final UnaryCallable<VerifyMigrationJobRequest,Operation> 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())
           .build();
   ApiFuture<Operation> future =
       dataMigrationServiceClient.verifyMigrationJobCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<VerifyMigrationJobRequest,Operation>

verifyMigrationJobOperationCallable()

public final OperationCallable<VerifyMigrationJobRequest,MigrationJob,OperationMetadata> verifyMigrationJobOperationCallable()

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())
           .build();
   OperationFuture<MigrationJob, OperationMetadata> future =
       dataMigrationServiceClient.verifyMigrationJobOperationCallable().futureCall(request);
   // Do something.
   MigrationJob response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<VerifyMigrationJobRequest,MigrationJob,OperationMetadata>