@Generated(value="by gapic-generator-java") public class VmMigrationClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
Source response = vmMigrationClient.getSource(name);
}
Note: close() needs to be called on the VmMigrationClient 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:
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 VmMigrationSettings 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
VmMigrationSettings vmMigrationSettings =
VmMigrationSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings);
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
VmMigrationSettings vmMigrationSettings =
VmMigrationSettings.newBuilder().setEndpoint(myEndpoint).build();
VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VmMigrationSettings vmMigrationSettings = VmMigrationSettings.newHttpJsonBuilder().build();
VmMigrationClient vmMigrationClient = VmMigrationClient.create(vmMigrationSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
VmMigrationClient(VmMigrationSettings settings)
Constructs an instance of VmMigrationClient, using the given settings.
|
protected |
VmMigrationClient(VmMigrationStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> |
addGroupMigrationAsync(AddGroupMigrationRequest request)
Adds a MigratingVm to a Group.
|
com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> |
addGroupMigrationAsync(GroupName group)
Adds a MigratingVm to a Group.
|
com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> |
addGroupMigrationAsync(String group)
Adds a MigratingVm to a Group.
|
com.google.api.gax.rpc.UnaryCallable<AddGroupMigrationRequest,com.google.longrunning.Operation> |
addGroupMigrationCallable()
Adds a MigratingVm to a Group.
|
com.google.api.gax.rpc.OperationCallable<AddGroupMigrationRequest,AddGroupMigrationResponse,OperationMetadata> |
addGroupMigrationOperationCallable()
Adds a MigratingVm to a Group.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> |
cancelCloneJobAsync(CancelCloneJobRequest request)
Initiates the cancellation of a running clone job.
|
com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> |
cancelCloneJobAsync(CloneJobName name)
Initiates the cancellation of a running clone job.
|
com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> |
cancelCloneJobAsync(String name)
Initiates the cancellation of a running clone job.
|
com.google.api.gax.rpc.UnaryCallable<CancelCloneJobRequest,com.google.longrunning.Operation> |
cancelCloneJobCallable()
Initiates the cancellation of a running clone job.
|
com.google.api.gax.rpc.OperationCallable<CancelCloneJobRequest,CancelCloneJobResponse,OperationMetadata> |
cancelCloneJobOperationCallable()
Initiates the cancellation of a running clone job.
|
com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> |
cancelCutoverJobAsync(CancelCutoverJobRequest request)
Initiates the cancellation of a running cutover job.
|
com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> |
cancelCutoverJobAsync(CutoverJobName name)
Initiates the cancellation of a running cutover job.
|
com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> |
cancelCutoverJobAsync(String name)
Initiates the cancellation of a running cutover job.
|
com.google.api.gax.rpc.UnaryCallable<CancelCutoverJobRequest,com.google.longrunning.Operation> |
cancelCutoverJobCallable()
Initiates the cancellation of a running cutover job.
|
com.google.api.gax.rpc.OperationCallable<CancelCutoverJobRequest,CancelCutoverJobResponse,OperationMetadata> |
cancelCutoverJobOperationCallable()
Initiates the cancellation of a running cutover job.
|
void |
close() |
static VmMigrationClient |
create()
Constructs an instance of VmMigrationClient with default settings.
|
static VmMigrationClient |
create(VmMigrationSettings settings)
Constructs an instance of VmMigrationClient, using the given settings.
|
static VmMigrationClient |
create(VmMigrationStub stub)
Constructs an instance of VmMigrationClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> |
createCloneJobAsync(CreateCloneJobRequest request)
Initiates a Clone of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> |
createCloneJobAsync(MigratingVmName parent,
CloneJob cloneJob,
String cloneJobId)
Initiates a Clone of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> |
createCloneJobAsync(String parent,
CloneJob cloneJob,
String cloneJobId)
Initiates a Clone of a specific migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<CreateCloneJobRequest,com.google.longrunning.Operation> |
createCloneJobCallable()
Initiates a Clone of a specific migrating VM.
|
com.google.api.gax.rpc.OperationCallable<CreateCloneJobRequest,CloneJob,OperationMetadata> |
createCloneJobOperationCallable()
Initiates a Clone of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> |
createCutoverJobAsync(CreateCutoverJobRequest request)
Initiates a Cutover of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> |
createCutoverJobAsync(MigratingVmName parent,
CutoverJob cutoverJob,
String cutoverJobId)
Initiates a Cutover of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> |
createCutoverJobAsync(String parent,
CutoverJob cutoverJob,
String cutoverJobId)
Initiates a Cutover of a specific migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<CreateCutoverJobRequest,com.google.longrunning.Operation> |
createCutoverJobCallable()
Initiates a Cutover of a specific migrating VM.
|
com.google.api.gax.rpc.OperationCallable<CreateCutoverJobRequest,CutoverJob,OperationMetadata> |
createCutoverJobOperationCallable()
Initiates a Cutover of a specific migrating VM.
|
com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> |
createDatacenterConnectorAsync(CreateDatacenterConnectorRequest request)
Creates a new DatacenterConnector in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> |
createDatacenterConnectorAsync(SourceName parent,
DatacenterConnector datacenterConnector,
String datacenterConnectorId)
Creates a new DatacenterConnector in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> |
createDatacenterConnectorAsync(String parent,
DatacenterConnector datacenterConnector,
String datacenterConnectorId)
Creates a new DatacenterConnector in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<CreateDatacenterConnectorRequest,com.google.longrunning.Operation> |
createDatacenterConnectorCallable()
Creates a new DatacenterConnector in a given Source.
|
com.google.api.gax.rpc.OperationCallable<CreateDatacenterConnectorRequest,DatacenterConnector,OperationMetadata> |
createDatacenterConnectorOperationCallable()
Creates a new DatacenterConnector in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> |
createGroupAsync(CreateGroupRequest request)
Creates a new Group in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> |
createGroupAsync(LocationName parent,
Group group,
String groupId)
Creates a new Group in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> |
createGroupAsync(String parent,
Group group,
String groupId)
Creates a new Group in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateGroupRequest,com.google.longrunning.Operation> |
createGroupCallable()
Creates a new Group in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateGroupRequest,Group,OperationMetadata> |
createGroupOperationCallable()
Creates a new Group in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> |
createMigratingVmAsync(CreateMigratingVmRequest request)
Creates a new MigratingVm in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> |
createMigratingVmAsync(SourceName parent,
MigratingVm migratingVm,
String migratingVmId)
Creates a new MigratingVm in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> |
createMigratingVmAsync(String parent,
MigratingVm migratingVm,
String migratingVmId)
Creates a new MigratingVm in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<CreateMigratingVmRequest,com.google.longrunning.Operation> |
createMigratingVmCallable()
Creates a new MigratingVm in a given Source.
|
com.google.api.gax.rpc.OperationCallable<CreateMigratingVmRequest,MigratingVm,OperationMetadata> |
createMigratingVmOperationCallable()
Creates a new MigratingVm in a given Source.
|
com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> |
createSourceAsync(CreateSourceRequest request)
Creates a new Source in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> |
createSourceAsync(LocationName parent,
Source source,
String sourceId)
Creates a new Source in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> |
createSourceAsync(String parent,
Source source,
String sourceId)
Creates a new Source in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateSourceRequest,com.google.longrunning.Operation> |
createSourceCallable()
Creates a new Source in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateSourceRequest,Source,OperationMetadata> |
createSourceOperationCallable()
Creates a new Source in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> |
createTargetProjectAsync(CreateTargetProjectRequest request)
Creates a new TargetProject in a given project.
|
com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> |
createTargetProjectAsync(LocationName parent,
TargetProject targetProject,
String targetProjectId)
Creates a new TargetProject in a given project.
|
com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> |
createTargetProjectAsync(String parent,
TargetProject targetProject,
String targetProjectId)
Creates a new TargetProject in a given project.
|
com.google.api.gax.rpc.UnaryCallable<CreateTargetProjectRequest,com.google.longrunning.Operation> |
createTargetProjectCallable()
Creates a new TargetProject in a given project.
|
com.google.api.gax.rpc.OperationCallable<CreateTargetProjectRequest,TargetProject,OperationMetadata> |
createTargetProjectOperationCallable()
Creates a new TargetProject in a given project.
|
com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> |
createUtilizationReportAsync(CreateUtilizationReportRequest request)
Creates a new UtilizationReport.
|
com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> |
createUtilizationReportAsync(SourceName parent,
UtilizationReport utilizationReport,
String utilizationReportId)
Creates a new UtilizationReport.
|
com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> |
createUtilizationReportAsync(String parent,
UtilizationReport utilizationReport,
String utilizationReportId)
Creates a new UtilizationReport.
|
com.google.api.gax.rpc.UnaryCallable<CreateUtilizationReportRequest,com.google.longrunning.Operation> |
createUtilizationReportCallable()
Creates a new UtilizationReport.
|
com.google.api.gax.rpc.OperationCallable<CreateUtilizationReportRequest,UtilizationReport,OperationMetadata> |
createUtilizationReportOperationCallable()
Creates a new UtilizationReport.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatacenterConnectorAsync(DatacenterConnectorName name)
Deletes a single DatacenterConnector.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatacenterConnectorAsync(DeleteDatacenterConnectorRequest request)
Deletes a single DatacenterConnector.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteDatacenterConnectorAsync(String name)
Deletes a single DatacenterConnector.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDatacenterConnectorRequest,com.google.longrunning.Operation> |
deleteDatacenterConnectorCallable()
Deletes a single DatacenterConnector.
|
com.google.api.gax.rpc.OperationCallable<DeleteDatacenterConnectorRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteDatacenterConnectorOperationCallable()
Deletes a single DatacenterConnector.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGroupAsync(DeleteGroupRequest request)
Deletes a single Group.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGroupAsync(GroupName name)
Deletes a single Group.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteGroupAsync(String name)
Deletes a single Group.
|
com.google.api.gax.rpc.UnaryCallable<DeleteGroupRequest,com.google.longrunning.Operation> |
deleteGroupCallable()
Deletes a single Group.
|
com.google.api.gax.rpc.OperationCallable<DeleteGroupRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteGroupOperationCallable()
Deletes a single Group.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteMigratingVmAsync(DeleteMigratingVmRequest request)
Deletes a single MigratingVm.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteMigratingVmAsync(MigratingVmName name)
Deletes a single MigratingVm.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteMigratingVmAsync(String name)
Deletes a single MigratingVm.
|
com.google.api.gax.rpc.UnaryCallable<DeleteMigratingVmRequest,com.google.longrunning.Operation> |
deleteMigratingVmCallable()
Deletes a single MigratingVm.
|
com.google.api.gax.rpc.OperationCallable<DeleteMigratingVmRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteMigratingVmOperationCallable()
Deletes a single MigratingVm.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSourceAsync(DeleteSourceRequest request)
Deletes a single Source.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSourceAsync(SourceName name)
Deletes a single Source.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteSourceAsync(String name)
Deletes a single Source.
|
com.google.api.gax.rpc.UnaryCallable<DeleteSourceRequest,com.google.longrunning.Operation> |
deleteSourceCallable()
Deletes a single Source.
|
com.google.api.gax.rpc.OperationCallable<DeleteSourceRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteSourceOperationCallable()
Deletes a single Source.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteTargetProjectAsync(DeleteTargetProjectRequest request)
Deletes a single TargetProject.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteTargetProjectAsync(String name)
Deletes a single TargetProject.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteTargetProjectAsync(TargetProjectName name)
Deletes a single TargetProject.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTargetProjectRequest,com.google.longrunning.Operation> |
deleteTargetProjectCallable()
Deletes a single TargetProject.
|
com.google.api.gax.rpc.OperationCallable<DeleteTargetProjectRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteTargetProjectOperationCallable()
Deletes a single TargetProject.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteUtilizationReportAsync(DeleteUtilizationReportRequest request)
Deletes a single Utilization Report.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteUtilizationReportAsync(String name)
Deletes a single Utilization Report.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteUtilizationReportAsync(UtilizationReportName name)
Deletes a single Utilization Report.
|
com.google.api.gax.rpc.UnaryCallable<DeleteUtilizationReportRequest,com.google.longrunning.Operation> |
deleteUtilizationReportCallable()
Deletes a single Utilization Report.
|
com.google.api.gax.rpc.OperationCallable<DeleteUtilizationReportRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteUtilizationReportOperationCallable()
Deletes a single Utilization Report.
|
FetchInventoryResponse |
fetchInventory(FetchInventoryRequest request)
List remote source's inventory of VMs.
|
FetchInventoryResponse |
fetchInventory(SourceName source)
List remote source's inventory of VMs.
|
FetchInventoryResponse |
fetchInventory(String source)
List remote source's inventory of VMs.
|
com.google.api.gax.rpc.UnaryCallable<FetchInventoryRequest,FetchInventoryResponse> |
fetchInventoryCallable()
List remote source's inventory of VMs.
|
com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> |
finalizeMigrationAsync(FinalizeMigrationRequest request)
Marks a migration as completed, deleting migration resources that are no longer being used.
|
com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> |
finalizeMigrationAsync(MigratingVmName migratingVm)
Marks a migration as completed, deleting migration resources that are no longer being used.
|
com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> |
finalizeMigrationAsync(String migratingVm)
Marks a migration as completed, deleting migration resources that are no longer being used.
|
com.google.api.gax.rpc.UnaryCallable<FinalizeMigrationRequest,com.google.longrunning.Operation> |
finalizeMigrationCallable()
Marks a migration as completed, deleting migration resources that are no longer being used.
|
com.google.api.gax.rpc.OperationCallable<FinalizeMigrationRequest,FinalizeMigrationResponse,OperationMetadata> |
finalizeMigrationOperationCallable()
Marks a migration as completed, deleting migration resources that are no longer being used.
|
CloneJob |
getCloneJob(CloneJobName name)
Gets details of a single CloneJob.
|
CloneJob |
getCloneJob(GetCloneJobRequest request)
Gets details of a single CloneJob.
|
CloneJob |
getCloneJob(String name)
Gets details of a single CloneJob.
|
com.google.api.gax.rpc.UnaryCallable<GetCloneJobRequest,CloneJob> |
getCloneJobCallable()
Gets details of a single CloneJob.
|
CutoverJob |
getCutoverJob(CutoverJobName name)
Gets details of a single CutoverJob.
|
CutoverJob |
getCutoverJob(GetCutoverJobRequest request)
Gets details of a single CutoverJob.
|
CutoverJob |
getCutoverJob(String name)
Gets details of a single CutoverJob.
|
com.google.api.gax.rpc.UnaryCallable<GetCutoverJobRequest,CutoverJob> |
getCutoverJobCallable()
Gets details of a single CutoverJob.
|
DatacenterConnector |
getDatacenterConnector(DatacenterConnectorName name)
Gets details of a single DatacenterConnector.
|
DatacenterConnector |
getDatacenterConnector(GetDatacenterConnectorRequest request)
Gets details of a single DatacenterConnector.
|
DatacenterConnector |
getDatacenterConnector(String name)
Gets details of a single DatacenterConnector.
|
com.google.api.gax.rpc.UnaryCallable<GetDatacenterConnectorRequest,DatacenterConnector> |
getDatacenterConnectorCallable()
Gets details of a single DatacenterConnector.
|
Group |
getGroup(GetGroupRequest request)
Gets details of a single Group.
|
Group |
getGroup(GroupName name)
Gets details of a single Group.
|
Group |
getGroup(String name)
Gets details of a single Group.
|
com.google.api.gax.rpc.UnaryCallable<GetGroupRequest,Group> |
getGroupCallable()
Gets details of a single Group.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
MigratingVm |
getMigratingVm(GetMigratingVmRequest request)
Gets details of a single MigratingVm.
|
MigratingVm |
getMigratingVm(MigratingVmName name)
Gets details of a single MigratingVm.
|
MigratingVm |
getMigratingVm(String name)
Gets details of a single MigratingVm.
|
com.google.api.gax.rpc.UnaryCallable<GetMigratingVmRequest,MigratingVm> |
getMigratingVmCallable()
Gets details of a single MigratingVm.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
VmMigrationSettings |
getSettings() |
Source |
getSource(GetSourceRequest request)
Gets details of a single Source.
|
Source |
getSource(SourceName name)
Gets details of a single Source.
|
Source |
getSource(String name)
Gets details of a single Source.
|
com.google.api.gax.rpc.UnaryCallable<GetSourceRequest,Source> |
getSourceCallable()
Gets details of a single Source.
|
VmMigrationStub |
getStub() |
TargetProject |
getTargetProject(GetTargetProjectRequest request)
Gets details of a single TargetProject.
|
TargetProject |
getTargetProject(String name)
Gets details of a single TargetProject.
|
TargetProject |
getTargetProject(TargetProjectName name)
Gets details of a single TargetProject.
|
com.google.api.gax.rpc.UnaryCallable<GetTargetProjectRequest,TargetProject> |
getTargetProjectCallable()
Gets details of a single TargetProject.
|
UtilizationReport |
getUtilizationReport(GetUtilizationReportRequest request)
Gets a single Utilization Report.
|
UtilizationReport |
getUtilizationReport(String name)
Gets a single Utilization Report.
|
UtilizationReport |
getUtilizationReport(UtilizationReportName name)
Gets a single Utilization Report.
|
com.google.api.gax.rpc.UnaryCallable<GetUtilizationReportRequest,UtilizationReport> |
getUtilizationReportCallable()
Gets a single Utilization Report.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
VmMigrationClient.ListCloneJobsPagedResponse |
listCloneJobs(ListCloneJobsRequest request)
Lists CloneJobs of a given migrating VM.
|
VmMigrationClient.ListCloneJobsPagedResponse |
listCloneJobs(MigratingVmName parent)
Lists CloneJobs of a given migrating VM.
|
VmMigrationClient.ListCloneJobsPagedResponse |
listCloneJobs(String parent)
Lists CloneJobs of a given migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<ListCloneJobsRequest,ListCloneJobsResponse> |
listCloneJobsCallable()
Lists CloneJobs of a given migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<ListCloneJobsRequest,VmMigrationClient.ListCloneJobsPagedResponse> |
listCloneJobsPagedCallable()
Lists CloneJobs of a given migrating VM.
|
VmMigrationClient.ListCutoverJobsPagedResponse |
listCutoverJobs(ListCutoverJobsRequest request)
Lists CutoverJobs of a given migrating VM.
|
VmMigrationClient.ListCutoverJobsPagedResponse |
listCutoverJobs(MigratingVmName parent)
Lists CutoverJobs of a given migrating VM.
|
VmMigrationClient.ListCutoverJobsPagedResponse |
listCutoverJobs(String parent)
Lists CutoverJobs of a given migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<ListCutoverJobsRequest,ListCutoverJobsResponse> |
listCutoverJobsCallable()
Lists CutoverJobs of a given migrating VM.
|
com.google.api.gax.rpc.UnaryCallable<ListCutoverJobsRequest,VmMigrationClient.ListCutoverJobsPagedResponse> |
listCutoverJobsPagedCallable()
Lists CutoverJobs of a given migrating VM.
|
VmMigrationClient.ListDatacenterConnectorsPagedResponse |
listDatacenterConnectors(ListDatacenterConnectorsRequest request)
Lists DatacenterConnectors in a given Source.
|
VmMigrationClient.ListDatacenterConnectorsPagedResponse |
listDatacenterConnectors(SourceName parent)
Lists DatacenterConnectors in a given Source.
|
VmMigrationClient.ListDatacenterConnectorsPagedResponse |
listDatacenterConnectors(String parent)
Lists DatacenterConnectors in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListDatacenterConnectorsRequest,ListDatacenterConnectorsResponse> |
listDatacenterConnectorsCallable()
Lists DatacenterConnectors in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListDatacenterConnectorsRequest,VmMigrationClient.ListDatacenterConnectorsPagedResponse> |
listDatacenterConnectorsPagedCallable()
Lists DatacenterConnectors in a given Source.
|
VmMigrationClient.ListGroupsPagedResponse |
listGroups(ListGroupsRequest request)
Lists Groups in a given project and location.
|
VmMigrationClient.ListGroupsPagedResponse |
listGroups(LocationName parent)
Lists Groups in a given project and location.
|
VmMigrationClient.ListGroupsPagedResponse |
listGroups(String parent)
Lists Groups in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGroupsRequest,ListGroupsResponse> |
listGroupsCallable()
Lists Groups in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGroupsRequest,VmMigrationClient.ListGroupsPagedResponse> |
listGroupsPagedCallable()
Lists Groups in a given project and location.
|
VmMigrationClient.ListMigratingVmsPagedResponse |
listMigratingVms(ListMigratingVmsRequest request)
Lists MigratingVms in a given Source.
|
VmMigrationClient.ListMigratingVmsPagedResponse |
listMigratingVms(SourceName parent)
Lists MigratingVms in a given Source.
|
VmMigrationClient.ListMigratingVmsPagedResponse |
listMigratingVms(String parent)
Lists MigratingVms in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListMigratingVmsRequest,ListMigratingVmsResponse> |
listMigratingVmsCallable()
Lists MigratingVms in a given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListMigratingVmsRequest,VmMigrationClient.ListMigratingVmsPagedResponse> |
listMigratingVmsPagedCallable()
Lists MigratingVms in a given Source.
|
VmMigrationClient.ListSourcesPagedResponse |
listSources(ListSourcesRequest request)
Lists Sources in a given project and location.
|
VmMigrationClient.ListSourcesPagedResponse |
listSources(LocationName parent)
Lists Sources in a given project and location.
|
VmMigrationClient.ListSourcesPagedResponse |
listSources(String parent)
Lists Sources in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSourcesRequest,ListSourcesResponse> |
listSourcesCallable()
Lists Sources in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListSourcesRequest,VmMigrationClient.ListSourcesPagedResponse> |
listSourcesPagedCallable()
Lists Sources in a given project and location.
|
VmMigrationClient.ListTargetProjectsPagedResponse |
listTargetProjects(ListTargetProjectsRequest request)
Lists TargetProjects in a given project.
|
VmMigrationClient.ListTargetProjectsPagedResponse |
listTargetProjects(LocationName parent)
Lists TargetProjects in a given project.
|
VmMigrationClient.ListTargetProjectsPagedResponse |
listTargetProjects(String parent)
Lists TargetProjects in a given project.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetProjectsRequest,ListTargetProjectsResponse> |
listTargetProjectsCallable()
Lists TargetProjects in a given project.
|
com.google.api.gax.rpc.UnaryCallable<ListTargetProjectsRequest,VmMigrationClient.ListTargetProjectsPagedResponse> |
listTargetProjectsPagedCallable()
Lists TargetProjects in a given project.
|
VmMigrationClient.ListUtilizationReportsPagedResponse |
listUtilizationReports(ListUtilizationReportsRequest request)
Lists Utilization Reports of the given Source.
|
VmMigrationClient.ListUtilizationReportsPagedResponse |
listUtilizationReports(SourceName parent)
Lists Utilization Reports of the given Source.
|
VmMigrationClient.ListUtilizationReportsPagedResponse |
listUtilizationReports(String parent)
Lists Utilization Reports of the given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListUtilizationReportsRequest,ListUtilizationReportsResponse> |
listUtilizationReportsCallable()
Lists Utilization Reports of the given Source.
|
com.google.api.gax.rpc.UnaryCallable<ListUtilizationReportsRequest,VmMigrationClient.ListUtilizationReportsPagedResponse> |
listUtilizationReportsPagedCallable()
Lists Utilization Reports of the given Source.
|
com.google.api.gax.longrunning.OperationFuture<PauseMigrationResponse,OperationMetadata> |
pauseMigrationAsync(PauseMigrationRequest request)
Pauses a migration for a VM.
|
com.google.api.gax.rpc.UnaryCallable<PauseMigrationRequest,com.google.longrunning.Operation> |
pauseMigrationCallable()
Pauses a migration for a VM.
|
com.google.api.gax.rpc.OperationCallable<PauseMigrationRequest,PauseMigrationResponse,OperationMetadata> |
pauseMigrationOperationCallable()
Pauses a migration for a VM.
|
com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> |
removeGroupMigrationAsync(GroupName group)
Removes a MigratingVm from a Group.
|
com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> |
removeGroupMigrationAsync(RemoveGroupMigrationRequest request)
Removes a MigratingVm from a Group.
|
com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> |
removeGroupMigrationAsync(String group)
Removes a MigratingVm from a Group.
|
com.google.api.gax.rpc.UnaryCallable<RemoveGroupMigrationRequest,com.google.longrunning.Operation> |
removeGroupMigrationCallable()
Removes a MigratingVm from a Group.
|
com.google.api.gax.rpc.OperationCallable<RemoveGroupMigrationRequest,RemoveGroupMigrationResponse,OperationMetadata> |
removeGroupMigrationOperationCallable()
Removes a MigratingVm from a Group.
|
com.google.api.gax.longrunning.OperationFuture<ResumeMigrationResponse,OperationMetadata> |
resumeMigrationAsync(ResumeMigrationRequest request)
Resumes a migration for a VM.
|
com.google.api.gax.rpc.UnaryCallable<ResumeMigrationRequest,com.google.longrunning.Operation> |
resumeMigrationCallable()
Resumes a migration for a VM.
|
com.google.api.gax.rpc.OperationCallable<ResumeMigrationRequest,ResumeMigrationResponse,OperationMetadata> |
resumeMigrationOperationCallable()
Resumes a migration for a VM.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> |
startMigrationAsync(MigratingVmName migratingVm)
Starts migration for a VM.
|
com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> |
startMigrationAsync(StartMigrationRequest request)
Starts migration for a VM.
|
com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> |
startMigrationAsync(String migratingVm)
Starts migration for a VM.
|
com.google.api.gax.rpc.UnaryCallable<StartMigrationRequest,com.google.longrunning.Operation> |
startMigrationCallable()
Starts migration for a VM.
|
com.google.api.gax.rpc.OperationCallable<StartMigrationRequest,StartMigrationResponse,OperationMetadata> |
startMigrationOperationCallable()
Starts migration for a VM.
|
com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> |
updateGroupAsync(Group group,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Group.
|
com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> |
updateGroupAsync(UpdateGroupRequest request)
Updates the parameters of a single Group.
|
com.google.api.gax.rpc.UnaryCallable<UpdateGroupRequest,com.google.longrunning.Operation> |
updateGroupCallable()
Updates the parameters of a single Group.
|
com.google.api.gax.rpc.OperationCallable<UpdateGroupRequest,Group,OperationMetadata> |
updateGroupOperationCallable()
Updates the parameters of a single Group.
|
com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> |
updateMigratingVmAsync(MigratingVm migratingVm,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single MigratingVm.
|
com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> |
updateMigratingVmAsync(UpdateMigratingVmRequest request)
Updates the parameters of a single MigratingVm.
|
com.google.api.gax.rpc.UnaryCallable<UpdateMigratingVmRequest,com.google.longrunning.Operation> |
updateMigratingVmCallable()
Updates the parameters of a single MigratingVm.
|
com.google.api.gax.rpc.OperationCallable<UpdateMigratingVmRequest,MigratingVm,OperationMetadata> |
updateMigratingVmOperationCallable()
Updates the parameters of a single MigratingVm.
|
com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> |
updateSourceAsync(Source source,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Source.
|
com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> |
updateSourceAsync(UpdateSourceRequest request)
Updates the parameters of a single Source.
|
com.google.api.gax.rpc.UnaryCallable<UpdateSourceRequest,com.google.longrunning.Operation> |
updateSourceCallable()
Updates the parameters of a single Source.
|
com.google.api.gax.rpc.OperationCallable<UpdateSourceRequest,Source,OperationMetadata> |
updateSourceOperationCallable()
Updates the parameters of a single Source.
|
com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> |
updateTargetProjectAsync(TargetProject targetProject,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single TargetProject.
|
com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> |
updateTargetProjectAsync(UpdateTargetProjectRequest request)
Updates the parameters of a single TargetProject.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTargetProjectRequest,com.google.longrunning.Operation> |
updateTargetProjectCallable()
Updates the parameters of a single TargetProject.
|
com.google.api.gax.rpc.OperationCallable<UpdateTargetProjectRequest,TargetProject,OperationMetadata> |
updateTargetProjectOperationCallable()
Updates the parameters of a single TargetProject.
|
com.google.api.gax.longrunning.OperationFuture<UpgradeApplianceResponse,OperationMetadata> |
upgradeApplianceAsync(UpgradeApplianceRequest request)
Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.
|
com.google.api.gax.rpc.UnaryCallable<UpgradeApplianceRequest,com.google.longrunning.Operation> |
upgradeApplianceCallable()
Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.
|
com.google.api.gax.rpc.OperationCallable<UpgradeApplianceRequest,UpgradeApplianceResponse,OperationMetadata> |
upgradeApplianceOperationCallable()
Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.
|
protected VmMigrationClient(VmMigrationSettings settings) throws IOException
IOExceptionprotected VmMigrationClient(VmMigrationStub stub)
public static final VmMigrationClient create() throws IOException
IOExceptionpublic static final VmMigrationClient create(VmMigrationSettings settings) throws IOException
IOExceptionpublic static final VmMigrationClient create(VmMigrationStub stub)
public final VmMigrationSettings getSettings()
public VmMigrationStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final VmMigrationClient.ListSourcesPagedResponse listSources(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Source element : vmMigrationClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of sources.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListSourcesPagedResponse listSources(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Source element : vmMigrationClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of sources.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListSourcesPagedResponse listSources(ListSourcesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Source element : vmMigrationClient.listSources(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSourcesRequest,VmMigrationClient.ListSourcesPagedResponse> listSourcesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Source> future = vmMigrationClient.listSourcesPagedCallable().futureCall(request);
// Do something.
for (Source element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSourcesRequest,ListSourcesResponse> listSourcesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListSourcesRequest request =
ListSourcesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListSourcesResponse response = vmMigrationClient.listSourcesCallable().call(request);
for (Source element : response.getSourcesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Source getSource(SourceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
Source response = vmMigrationClient.getSource(name);
}
name - Required. The Source name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Source getSource(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
Source response = vmMigrationClient.getSource(name);
}
name - Required. The Source name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Source getSource(GetSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.build();
Source response = vmMigrationClient.getSource(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetSourceRequest,Source> getSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.build();
ApiFuture<Source> future = vmMigrationClient.getSourceCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> createSourceAsync(LocationName parent, Source source, String sourceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Source source = Source.newBuilder().build();
String sourceId = "sourceId1746327190";
Source response = vmMigrationClient.createSourceAsync(parent, source, sourceId).get();
}
parent - Required. The Source's parent.source - Required. The create request body.sourceId - Required. The source identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> createSourceAsync(String parent, Source source, String sourceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Source source = Source.newBuilder().build();
String sourceId = "sourceId1746327190";
Source response = vmMigrationClient.createSourceAsync(parent, source, sourceId).get();
}
parent - Required. The Source's parent.source - Required. The create request body.sourceId - Required. The source identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> createSourceAsync(CreateSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSourceId("sourceId1746327190")
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Source response = vmMigrationClient.createSourceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateSourceRequest,Source,OperationMetadata> createSourceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSourceId("sourceId1746327190")
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Source, OperationMetadata> future =
vmMigrationClient.createSourceOperationCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateSourceRequest,com.google.longrunning.Operation> createSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSourceId("sourceId1746327190")
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.createSourceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> updateSourceAsync(Source source, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
Source source = Source.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Source response = vmMigrationClient.updateSourceAsync(source, updateMask).get();
}
source - Required. The update request body.updateMask - Field mask is used to specify the fields to be overwritten in the Source
resource by the update. The fields specified in the update_mask are relative to the
resource, not the full request. A field will be overwritten if it is in the mask. If the
user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Source,OperationMetadata> updateSourceAsync(UpdateSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Source response = vmMigrationClient.updateSourceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateSourceRequest,Source,OperationMetadata> updateSourceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Source, OperationMetadata> future =
vmMigrationClient.updateSourceOperationCallable().futureCall(request);
// Do something.
Source response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateSourceRequest,com.google.longrunning.Operation> updateSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSource(Source.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.updateSourceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(SourceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
vmMigrationClient.deleteSourceAsync(name).get();
}
name - Required. The Source name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
vmMigrationClient.deleteSourceAsync(name).get();
}
name - Required. The Source name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(DeleteSourceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteSourceRequest request =
DeleteSourceRequest.newBuilder()
.setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setRequestId("requestId693933066")
.build();
vmMigrationClient.deleteSourceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteSourceRequest,com.google.protobuf.Empty,OperationMetadata> deleteSourceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteSourceRequest request =
DeleteSourceRequest.newBuilder()
.setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteSourceOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteSourceRequest,com.google.longrunning.Operation> deleteSourceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteSourceRequest request =
DeleteSourceRequest.newBuilder()
.setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.deleteSourceCallable().futureCall(request);
// Do something.
future.get();
}
public final FetchInventoryResponse fetchInventory(SourceName source)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName source = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
FetchInventoryResponse response = vmMigrationClient.fetchInventory(source);
}
source - Required. The name of the Source.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchInventoryResponse fetchInventory(String source)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String source = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
FetchInventoryResponse response = vmMigrationClient.fetchInventory(source);
}
source - Required. The name of the Source.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FetchInventoryResponse fetchInventory(FetchInventoryRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
FetchInventoryRequest request =
FetchInventoryRequest.newBuilder()
.setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setForceRefresh(true)
.build();
FetchInventoryResponse response = vmMigrationClient.fetchInventory(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchInventoryRequest,FetchInventoryResponse> fetchInventoryCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
FetchInventoryRequest request =
FetchInventoryRequest.newBuilder()
.setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setForceRefresh(true)
.build();
ApiFuture<FetchInventoryResponse> future =
vmMigrationClient.fetchInventoryCallable().futureCall(request);
// Do something.
FetchInventoryResponse response = future.get();
}
public final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(SourceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
for (UtilizationReport element :
vmMigrationClient.listUtilizationReports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The Utilization Reports parent.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
for (UtilizationReport element :
vmMigrationClient.listUtilizationReports(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The Utilization Reports parent.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(ListUtilizationReportsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListUtilizationReportsRequest request =
ListUtilizationReportsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setView(UtilizationReportView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (UtilizationReport element :
vmMigrationClient.listUtilizationReports(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListUtilizationReportsRequest,VmMigrationClient.ListUtilizationReportsPagedResponse> listUtilizationReportsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListUtilizationReportsRequest request =
ListUtilizationReportsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setView(UtilizationReportView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<UtilizationReport> future =
vmMigrationClient.listUtilizationReportsPagedCallable().futureCall(request);
// Do something.
for (UtilizationReport element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListUtilizationReportsRequest,ListUtilizationReportsResponse> listUtilizationReportsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListUtilizationReportsRequest request =
ListUtilizationReportsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setView(UtilizationReportView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListUtilizationReportsResponse response =
vmMigrationClient.listUtilizationReportsCallable().call(request);
for (UtilizationReport element : response.getUtilizationReportsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final UtilizationReport getUtilizationReport(UtilizationReportName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UtilizationReportName name =
UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]");
UtilizationReport response = vmMigrationClient.getUtilizationReport(name);
}
name - Required. The Utilization Report name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final UtilizationReport getUtilizationReport(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString();
UtilizationReport response = vmMigrationClient.getUtilizationReport(name);
}
name - Required. The Utilization Report name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final UtilizationReport getUtilizationReport(GetUtilizationReportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetUtilizationReportRequest request =
GetUtilizationReportRequest.newBuilder()
.setName(
UtilizationReportName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString())
.setView(UtilizationReportView.forNumber(0))
.build();
UtilizationReport response = vmMigrationClient.getUtilizationReport(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetUtilizationReportRequest,UtilizationReport> getUtilizationReportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetUtilizationReportRequest request =
GetUtilizationReportRequest.newBuilder()
.setName(
UtilizationReportName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString())
.setView(UtilizationReportView.forNumber(0))
.build();
ApiFuture<UtilizationReport> future =
vmMigrationClient.getUtilizationReportCallable().futureCall(request);
// Do something.
UtilizationReport response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(SourceName parent, UtilizationReport utilizationReport, String utilizationReportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
UtilizationReport utilizationReport = UtilizationReport.newBuilder().build();
String utilizationReportId = "utilizationReportId1215771057";
UtilizationReport response =
vmMigrationClient
.createUtilizationReportAsync(parent, utilizationReport, utilizationReportId)
.get();
}
parent - Required. The Utilization Report's parent.utilizationReport - Required. The report to create.utilizationReportId - Required. The ID to use for the report, which will become the final
component of the reports's resource name.
This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It must start with an english letter and must not end with a hyphen.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(String parent, UtilizationReport utilizationReport, String utilizationReportId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
UtilizationReport utilizationReport = UtilizationReport.newBuilder().build();
String utilizationReportId = "utilizationReportId1215771057";
UtilizationReport response =
vmMigrationClient
.createUtilizationReportAsync(parent, utilizationReport, utilizationReportId)
.get();
}
parent - Required. The Utilization Report's parent.utilizationReport - Required. The report to create.utilizationReportId - Required. The ID to use for the report, which will become the final
component of the reports's resource name.
This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It must start with an english letter and must not end with a hyphen.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(CreateUtilizationReportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateUtilizationReportRequest request =
CreateUtilizationReportRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setUtilizationReport(UtilizationReport.newBuilder().build())
.setUtilizationReportId("utilizationReportId1215771057")
.setRequestId("requestId693933066")
.build();
UtilizationReport response = vmMigrationClient.createUtilizationReportAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateUtilizationReportRequest,UtilizationReport,OperationMetadata> createUtilizationReportOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateUtilizationReportRequest request =
CreateUtilizationReportRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setUtilizationReport(UtilizationReport.newBuilder().build())
.setUtilizationReportId("utilizationReportId1215771057")
.setRequestId("requestId693933066")
.build();
OperationFuture<UtilizationReport, OperationMetadata> future =
vmMigrationClient.createUtilizationReportOperationCallable().futureCall(request);
// Do something.
UtilizationReport response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateUtilizationReportRequest,com.google.longrunning.Operation> createUtilizationReportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateUtilizationReportRequest request =
CreateUtilizationReportRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setUtilizationReport(UtilizationReport.newBuilder().build())
.setUtilizationReportId("utilizationReportId1215771057")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.createUtilizationReportCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(UtilizationReportName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UtilizationReportName name =
UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]");
vmMigrationClient.deleteUtilizationReportAsync(name).get();
}
name - Required. The Utilization Report name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
UtilizationReportName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString();
vmMigrationClient.deleteUtilizationReportAsync(name).get();
}
name - Required. The Utilization Report name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(DeleteUtilizationReportRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteUtilizationReportRequest request =
DeleteUtilizationReportRequest.newBuilder()
.setName(
UtilizationReportName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString())
.setRequestId("requestId693933066")
.build();
vmMigrationClient.deleteUtilizationReportAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteUtilizationReportRequest,com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteUtilizationReportRequest request =
DeleteUtilizationReportRequest.newBuilder()
.setName(
UtilizationReportName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteUtilizationReportOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteUtilizationReportRequest,com.google.longrunning.Operation> deleteUtilizationReportCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteUtilizationReportRequest request =
DeleteUtilizationReportRequest.newBuilder()
.setName(
UtilizationReportName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[UTILIZATION_REPORT]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.deleteUtilizationReportCallable().futureCall(request);
// Do something.
future.get();
}
public final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(SourceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
for (DatacenterConnector element :
vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of connectors.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
for (DatacenterConnector element :
vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of connectors.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(ListDatacenterConnectorsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListDatacenterConnectorsRequest request =
ListDatacenterConnectorsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (DatacenterConnector element :
vmMigrationClient.listDatacenterConnectors(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDatacenterConnectorsRequest,VmMigrationClient.ListDatacenterConnectorsPagedResponse> listDatacenterConnectorsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListDatacenterConnectorsRequest request =
ListDatacenterConnectorsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<DatacenterConnector> future =
vmMigrationClient.listDatacenterConnectorsPagedCallable().futureCall(request);
// Do something.
for (DatacenterConnector element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDatacenterConnectorsRequest,ListDatacenterConnectorsResponse> listDatacenterConnectorsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListDatacenterConnectorsRequest request =
ListDatacenterConnectorsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListDatacenterConnectorsResponse response =
vmMigrationClient.listDatacenterConnectorsCallable().call(request);
for (DatacenterConnector element : response.getDatacenterConnectorsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final DatacenterConnector getDatacenterConnector(DatacenterConnectorName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DatacenterConnectorName name =
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]");
DatacenterConnector response = vmMigrationClient.getDatacenterConnector(name);
}
name - Required. The name of the DatacenterConnector.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatacenterConnector getDatacenterConnector(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString();
DatacenterConnector response = vmMigrationClient.getDatacenterConnector(name);
}
name - Required. The name of the DatacenterConnector.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatacenterConnector getDatacenterConnector(GetDatacenterConnectorRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetDatacenterConnectorRequest request =
GetDatacenterConnectorRequest.newBuilder()
.setName(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.build();
DatacenterConnector response = vmMigrationClient.getDatacenterConnector(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDatacenterConnectorRequest,DatacenterConnector> getDatacenterConnectorCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetDatacenterConnectorRequest request =
GetDatacenterConnectorRequest.newBuilder()
.setName(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.build();
ApiFuture<DatacenterConnector> future =
vmMigrationClient.getDatacenterConnectorCallable().futureCall(request);
// Do something.
DatacenterConnector response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(SourceName parent, DatacenterConnector datacenterConnector, String datacenterConnectorId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build();
String datacenterConnectorId = "datacenterConnectorId-761889719";
DatacenterConnector response =
vmMigrationClient
.createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId)
.get();
}
parent - Required. The DatacenterConnector's parent. Required. The Source in where the new
DatacenterConnector will be created. For example:
`projects/my-project/locations/us-central1/sources/my-source`datacenterConnector - Required. The create request body.datacenterConnectorId - Required. The datacenterConnector identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(String parent, DatacenterConnector datacenterConnector, String datacenterConnectorId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build();
String datacenterConnectorId = "datacenterConnectorId-761889719";
DatacenterConnector response =
vmMigrationClient
.createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId)
.get();
}
parent - Required. The DatacenterConnector's parent. Required. The Source in where the new
DatacenterConnector will be created. For example:
`projects/my-project/locations/us-central1/sources/my-source`datacenterConnector - Required. The create request body.datacenterConnectorId - Required. The datacenterConnector identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(CreateDatacenterConnectorRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateDatacenterConnectorRequest request =
CreateDatacenterConnectorRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setDatacenterConnectorId("datacenterConnectorId-761889719")
.setDatacenterConnector(DatacenterConnector.newBuilder().build())
.setRequestId("requestId693933066")
.build();
DatacenterConnector response =
vmMigrationClient.createDatacenterConnectorAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateDatacenterConnectorRequest,DatacenterConnector,OperationMetadata> createDatacenterConnectorOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateDatacenterConnectorRequest request =
CreateDatacenterConnectorRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setDatacenterConnectorId("datacenterConnectorId-761889719")
.setDatacenterConnector(DatacenterConnector.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<DatacenterConnector, OperationMetadata> future =
vmMigrationClient.createDatacenterConnectorOperationCallable().futureCall(request);
// Do something.
DatacenterConnector response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateDatacenterConnectorRequest,com.google.longrunning.Operation> createDatacenterConnectorCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateDatacenterConnectorRequest request =
CreateDatacenterConnectorRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setDatacenterConnectorId("datacenterConnectorId-761889719")
.setDatacenterConnector(DatacenterConnector.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.createDatacenterConnectorCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(DatacenterConnectorName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DatacenterConnectorName name =
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]");
vmMigrationClient.deleteDatacenterConnectorAsync(name).get();
}
name - Required. The DatacenterConnector name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString();
vmMigrationClient.deleteDatacenterConnectorAsync(name).get();
}
name - Required. The DatacenterConnector name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(DeleteDatacenterConnectorRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteDatacenterConnectorRequest request =
DeleteDatacenterConnectorRequest.newBuilder()
.setName(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
vmMigrationClient.deleteDatacenterConnectorAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteDatacenterConnectorRequest,com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteDatacenterConnectorRequest request =
DeleteDatacenterConnectorRequest.newBuilder()
.setName(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteDatacenterConnectorOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDatacenterConnectorRequest,com.google.longrunning.Operation> deleteDatacenterConnectorCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteDatacenterConnectorRequest request =
DeleteDatacenterConnectorRequest.newBuilder()
.setName(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.deleteDatacenterConnectorCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<UpgradeApplianceResponse,OperationMetadata> upgradeApplianceAsync(UpgradeApplianceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpgradeApplianceRequest request =
UpgradeApplianceRequest.newBuilder()
.setDatacenterConnector(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
UpgradeApplianceResponse response = vmMigrationClient.upgradeApplianceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpgradeApplianceRequest,UpgradeApplianceResponse,OperationMetadata> upgradeApplianceOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpgradeApplianceRequest request =
UpgradeApplianceRequest.newBuilder()
.setDatacenterConnector(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<UpgradeApplianceResponse, OperationMetadata> future =
vmMigrationClient.upgradeApplianceOperationCallable().futureCall(request);
// Do something.
UpgradeApplianceResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpgradeApplianceRequest,com.google.longrunning.Operation> upgradeApplianceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpgradeApplianceRequest request =
UpgradeApplianceRequest.newBuilder()
.setDatacenterConnector(
DatacenterConnectorName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[DATACENTER_CONNECTOR]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.upgradeApplianceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(SourceName parent, MigratingVm migratingVm, String migratingVmId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
MigratingVm migratingVm = MigratingVm.newBuilder().build();
String migratingVmId = "migratingVmId441244154";
MigratingVm response =
vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get();
}
parent - Required. The MigratingVm's parent.migratingVm - Required. The create request body.migratingVmId - Required. The migratingVm identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(String parent, MigratingVm migratingVm, String migratingVmId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
MigratingVm migratingVm = MigratingVm.newBuilder().build();
String migratingVmId = "migratingVmId441244154";
MigratingVm response =
vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get();
}
parent - Required. The MigratingVm's parent.migratingVm - Required. The create request body.migratingVmId - Required. The migratingVm identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(CreateMigratingVmRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateMigratingVmRequest request =
CreateMigratingVmRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setMigratingVmId("migratingVmId441244154")
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
MigratingVm response = vmMigrationClient.createMigratingVmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateMigratingVmRequest,MigratingVm,OperationMetadata> createMigratingVmOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateMigratingVmRequest request =
CreateMigratingVmRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setMigratingVmId("migratingVmId441244154")
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<MigratingVm, OperationMetadata> future =
vmMigrationClient.createMigratingVmOperationCallable().futureCall(request);
// Do something.
MigratingVm response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateMigratingVmRequest,com.google.longrunning.Operation> createMigratingVmCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateMigratingVmRequest request =
CreateMigratingVmRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setMigratingVmId("migratingVmId441244154")
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.createMigratingVmCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final VmMigrationClient.ListMigratingVmsPagedResponse listMigratingVms(SourceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
SourceName parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]");
for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of MigratingVms.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListMigratingVmsPagedResponse listMigratingVms(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString();
for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of MigratingVms.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListMigratingVmsPagedResponse listMigratingVms(ListMigratingVmsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListMigratingVmsRequest request =
ListMigratingVmsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(MigratingVmView.forNumber(0))
.build();
for (MigratingVm element : vmMigrationClient.listMigratingVms(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListMigratingVmsRequest,VmMigrationClient.ListMigratingVmsPagedResponse> listMigratingVmsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListMigratingVmsRequest request =
ListMigratingVmsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(MigratingVmView.forNumber(0))
.build();
ApiFuture<MigratingVm> future =
vmMigrationClient.listMigratingVmsPagedCallable().futureCall(request);
// Do something.
for (MigratingVm element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListMigratingVmsRequest,ListMigratingVmsResponse> listMigratingVmsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListMigratingVmsRequest request =
ListMigratingVmsRequest.newBuilder()
.setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setView(MigratingVmView.forNumber(0))
.build();
while (true) {
ListMigratingVmsResponse response =
vmMigrationClient.listMigratingVmsCallable().call(request);
for (MigratingVm element : response.getMigratingVmsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final MigratingVm getMigratingVm(MigratingVmName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName name =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
MigratingVm response = vmMigrationClient.getMigratingVm(name);
}
name - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final MigratingVm getMigratingVm(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
MigratingVm response = vmMigrationClient.getMigratingVm(name);
}
name - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final MigratingVm getMigratingVm(GetMigratingVmRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetMigratingVmRequest request =
GetMigratingVmRequest.newBuilder()
.setName(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setView(MigratingVmView.forNumber(0))
.build();
MigratingVm response = vmMigrationClient.getMigratingVm(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetMigratingVmRequest,MigratingVm> getMigratingVmCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetMigratingVmRequest request =
GetMigratingVmRequest.newBuilder()
.setName(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setView(MigratingVmView.forNumber(0))
.build();
ApiFuture<MigratingVm> future =
vmMigrationClient.getMigratingVmCallable().futureCall(request);
// Do something.
MigratingVm response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> updateMigratingVmAsync(MigratingVm migratingVm, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVm migratingVm = MigratingVm.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
MigratingVm response =
vmMigrationClient.updateMigratingVmAsync(migratingVm, updateMask).get();
}
migratingVm - Required. The update request body.updateMask - Field mask is used to specify the fields to be overwritten in the MigratingVm
resource by the update. The fields specified in the update_mask are relative to the
resource, not the full request. A field will be overwritten if it is in the mask. If the
user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<MigratingVm,OperationMetadata> updateMigratingVmAsync(UpdateMigratingVmRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateMigratingVmRequest request =
UpdateMigratingVmRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
MigratingVm response = vmMigrationClient.updateMigratingVmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateMigratingVmRequest,MigratingVm,OperationMetadata> updateMigratingVmOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateMigratingVmRequest request =
UpdateMigratingVmRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<MigratingVm, OperationMetadata> future =
vmMigrationClient.updateMigratingVmOperationCallable().futureCall(request);
// Do something.
MigratingVm response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateMigratingVmRequest,com.google.longrunning.Operation> updateMigratingVmCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateMigratingVmRequest request =
UpdateMigratingVmRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setMigratingVm(MigratingVm.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.updateMigratingVmCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(MigratingVmName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName name =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
vmMigrationClient.deleteMigratingVmAsync(name).get();
}
name - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
vmMigrationClient.deleteMigratingVmAsync(name).get();
}
name - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(DeleteMigratingVmRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteMigratingVmRequest request =
DeleteMigratingVmRequest.newBuilder()
.setName(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
vmMigrationClient.deleteMigratingVmAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteMigratingVmRequest,com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteMigratingVmRequest request =
DeleteMigratingVmRequest.newBuilder()
.setName(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteMigratingVmOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteMigratingVmRequest,com.google.longrunning.Operation> deleteMigratingVmCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteMigratingVmRequest request =
DeleteMigratingVmRequest.newBuilder()
.setName(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future =
vmMigrationClient.deleteMigratingVmCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(MigratingVmName migratingVm)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName migratingVm =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
StartMigrationResponse response = vmMigrationClient.startMigrationAsync(migratingVm).get();
}
migratingVm - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(String migratingVm)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String migratingVm =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
StartMigrationResponse response = vmMigrationClient.startMigrationAsync(migratingVm).get();
}
migratingVm - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(StartMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
StartMigrationRequest request =
StartMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
StartMigrationResponse response = vmMigrationClient.startMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<StartMigrationRequest,StartMigrationResponse,OperationMetadata> startMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
StartMigrationRequest request =
StartMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<StartMigrationResponse, OperationMetadata> future =
vmMigrationClient.startMigrationOperationCallable().futureCall(request);
// Do something.
StartMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartMigrationRequest,com.google.longrunning.Operation> startMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
StartMigrationRequest request =
StartMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future = vmMigrationClient.startMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ResumeMigrationResponse,OperationMetadata> resumeMigrationAsync(ResumeMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ResumeMigrationRequest request =
ResumeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ResumeMigrationResponse response = vmMigrationClient.resumeMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ResumeMigrationRequest,ResumeMigrationResponse,OperationMetadata> resumeMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ResumeMigrationRequest request =
ResumeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<ResumeMigrationResponse, OperationMetadata> future =
vmMigrationClient.resumeMigrationOperationCallable().futureCall(request);
// Do something.
ResumeMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ResumeMigrationRequest,com.google.longrunning.Operation> resumeMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ResumeMigrationRequest request =
ResumeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future = vmMigrationClient.resumeMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<PauseMigrationResponse,OperationMetadata> pauseMigrationAsync(PauseMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
PauseMigrationRequest request =
PauseMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
PauseMigrationResponse response = vmMigrationClient.pauseMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PauseMigrationRequest,PauseMigrationResponse,OperationMetadata> pauseMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
PauseMigrationRequest request =
PauseMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<PauseMigrationResponse, OperationMetadata> future =
vmMigrationClient.pauseMigrationOperationCallable().futureCall(request);
// Do something.
PauseMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PauseMigrationRequest,com.google.longrunning.Operation> pauseMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
PauseMigrationRequest request =
PauseMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future = vmMigrationClient.pauseMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(MigratingVmName migratingVm)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName migratingVm =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
FinalizeMigrationResponse response =
vmMigrationClient.finalizeMigrationAsync(migratingVm).get();
}
migratingVm - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(String migratingVm)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String migratingVm =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
FinalizeMigrationResponse response =
vmMigrationClient.finalizeMigrationAsync(migratingVm).get();
}
migratingVm - Required. The name of the MigratingVm.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(FinalizeMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
FinalizeMigrationRequest request =
FinalizeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
FinalizeMigrationResponse response = vmMigrationClient.finalizeMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<FinalizeMigrationRequest,FinalizeMigrationResponse,OperationMetadata> finalizeMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
FinalizeMigrationRequest request =
FinalizeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<FinalizeMigrationResponse, OperationMetadata> future =
vmMigrationClient.finalizeMigrationOperationCallable().futureCall(request);
// Do something.
FinalizeMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<FinalizeMigrationRequest,com.google.longrunning.Operation> finalizeMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
FinalizeMigrationRequest request =
FinalizeMigrationRequest.newBuilder()
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future =
vmMigrationClient.finalizeMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(MigratingVmName parent, CloneJob cloneJob, String cloneJobId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
CloneJob cloneJob = CloneJob.newBuilder().build();
String cloneJobId = "cloneJobId2071309915";
CloneJob response = vmMigrationClient.createCloneJobAsync(parent, cloneJob, cloneJobId).get();
}
parent - Required. The Clone's parent.cloneJob - Required. The clone request body.cloneJobId - Required. The clone job identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(String parent, CloneJob cloneJob, String cloneJobId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
CloneJob cloneJob = CloneJob.newBuilder().build();
String cloneJobId = "cloneJobId2071309915";
CloneJob response = vmMigrationClient.createCloneJobAsync(parent, cloneJob, cloneJobId).get();
}
parent - Required. The Clone's parent.cloneJob - Required. The clone request body.cloneJobId - Required. The clone job identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(CreateCloneJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCloneJobRequest request =
CreateCloneJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCloneJobId("cloneJobId2071309915")
.setCloneJob(CloneJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
CloneJob response = vmMigrationClient.createCloneJobAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateCloneJobRequest,CloneJob,OperationMetadata> createCloneJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCloneJobRequest request =
CreateCloneJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCloneJobId("cloneJobId2071309915")
.setCloneJob(CloneJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<CloneJob, OperationMetadata> future =
vmMigrationClient.createCloneJobOperationCallable().futureCall(request);
// Do something.
CloneJob response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateCloneJobRequest,com.google.longrunning.Operation> createCloneJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCloneJobRequest request =
CreateCloneJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCloneJobId("cloneJobId2071309915")
.setCloneJob(CloneJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.createCloneJobCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(CloneJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CloneJobName name =
CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]");
CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get();
}
name - Required. The clone job idcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString();
CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get();
}
name - Required. The clone job idcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(CancelCloneJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCloneJobRequest request =
CancelCloneJobRequest.newBuilder()
.setName(
CloneJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString())
.build();
CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CancelCloneJobRequest,CancelCloneJobResponse,OperationMetadata> cancelCloneJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCloneJobRequest request =
CancelCloneJobRequest.newBuilder()
.setName(
CloneJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString())
.build();
OperationFuture<CancelCloneJobResponse, OperationMetadata> future =
vmMigrationClient.cancelCloneJobOperationCallable().futureCall(request);
// Do something.
CancelCloneJobResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CancelCloneJobRequest,com.google.longrunning.Operation> cancelCloneJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCloneJobRequest request =
CancelCloneJobRequest.newBuilder()
.setName(
CloneJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString())
.build();
ApiFuture<Operation> future = vmMigrationClient.cancelCloneJobCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final VmMigrationClient.ListCloneJobsPagedResponse listCloneJobs(MigratingVmName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
for (CloneJob element : vmMigrationClient.listCloneJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of source VMs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListCloneJobsPagedResponse listCloneJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
for (CloneJob element : vmMigrationClient.listCloneJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of source VMs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListCloneJobsPagedResponse listCloneJobs(ListCloneJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCloneJobsRequest request =
ListCloneJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (CloneJob element : vmMigrationClient.listCloneJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCloneJobsRequest,VmMigrationClient.ListCloneJobsPagedResponse> listCloneJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCloneJobsRequest request =
ListCloneJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<CloneJob> future =
vmMigrationClient.listCloneJobsPagedCallable().futureCall(request);
// Do something.
for (CloneJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCloneJobsRequest,ListCloneJobsResponse> listCloneJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCloneJobsRequest request =
ListCloneJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListCloneJobsResponse response = vmMigrationClient.listCloneJobsCallable().call(request);
for (CloneJob element : response.getCloneJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final CloneJob getCloneJob(CloneJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CloneJobName name =
CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]");
CloneJob response = vmMigrationClient.getCloneJob(name);
}
name - Required. The name of the CloneJob.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CloneJob getCloneJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString();
CloneJob response = vmMigrationClient.getCloneJob(name);
}
name - Required. The name of the CloneJob.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CloneJob getCloneJob(GetCloneJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetCloneJobRequest request =
GetCloneJobRequest.newBuilder()
.setName(
CloneJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString())
.build();
CloneJob response = vmMigrationClient.getCloneJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCloneJobRequest,CloneJob> getCloneJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetCloneJobRequest request =
GetCloneJobRequest.newBuilder()
.setName(
CloneJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]")
.toString())
.build();
ApiFuture<CloneJob> future = vmMigrationClient.getCloneJobCallable().futureCall(request);
// Do something.
CloneJob response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(MigratingVmName parent, CutoverJob cutoverJob, String cutoverJobId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
CutoverJob cutoverJob = CutoverJob.newBuilder().build();
String cutoverJobId = "cutoverJobId-2003089086";
CutoverJob response =
vmMigrationClient.createCutoverJobAsync(parent, cutoverJob, cutoverJobId).get();
}
parent - Required. The Cutover's parent.cutoverJob - Required. The cutover request body.cutoverJobId - Required. The cutover job identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(String parent, CutoverJob cutoverJob, String cutoverJobId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
CutoverJob cutoverJob = CutoverJob.newBuilder().build();
String cutoverJobId = "cutoverJobId-2003089086";
CutoverJob response =
vmMigrationClient.createCutoverJobAsync(parent, cutoverJob, cutoverJobId).get();
}
parent - Required. The Cutover's parent.cutoverJob - Required. The cutover request body.cutoverJobId - Required. The cutover job identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(CreateCutoverJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCutoverJobRequest request =
CreateCutoverJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCutoverJobId("cutoverJobId-2003089086")
.setCutoverJob(CutoverJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
CutoverJob response = vmMigrationClient.createCutoverJobAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateCutoverJobRequest,CutoverJob,OperationMetadata> createCutoverJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCutoverJobRequest request =
CreateCutoverJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCutoverJobId("cutoverJobId-2003089086")
.setCutoverJob(CutoverJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<CutoverJob, OperationMetadata> future =
vmMigrationClient.createCutoverJobOperationCallable().futureCall(request);
// Do something.
CutoverJob response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateCutoverJobRequest,com.google.longrunning.Operation> createCutoverJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateCutoverJobRequest request =
CreateCutoverJobRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setCutoverJobId("cutoverJobId-2003089086")
.setCutoverJob(CutoverJob.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.createCutoverJobCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(CutoverJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CutoverJobName name =
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]");
CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get();
}
name - Required. The cutover job idcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString();
CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get();
}
name - Required. The cutover job idcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(CancelCutoverJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCutoverJobRequest request =
CancelCutoverJobRequest.newBuilder()
.setName(
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString())
.build();
CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CancelCutoverJobRequest,CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCutoverJobRequest request =
CancelCutoverJobRequest.newBuilder()
.setName(
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString())
.build();
OperationFuture<CancelCutoverJobResponse, OperationMetadata> future =
vmMigrationClient.cancelCutoverJobOperationCallable().futureCall(request);
// Do something.
CancelCutoverJobResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CancelCutoverJobRequest,com.google.longrunning.Operation> cancelCutoverJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CancelCutoverJobRequest request =
CancelCutoverJobRequest.newBuilder()
.setName(
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString())
.build();
ApiFuture<Operation> future =
vmMigrationClient.cancelCutoverJobCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final VmMigrationClient.ListCutoverJobsPagedResponse listCutoverJobs(MigratingVmName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
MigratingVmName parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]");
for (CutoverJob element : vmMigrationClient.listCutoverJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of migrating VMs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListCutoverJobsPagedResponse listCutoverJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent =
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString();
for (CutoverJob element : vmMigrationClient.listCutoverJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of migrating VMs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListCutoverJobsPagedResponse listCutoverJobs(ListCutoverJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCutoverJobsRequest request =
ListCutoverJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (CutoverJob element : vmMigrationClient.listCutoverJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCutoverJobsRequest,VmMigrationClient.ListCutoverJobsPagedResponse> listCutoverJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCutoverJobsRequest request =
ListCutoverJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<CutoverJob> future =
vmMigrationClient.listCutoverJobsPagedCallable().futureCall(request);
// Do something.
for (CutoverJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCutoverJobsRequest,ListCutoverJobsResponse> listCutoverJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListCutoverJobsRequest request =
ListCutoverJobsRequest.newBuilder()
.setParent(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListCutoverJobsResponse response =
vmMigrationClient.listCutoverJobsCallable().call(request);
for (CutoverJob element : response.getCutoverJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final CutoverJob getCutoverJob(CutoverJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CutoverJobName name =
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]");
CutoverJob response = vmMigrationClient.getCutoverJob(name);
}
name - Required. The name of the CutoverJob.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CutoverJob getCutoverJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name =
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString();
CutoverJob response = vmMigrationClient.getCutoverJob(name);
}
name - Required. The name of the CutoverJob.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CutoverJob getCutoverJob(GetCutoverJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetCutoverJobRequest request =
GetCutoverJobRequest.newBuilder()
.setName(
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString())
.build();
CutoverJob response = vmMigrationClient.getCutoverJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCutoverJobRequest,CutoverJob> getCutoverJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetCutoverJobRequest request =
GetCutoverJobRequest.newBuilder()
.setName(
CutoverJobName.of(
"[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]")
.toString())
.build();
ApiFuture<CutoverJob> future = vmMigrationClient.getCutoverJobCallable().futureCall(request);
// Do something.
CutoverJob response = future.get();
}
public final VmMigrationClient.ListGroupsPagedResponse listGroups(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of groups.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListGroupsPagedResponse listGroups(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of groups.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListGroupsPagedResponse listGroups(ListGroupsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Group element : vmMigrationClient.listGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListGroupsRequest,VmMigrationClient.ListGroupsPagedResponse> listGroupsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Group> future = vmMigrationClient.listGroupsPagedCallable().futureCall(request);
// Do something.
for (Group element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListGroupsRequest,ListGroupsResponse> listGroupsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGroupsResponse response = vmMigrationClient.listGroupsCallable().call(request);
for (Group element : response.getGroupsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Group getGroup(GroupName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GroupName name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]");
Group response = vmMigrationClient.getGroup(name);
}
name - Required. The group name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Group getGroup(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString();
Group response = vmMigrationClient.getGroup(name);
}
name - Required. The group name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Group getGroup(GetGroupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.build();
Group response = vmMigrationClient.getGroup(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetGroupRequest,Group> getGroupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.build();
ApiFuture<Group> future = vmMigrationClient.getGroupCallable().futureCall(request);
// Do something.
Group response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> createGroupAsync(LocationName parent, Group group, String groupId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Group group = Group.newBuilder().build();
String groupId = "groupId293428218";
Group response = vmMigrationClient.createGroupAsync(parent, group, groupId).get();
}
parent - Required. The Group's parent.group - Required. The create request body.groupId - Required. The group identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> createGroupAsync(String parent, Group group, String groupId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Group group = Group.newBuilder().build();
String groupId = "groupId293428218";
Group response = vmMigrationClient.createGroupAsync(parent, group, groupId).get();
}
parent - Required. The Group's parent.group - Required. The create request body.groupId - Required. The group identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> createGroupAsync(CreateGroupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateGroupRequest request =
CreateGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setGroupId("groupId293428218")
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Group response = vmMigrationClient.createGroupAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateGroupRequest,Group,OperationMetadata> createGroupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateGroupRequest request =
CreateGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setGroupId("groupId293428218")
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Group, OperationMetadata> future =
vmMigrationClient.createGroupOperationCallable().futureCall(request);
// Do something.
Group response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateGroupRequest,com.google.longrunning.Operation> createGroupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateGroupRequest request =
CreateGroupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setGroupId("groupId293428218")
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.createGroupCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> updateGroupAsync(Group group, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
Group group = Group.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Group response = vmMigrationClient.updateGroupAsync(group, updateMask).get();
}
group - Required. The update request body.updateMask - Field mask is used to specify the fields to be overwritten in the Group
resource by the update. The fields specified in the update_mask are relative to the
resource, not the full request. A field will be overwritten if it is in the mask. If the
user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Group,OperationMetadata> updateGroupAsync(UpdateGroupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Group response = vmMigrationClient.updateGroupAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateGroupRequest,Group,OperationMetadata> updateGroupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Group, OperationMetadata> future =
vmMigrationClient.updateGroupOperationCallable().futureCall(request);
// Do something.
Group response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateGroupRequest,com.google.longrunning.Operation> updateGroupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.updateGroupCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(GroupName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GroupName name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]");
vmMigrationClient.deleteGroupAsync(name).get();
}
name - Required. The Group name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString();
vmMigrationClient.deleteGroupAsync(name).get();
}
name - Required. The Group name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(DeleteGroupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteGroupRequest request =
DeleteGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setRequestId("requestId693933066")
.build();
vmMigrationClient.deleteGroupAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteGroupRequest,com.google.protobuf.Empty,OperationMetadata> deleteGroupOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteGroupRequest request =
DeleteGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteGroupOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteGroupRequest,com.google.longrunning.Operation> deleteGroupCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteGroupRequest request =
DeleteGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = vmMigrationClient.deleteGroupCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(GroupName group)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GroupName group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]");
AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(group).get();
}
group - Required. The full path name of the Group to add to.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(String group)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString();
AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(group).get();
}
group - Required. The full path name of the Group to add to.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(AddGroupMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
AddGroupMigrationRequest request =
AddGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
AddGroupMigrationResponse response = vmMigrationClient.addGroupMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddGroupMigrationRequest,AddGroupMigrationResponse,OperationMetadata> addGroupMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
AddGroupMigrationRequest request =
AddGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<AddGroupMigrationResponse, OperationMetadata> future =
vmMigrationClient.addGroupMigrationOperationCallable().futureCall(request);
// Do something.
AddGroupMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddGroupMigrationRequest,com.google.longrunning.Operation> addGroupMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
AddGroupMigrationRequest request =
AddGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future =
vmMigrationClient.addGroupMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(GroupName group)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GroupName group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]");
RemoveGroupMigrationResponse response =
vmMigrationClient.removeGroupMigrationAsync(group).get();
}
group - Required. The name of the Group.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(String group)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String group = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString();
RemoveGroupMigrationResponse response =
vmMigrationClient.removeGroupMigrationAsync(group).get();
}
group - Required. The name of the Group.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(RemoveGroupMigrationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
RemoveGroupMigrationRequest request =
RemoveGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
RemoveGroupMigrationResponse response =
vmMigrationClient.removeGroupMigrationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveGroupMigrationRequest,RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
RemoveGroupMigrationRequest request =
RemoveGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
OperationFuture<RemoveGroupMigrationResponse, OperationMetadata> future =
vmMigrationClient.removeGroupMigrationOperationCallable().futureCall(request);
// Do something.
RemoveGroupMigrationResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveGroupMigrationRequest,com.google.longrunning.Operation> removeGroupMigrationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
RemoveGroupMigrationRequest request =
RemoveGroupMigrationRequest.newBuilder()
.setGroup(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString())
.setMigratingVm(
MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]")
.toString())
.build();
ApiFuture<Operation> future =
vmMigrationClient.removeGroupMigrationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final VmMigrationClient.ListTargetProjectsPagedResponse listTargetProjects(LocationName parent)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (TargetProject element : vmMigrationClient.listTargetProjects(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of targets.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListTargetProjectsPagedResponse listTargetProjects(String parent)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (TargetProject element : vmMigrationClient.listTargetProjects(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent, which owns this collection of targets.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VmMigrationClient.ListTargetProjectsPagedResponse listTargetProjects(ListTargetProjectsRequest request)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListTargetProjectsRequest request =
ListTargetProjectsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (TargetProject element : vmMigrationClient.listTargetProjects(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListTargetProjectsRequest,VmMigrationClient.ListTargetProjectsPagedResponse> listTargetProjectsPagedCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListTargetProjectsRequest request =
ListTargetProjectsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<TargetProject> future =
vmMigrationClient.listTargetProjectsPagedCallable().futureCall(request);
// Do something.
for (TargetProject element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTargetProjectsRequest,ListTargetProjectsResponse> listTargetProjectsCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
ListTargetProjectsRequest request =
ListTargetProjectsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListTargetProjectsResponse response =
vmMigrationClient.listTargetProjectsCallable().call(request);
for (TargetProject element : response.getTargetProjectsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final TargetProject getTargetProject(TargetProjectName name)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
TargetProjectName name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]");
TargetProject response = vmMigrationClient.getTargetProject(name);
}
name - Required. The TargetProject name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetProject getTargetProject(String name)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString();
TargetProject response = vmMigrationClient.getTargetProject(name);
}
name - Required. The TargetProject name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final TargetProject getTargetProject(GetTargetProjectRequest request)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetTargetProjectRequest request =
GetTargetProjectRequest.newBuilder()
.setName(
TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString())
.build();
TargetProject response = vmMigrationClient.getTargetProject(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetTargetProjectRequest,TargetProject> getTargetProjectCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
GetTargetProjectRequest request =
GetTargetProjectRequest.newBuilder()
.setName(
TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString())
.build();
ApiFuture<TargetProject> future =
vmMigrationClient.getTargetProjectCallable().futureCall(request);
// Do something.
TargetProject response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(LocationName parent, TargetProject targetProject, String targetProjectId)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
TargetProject targetProject = TargetProject.newBuilder().build();
String targetProjectId = "targetProjectId1290130307";
TargetProject response =
vmMigrationClient.createTargetProjectAsync(parent, targetProject, targetProjectId).get();
}
parent - Required. The TargetProject's parent.targetProject - Required. The create request body.targetProjectId - Required. The target_project identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(String parent, TargetProject targetProject, String targetProjectId)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
TargetProject targetProject = TargetProject.newBuilder().build();
String targetProjectId = "targetProjectId1290130307";
TargetProject response =
vmMigrationClient.createTargetProjectAsync(parent, targetProject, targetProjectId).get();
}
parent - Required. The TargetProject's parent.targetProject - Required. The create request body.targetProjectId - Required. The target_project identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(CreateTargetProjectRequest request)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateTargetProjectRequest request =
CreateTargetProjectRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTargetProjectId("targetProjectId1290130307")
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
TargetProject response = vmMigrationClient.createTargetProjectAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateTargetProjectRequest,TargetProject,OperationMetadata> createTargetProjectOperationCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateTargetProjectRequest request =
CreateTargetProjectRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTargetProjectId("targetProjectId1290130307")
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<TargetProject, OperationMetadata> future =
vmMigrationClient.createTargetProjectOperationCallable().futureCall(request);
// Do something.
TargetProject response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateTargetProjectRequest,com.google.longrunning.Operation> createTargetProjectCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
CreateTargetProjectRequest request =
CreateTargetProjectRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTargetProjectId("targetProjectId1290130307")
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.createTargetProjectCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> updateTargetProjectAsync(TargetProject targetProject, com.google.protobuf.FieldMask updateMask)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
TargetProject targetProject = TargetProject.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TargetProject response =
vmMigrationClient.updateTargetProjectAsync(targetProject, updateMask).get();
}
targetProject - Required. The update request body.updateMask - Field mask is used to specify the fields to be overwritten in the
TargetProject resource by the update. The fields specified in the update_mask are relative
to the resource, not the full request. A field will be overwritten if it is in the mask. If
the user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<TargetProject,OperationMetadata> updateTargetProjectAsync(UpdateTargetProjectRequest request)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateTargetProjectRequest request =
UpdateTargetProjectRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
TargetProject response = vmMigrationClient.updateTargetProjectAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateTargetProjectRequest,TargetProject,OperationMetadata> updateTargetProjectOperationCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateTargetProjectRequest request =
UpdateTargetProjectRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<TargetProject, OperationMetadata> future =
vmMigrationClient.updateTargetProjectOperationCallable().futureCall(request);
// Do something.
TargetProject response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateTargetProjectRequest,com.google.longrunning.Operation> updateTargetProjectCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
UpdateTargetProjectRequest request =
UpdateTargetProjectRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setTargetProject(TargetProject.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.updateTargetProjectCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(TargetProjectName name)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
TargetProjectName name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]");
vmMigrationClient.deleteTargetProjectAsync(name).get();
}
name - Required. The TargetProject name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(String name)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
String name = TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString();
vmMigrationClient.deleteTargetProjectAsync(name).get();
}
name - Required. The TargetProject name.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(DeleteTargetProjectRequest request)
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteTargetProjectRequest request =
DeleteTargetProjectRequest.newBuilder()
.setName(
TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString())
.setRequestId("requestId693933066")
.build();
vmMigrationClient.deleteTargetProjectAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteTargetProjectRequest,com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectOperationCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteTargetProjectRequest request =
DeleteTargetProjectRequest.newBuilder()
.setName(
TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
vmMigrationClient.deleteTargetProjectOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteTargetProjectRequest,com.google.longrunning.Operation> deleteTargetProjectCallable()
NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) {
DeleteTargetProjectRequest request =
DeleteTargetProjectRequest.newBuilder()
.setName(
TargetProjectName.of("[PROJECT]", "[LOCATION]", "[TARGET_PROJECT]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
vmMigrationClient.deleteTargetProjectCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2022 Google LLC. All rights reserved.