Class VmMigrationClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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().
| Method | Description | Method Variants |
|---|---|---|
ListSources |
Lists Sources in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSource |
Gets details of a single Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateSource |
Creates a new Source in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSource |
Updates the parameters of a single Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSource |
Deletes a single Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchInventory |
List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FetchStorageInventory |
List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListUtilizationReports |
Lists Utilization Reports of the given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetUtilizationReport |
Gets a single Utilization Report. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateUtilizationReport |
Creates a new UtilizationReport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteUtilizationReport |
Deletes a single Utilization Report. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDatacenterConnectors |
Lists DatacenterConnectors in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDatacenterConnector |
Gets details of a single DatacenterConnector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDatacenterConnector |
Creates a new DatacenterConnector in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDatacenterConnector |
Deletes a single DatacenterConnector. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpgradeAppliance |
Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateMigratingVm |
Creates a new MigratingVm in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListMigratingVms |
Lists MigratingVms in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetMigratingVm |
Gets details of a single MigratingVm. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateMigratingVm |
Updates the parameters of a single MigratingVm. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteMigratingVm |
Deletes a single MigratingVm. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartMigration |
Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResumeMigration |
Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PauseMigration |
Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
FinalizeMigration |
Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExtendMigration |
Extend the migrating VM time to live. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCloneJob |
Initiates a Clone of a specific migrating VM. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CancelCloneJob |
Initiates the cancellation of a running clone job. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListCloneJobs |
Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCloneJob |
Gets details of a single CloneJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCutoverJob |
Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CancelCutoverJob |
Initiates the cancellation of a running cutover job. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListCutoverJobs |
Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCutoverJob |
Gets details of a single CutoverJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListGroups |
Lists Groups in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetGroup |
Gets details of a single Group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateGroup |
Creates a new Group in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateGroup |
Updates the parameters of a single Group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteGroup |
Deletes a single Group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddGroupMigration |
Adds a MigratingVm to a Group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveGroupMigration |
Removes a MigratingVm from a Group. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListTargetProjects |
Lists TargetProjects in a given project. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetTargetProject |
Gets details of a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateTargetProject |
Creates a new TargetProject in a given project. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateTargetProject |
Updates the parameters of a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteTargetProject |
Deletes a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListReplicationCycles |
Lists ReplicationCycles in a given MigratingVM. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetReplicationCycle |
Gets details of a single ReplicationCycle. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListImageImports |
Lists ImageImports in a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetImageImport |
Gets details of a single ImageImport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateImageImport |
Creates a new ImageImport in a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteImageImport |
Deletes a single ImageImport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListImageImportJobs |
Lists ImageImportJobs in a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetImageImportJob |
Gets details of a single ImageImportJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CancelImageImportJob |
Initiates the cancellation of a running ImageImportJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDiskMigrationJob |
Creates a new disk migration job in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDiskMigrationJobs |
Lists DiskMigrationJobs in a given Source. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDiskMigrationJob |
Gets details of a single DiskMigrationJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDiskMigrationJob |
Updates the parameters of a single DiskMigrationJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDiskMigrationJob |
Deletes a single DiskMigrationJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RunDiskMigrationJob |
Runs the disk migration job. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CancelDiskMigrationJob |
Cancels the disk migration job. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedVmMigrationClient(VmMigrationSettings settings) Constructs an instance of VmMigrationClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionAdds a MigratingVm to a Group.addGroupMigrationAsync(GroupName group) Adds a MigratingVm to a Group.addGroupMigrationAsync(String group) Adds a MigratingVm to a Group.Adds a MigratingVm to a Group.Adds a MigratingVm to a Group.booleanawaitTermination(long duration, TimeUnit unit) cancelCloneJobAsync(CancelCloneJobRequest request) Initiates the cancellation of a running clone job.Initiates the cancellation of a running clone job.cancelCloneJobAsync(String name) Initiates the cancellation of a running clone job.Initiates the cancellation of a running clone job.Initiates the cancellation of a running clone job.Initiates the cancellation of a running cutover job.Initiates the cancellation of a running cutover job.cancelCutoverJobAsync(String name) Initiates the cancellation of a running cutover job.Initiates the cancellation of a running cutover job.Initiates the cancellation of a running cutover job.Cancels the disk migration job.Cancels the disk migration job.final OperationCallable<CancelDiskMigrationJobRequest,CancelDiskMigrationJobResponse, OperationMetadata> Cancels the disk migration job.Initiates the cancellation of a running ImageImportJob.Initiates the cancellation of a running ImageImportJob.Initiates the cancellation of a running ImageImportJob.Initiates the cancellation of a running ImageImportJob.Initiates the cancellation of a running ImageImportJob.final voidclose()static final VmMigrationClientcreate()Constructs an instance of VmMigrationClient with default settings.static final VmMigrationClientcreate(VmMigrationStub stub) Constructs an instance of VmMigrationClient, using the given stub for making calls.static final VmMigrationClientcreate(VmMigrationSettings settings) Constructs an instance of VmMigrationClient, using the given settings.createCloneJobAsync(CreateCloneJobRequest request) Initiates a Clone of a specific migrating VM.createCloneJobAsync(MigratingVmName parent, CloneJob cloneJob, String cloneJobId) Initiates a Clone of a specific migrating VM.createCloneJobAsync(String parent, CloneJob cloneJob, String cloneJobId) Initiates a Clone of a specific migrating VM.Initiates a Clone of a specific migrating VM.Initiates a Clone of a specific migrating VM.Initiates a Cutover of a specific migrating VM.createCutoverJobAsync(MigratingVmName parent, CutoverJob cutoverJob, String cutoverJobId) Initiates a Cutover of a specific migrating VM.createCutoverJobAsync(String parent, CutoverJob cutoverJob, String cutoverJobId) Initiates a Cutover of a specific migrating VM.Initiates a Cutover of a specific migrating VM.Initiates a Cutover of a specific migrating VM.Creates a new DatacenterConnector in a given Source.createDatacenterConnectorAsync(SourceName parent, DatacenterConnector datacenterConnector, String datacenterConnectorId) Creates a new DatacenterConnector in a given Source.createDatacenterConnectorAsync(String parent, DatacenterConnector datacenterConnector, String datacenterConnectorId) Creates a new DatacenterConnector in a given Source.Creates a new DatacenterConnector in a given Source.Creates a new DatacenterConnector in a given Source.Creates a new disk migration job in a given Source.createDiskMigrationJobAsync(SourceName parent, DiskMigrationJob diskMigrationJob, String diskMigrationJobId) Creates a new disk migration job in a given Source.createDiskMigrationJobAsync(String parent, DiskMigrationJob diskMigrationJob, String diskMigrationJobId) Creates a new disk migration job in a given Source.Creates a new disk migration job in a given Source.Creates a new disk migration job in a given Source.createGroupAsync(CreateGroupRequest request) Creates a new Group in a given project and location.createGroupAsync(LocationName parent, Group group, String groupId) Creates a new Group in a given project and location.createGroupAsync(String parent, Group group, String groupId) Creates a new Group in a given project and location.Creates a new Group in a given project and location.Creates a new Group in a given project and location.Creates a new ImageImport in a given project.createImageImportAsync(LocationName parent, ImageImport imageImport, String imageImportId) Creates a new ImageImport in a given project.createImageImportAsync(String parent, ImageImport imageImport, String imageImportId) Creates a new ImageImport in a given project.Creates a new ImageImport in a given project.Creates a new ImageImport in a given project.Creates a new MigratingVm in a given Source.createMigratingVmAsync(SourceName parent, MigratingVm migratingVm, String migratingVmId) Creates a new MigratingVm in a given Source.createMigratingVmAsync(String parent, MigratingVm migratingVm, String migratingVmId) Creates a new MigratingVm in a given Source.Creates a new MigratingVm in a given Source.Creates a new MigratingVm in a given Source.createSourceAsync(CreateSourceRequest request) Creates a new Source in a given project and location.createSourceAsync(LocationName parent, Source source, String sourceId) Creates a new Source in a given project and location.createSourceAsync(String parent, Source source, String sourceId) Creates a new Source in a given project and location.Creates a new Source in a given project and location.Creates a new Source in a given project and location.Creates a new TargetProject in a given project.createTargetProjectAsync(LocationName parent, TargetProject targetProject, String targetProjectId) Creates a new TargetProject in a given project.createTargetProjectAsync(String parent, TargetProject targetProject, String targetProjectId) Creates a new TargetProject in a given project.Creates a new TargetProject in a given project.Creates a new TargetProject in a given project.Creates a new UtilizationReport.createUtilizationReportAsync(SourceName parent, UtilizationReport utilizationReport, String utilizationReportId) Creates a new UtilizationReport.createUtilizationReportAsync(String parent, UtilizationReport utilizationReport, String utilizationReportId) Creates a new UtilizationReport.Creates a new UtilizationReport.Creates a new UtilizationReport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DatacenterConnector.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DatacenterConnector.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DatacenterConnector.Deletes a single DatacenterConnector.final OperationCallable<DeleteDatacenterConnectorRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single DatacenterConnector.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DiskMigrationJob.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DiskMigrationJob.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DiskMigrationJob.Deletes a single DiskMigrationJob.final OperationCallable<DeleteDiskMigrationJobRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single DiskMigrationJob.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(DeleteGroupRequest request) Deletes a single Group.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(GroupName name) Deletes a single Group.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(String name) Deletes a single Group.Deletes a single Group.final OperationCallable<DeleteGroupRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Group.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ImageImport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single ImageImport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteImageImportAsync(String name) Deletes a single ImageImport.Deletes a single ImageImport.final OperationCallable<DeleteImageImportRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single ImageImport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single MigratingVm.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single MigratingVm.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(String name) Deletes a single MigratingVm.Deletes a single MigratingVm.final OperationCallable<DeleteMigratingVmRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single MigratingVm.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(DeleteSourceRequest request) Deletes a single Source.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(SourceName name) Deletes a single Source.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(String name) Deletes a single Source.Deletes a single Source.final OperationCallable<DeleteSourceRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Source.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TargetProject.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TargetProject.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single TargetProject.Deletes a single TargetProject.final OperationCallable<DeleteTargetProjectRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single TargetProject.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Utilization Report.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Utilization Report.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Utilization Report.Deletes a single Utilization Report.final OperationCallable<DeleteUtilizationReportRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Utilization Report.Extend the migrating VM time to live.Extend the migrating VM time to live.Extend the migrating VM time to live.final FetchInventoryResponsefetchInventory(FetchInventoryRequest request) List remote source's inventory of VMs.final FetchInventoryResponsefetchInventory(SourceName source) List remote source's inventory of VMs.final FetchInventoryResponsefetchInventory(String source) List remote source's inventory of VMs.List remote source's inventory of VMs.List remote source's inventory of storage resources.List remote source's inventory of storage resources.List remote source's inventory of storage resources.List remote source's inventory of storage resources.final UnaryCallable<FetchStorageInventoryRequest,VmMigrationClient.FetchStorageInventoryPagedResponse> List remote source's inventory of storage resources.Marks a migration as completed, deleting migration resources that are no longer being used.finalizeMigrationAsync(MigratingVmName migratingVm) Marks a migration as completed, deleting migration resources that are no longer being used.finalizeMigrationAsync(String migratingVm) Marks a migration as completed, deleting migration resources that are no longer being used.Marks a migration as completed, deleting migration resources that are no longer being used.Marks a migration as completed, deleting migration resources that are no longer being used.final CloneJobgetCloneJob(CloneJobName name) Gets details of a single CloneJob.final CloneJobgetCloneJob(GetCloneJobRequest request) Gets details of a single CloneJob.final CloneJobgetCloneJob(String name) Gets details of a single CloneJob.Gets details of a single CloneJob.final CutoverJobgetCutoverJob(CutoverJobName name) Gets details of a single CutoverJob.final CutoverJobgetCutoverJob(GetCutoverJobRequest request) Gets details of a single CutoverJob.final CutoverJobgetCutoverJob(String name) Gets details of a single CutoverJob.Gets details of a single CutoverJob.final DatacenterConnectorGets details of a single DatacenterConnector.final DatacenterConnectorGets details of a single DatacenterConnector.final DatacenterConnectorgetDatacenterConnector(String name) Gets details of a single DatacenterConnector.Gets details of a single DatacenterConnector.final DiskMigrationJobGets details of a single DiskMigrationJob.final DiskMigrationJobGets details of a single DiskMigrationJob.final DiskMigrationJobgetDiskMigrationJob(String name) Gets details of a single DiskMigrationJob.Gets details of a single DiskMigrationJob.final GroupgetGroup(GetGroupRequest request) Gets details of a single Group.final GroupGets details of a single Group.final GroupGets details of a single Group.final UnaryCallable<GetGroupRequest,Group> Gets details of a single Group.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ImageImportgetImageImport(GetImageImportRequest request) Gets details of a single ImageImport.final ImageImportGets details of a single ImageImport.final ImageImportgetImageImport(String name) Gets details of a single ImageImport.Gets details of a single ImageImport.final ImageImportJobGets details of a single ImageImportJob.final ImageImportJobGets details of a single ImageImportJob.final ImageImportJobgetImageImportJob(String name) Gets details of a single ImageImportJob.Gets details of a single ImageImportJob.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final MigratingVmgetMigratingVm(GetMigratingVmRequest request) Gets details of a single MigratingVm.final MigratingVmGets details of a single MigratingVm.final MigratingVmgetMigratingVm(String name) Gets details of a single MigratingVm.Gets details of a single MigratingVm.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ReplicationCycleGets details of a single ReplicationCycle.final ReplicationCycleGets details of a single ReplicationCycle.final ReplicationCyclegetReplicationCycle(String name) Gets details of a single ReplicationCycle.Gets details of a single ReplicationCycle.final VmMigrationSettingsfinal SourcegetSource(GetSourceRequest request) Gets details of a single Source.final SourcegetSource(SourceName name) Gets details of a single Source.final SourceGets details of a single Source.final UnaryCallable<GetSourceRequest,Source> Gets details of a single Source.getStub()final TargetProjectgetTargetProject(GetTargetProjectRequest request) Gets details of a single TargetProject.final TargetProjectGets details of a single TargetProject.final TargetProjectgetTargetProject(String name) Gets details of a single TargetProject.Gets details of a single TargetProject.final UtilizationReportGets a single Utilization Report.final UtilizationReportGets a single Utilization Report.final UtilizationReportgetUtilizationReport(String name) Gets a single Utilization Report.Gets a single Utilization Report.booleanbooleanlistCloneJobs(ListCloneJobsRequest request) Lists the CloneJobs of a migrating VM.listCloneJobs(MigratingVmName parent) Lists the CloneJobs of a migrating VM.listCloneJobs(String parent) Lists the CloneJobs of a migrating VM.Lists the CloneJobs of a migrating VM.Lists the CloneJobs of a migrating VM.listCutoverJobs(ListCutoverJobsRequest request) Lists the CutoverJobs of a migrating VM.listCutoverJobs(MigratingVmName parent) Lists the CutoverJobs of a migrating VM.listCutoverJobs(String parent) Lists the CutoverJobs of a migrating VM.Lists the CutoverJobs of a migrating VM.Lists the CutoverJobs of a migrating VM.Lists DatacenterConnectors in a given Source.listDatacenterConnectors(SourceName parent) Lists DatacenterConnectors in a given Source.listDatacenterConnectors(String parent) Lists DatacenterConnectors in a given Source.Lists DatacenterConnectors in a given Source.final UnaryCallable<ListDatacenterConnectorsRequest,VmMigrationClient.ListDatacenterConnectorsPagedResponse> Lists DatacenterConnectors in a given Source.Lists DiskMigrationJobs in a given Source.listDiskMigrationJobs(SourceName parent) Lists DiskMigrationJobs in a given Source.listDiskMigrationJobs(String parent) Lists DiskMigrationJobs in a given Source.Lists DiskMigrationJobs in a given Source.final UnaryCallable<ListDiskMigrationJobsRequest,VmMigrationClient.ListDiskMigrationJobsPagedResponse> Lists DiskMigrationJobs in a given Source.listGroups(ListGroupsRequest request) Lists Groups in a given project and location.listGroups(LocationName parent) Lists Groups in a given project and location.listGroups(String parent) Lists Groups in a given project and location.Lists Groups in a given project and location.Lists Groups in a given project and location.listImageImportJobs(ImageImportName parent) Lists ImageImportJobs in a given project.Lists ImageImportJobs in a given project.listImageImportJobs(String parent) Lists ImageImportJobs in a given project.Lists ImageImportJobs in a given project.Lists ImageImportJobs in a given project.listImageImports(ListImageImportsRequest request) Lists ImageImports in a given project.listImageImports(LocationName parent) Lists ImageImports in a given project.listImageImports(String parent) Lists ImageImports in a given project.Lists ImageImports in a given project.Lists ImageImports in a given project.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listMigratingVms(ListMigratingVmsRequest request) Lists MigratingVms in a given Source.listMigratingVms(SourceName parent) Lists MigratingVms in a given Source.listMigratingVms(String parent) Lists MigratingVms in a given Source.Lists MigratingVms in a given Source.Lists MigratingVms in a given Source.Lists ReplicationCycles in a given MigratingVM.listReplicationCycles(MigratingVmName parent) Lists ReplicationCycles in a given MigratingVM.listReplicationCycles(String parent) Lists ReplicationCycles in a given MigratingVM.Lists ReplicationCycles in a given MigratingVM.final UnaryCallable<ListReplicationCyclesRequest,VmMigrationClient.ListReplicationCyclesPagedResponse> Lists ReplicationCycles in a given MigratingVM.listSources(ListSourcesRequest request) Lists Sources in a given project and location.listSources(LocationName parent) Lists Sources in a given project and location.listSources(String parent) Lists Sources in a given project and location.Lists Sources in a given project and location.Lists Sources in a given project and location.Lists TargetProjects in a given project.listTargetProjects(LocationName parent) Lists TargetProjects in a given project.listTargetProjects(String parent) Lists TargetProjects in a given project.Lists TargetProjects in a given project.Lists TargetProjects in a given project.Lists Utilization Reports of the given Source.listUtilizationReports(SourceName parent) Lists Utilization Reports of the given Source.listUtilizationReports(String parent) Lists Utilization Reports of the given Source.Lists Utilization Reports of the given Source.final UnaryCallable<ListUtilizationReportsRequest,VmMigrationClient.ListUtilizationReportsPagedResponse> Lists Utilization Reports of the given Source.pauseMigrationAsync(PauseMigrationRequest request) Pauses a migration for a VM.Pauses a migration for a VM.Pauses a migration for a VM.Removes a MigratingVm from a Group.Removes a MigratingVm from a Group.removeGroupMigrationAsync(String group) Removes a MigratingVm from a Group.Removes a MigratingVm from a Group.Removes a MigratingVm from a Group.Resumes a migration for a VM.Resumes a migration for a VM.Resumes a migration for a VM.Runs the disk migration job.Runs the disk migration job.Runs the disk migration job.Runs the disk migration job.Runs the disk migration job.voidshutdown()voidstartMigrationAsync(MigratingVmName migratingVm) Starts migration for a VM.startMigrationAsync(StartMigrationRequest request) Starts migration for a VM.startMigrationAsync(String migratingVm) Starts migration for a VM.Starts migration for a VM.Starts migration for a VM.updateDiskMigrationJobAsync(DiskMigrationJob diskMigrationJob, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DiskMigrationJob.Updates the parameters of a single DiskMigrationJob.Updates the parameters of a single DiskMigrationJob.Updates the parameters of a single DiskMigrationJob.updateGroupAsync(Group group, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Group.updateGroupAsync(UpdateGroupRequest request) Updates the parameters of a single Group.Updates the parameters of a single Group.Updates the parameters of a single Group.updateMigratingVmAsync(MigratingVm migratingVm, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single MigratingVm.Updates the parameters of a single MigratingVm.Updates the parameters of a single MigratingVm.Updates the parameters of a single MigratingVm.updateSourceAsync(Source source, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Source.updateSourceAsync(UpdateSourceRequest request) Updates the parameters of a single Source.Updates the parameters of a single Source.Updates the parameters of a single Source.updateTargetProjectAsync(TargetProject targetProject, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single TargetProject.Updates the parameters of a single TargetProject.Updates the parameters of a single TargetProject.Updates the parameters of a single TargetProject.Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.
-
Constructor Details
-
VmMigrationClient
Constructs an instance of VmMigrationClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
VmMigrationClient
-
-
Method Details
-
create
Constructs an instance of VmMigrationClient with default settings.- Throws:
IOException
-
create
Constructs an instance of VmMigrationClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of VmMigrationClient, using the given stub for making calls. This is for advanced usage - prefer using create(VmMigrationSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listSources
Lists Sources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Source element : vmMigrationClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of sources.- Throws:
ApiException- if the remote call fails
-
listSources
Lists Sources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Source element : vmMigrationClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of sources.- Throws:
ApiException- if the remote call fails
-
listSources
Lists Sources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listSourcesPagedCallable
public final UnaryCallable<ListSourcesRequest,VmMigrationClient.ListSourcesPagedResponse> listSourcesPagedCallable()Lists Sources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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); } } -
listSourcesCallable
Lists Sources in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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; } } } -
getSource
Gets details of a single 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 name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); Source response = vmMigrationClient.getSource(name); }- Parameters:
name- Required. The Source name.- Throws:
ApiException- if the remote call fails
-
getSource
Gets details of a single 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 name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); Source response = vmMigrationClient.getSource(name); }- Parameters:
name- Required. The Source name.- Throws:
ApiException- if the remote call fails
-
getSource
Gets details of a single 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()) { GetSourceRequest request = GetSourceRequest.newBuilder() .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .build(); Source response = vmMigrationClient.getSource(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSourceCallable
Gets details of a single 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()) { 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(); } -
createSourceAsync
public final OperationFuture<Source,OperationMetadata> createSourceAsync(LocationName parent, Source source, String sourceId) Creates a new Source in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
parent- Required. The Source's parent.source- Required. The create request body.sourceId- Required. The source identifier.- Throws:
ApiException- if the remote call fails
-
createSourceAsync
public final OperationFuture<Source,OperationMetadata> createSourceAsync(String parent, Source source, String sourceId) Creates a new Source in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
parent- Required. The Source's parent.source- Required. The create request body.sourceId- Required. The source identifier.- Throws:
ApiException- if the remote call fails
-
createSourceAsync
public final OperationFuture<Source,OperationMetadata> createSourceAsync(CreateSourceRequest request) Creates a new Source in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSourceOperationCallable
public final OperationCallable<CreateSourceRequest,Source, createSourceOperationCallable()OperationMetadata> Creates a new Source in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
createSourceCallable
Creates a new Source in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
updateSourceAsync
public final OperationFuture<Source,OperationMetadata> updateSourceAsync(Source source, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single 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()) { Source source = Source.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Source response = vmMigrationClient.updateSourceAsync(source, updateMask).get(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
updateSourceAsync
public final OperationFuture<Source,OperationMetadata> updateSourceAsync(UpdateSourceRequest request) Updates the parameters of a single 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()) { UpdateSourceRequest request = UpdateSourceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setSource(Source.newBuilder().build()) .setRequestId("requestId693933066") .build(); Source response = vmMigrationClient.updateSourceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSourceOperationCallable
public final OperationCallable<UpdateSourceRequest,Source, updateSourceOperationCallable()OperationMetadata> Updates the parameters of a single 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()) { 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(); } -
updateSourceCallable
Updates the parameters of a single 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()) { 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(); } -
deleteSourceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(SourceName name) Deletes a single 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 name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); vmMigrationClient.deleteSourceAsync(name).get(); }- Parameters:
name- Required. The Source name.- Throws:
ApiException- if the remote call fails
-
deleteSourceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(String name) Deletes a single 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 name = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); vmMigrationClient.deleteSourceAsync(name).get(); }- Parameters:
name- Required. The Source name.- Throws:
ApiException- if the remote call fails
-
deleteSourceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteSourceAsync(DeleteSourceRequest request) Deletes a single 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()) { DeleteSourceRequest request = DeleteSourceRequest.newBuilder() .setName(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setRequestId("requestId693933066") .build(); vmMigrationClient.deleteSourceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteSourceOperationCallable
public final OperationCallable<DeleteSourceRequest,com.google.protobuf.Empty, deleteSourceOperationCallable()OperationMetadata> Deletes a single 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()) { 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(); } -
deleteSourceCallable
Deletes a single 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()) { 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(); } -
fetchInventory
List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
source- Required. The name of the Source.- Throws:
ApiException- if the remote call fails
-
fetchInventory
List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
source- Required. The name of the Source.- Throws:
ApiException- if the remote call fails
-
fetchInventory
List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchInventoryCallable
List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
fetchStorageInventory
public final VmMigrationClient.FetchStorageInventoryPagedResponse fetchStorageInventory(SourceName source, FetchStorageInventoryRequest.StorageType type) List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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]"); FetchStorageInventoryRequest.StorageType type = FetchStorageInventoryRequest.StorageType.forNumber(0); for (SourceStorageResource element : vmMigrationClient.fetchStorageInventory(source, type).iterateAll()) { // doThingsWith(element); } }- Parameters:
source- Required. The name of the Source.type- Required. The type of the storage inventory to fetch.- Throws:
ApiException- if the remote call fails
-
fetchStorageInventory
public final VmMigrationClient.FetchStorageInventoryPagedResponse fetchStorageInventory(String source, FetchStorageInventoryRequest.StorageType type) List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); FetchStorageInventoryRequest.StorageType type = FetchStorageInventoryRequest.StorageType.forNumber(0); for (SourceStorageResource element : vmMigrationClient.fetchStorageInventory(source, type).iterateAll()) { // doThingsWith(element); } }- Parameters:
source- Required. The name of the Source.type- Required. The type of the storage inventory to fetch.- Throws:
ApiException- if the remote call fails
-
fetchStorageInventory
public final VmMigrationClient.FetchStorageInventoryPagedResponse fetchStorageInventory(FetchStorageInventoryRequest request) List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { FetchStorageInventoryRequest request = FetchStorageInventoryRequest.newBuilder() .setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setForceRefresh(true) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SourceStorageResource element : vmMigrationClient.fetchStorageInventory(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
fetchStorageInventoryPagedCallable
public final UnaryCallable<FetchStorageInventoryRequest,VmMigrationClient.FetchStorageInventoryPagedResponse> fetchStorageInventoryPagedCallable()List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { FetchStorageInventoryRequest request = FetchStorageInventoryRequest.newBuilder() .setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setForceRefresh(true) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SourceStorageResource> future = vmMigrationClient.fetchStorageInventoryPagedCallable().futureCall(request); // Do something. for (SourceStorageResource element : future.get().iterateAll()) { // doThingsWith(element); } } -
fetchStorageInventoryCallable
public final UnaryCallable<FetchStorageInventoryRequest,FetchStorageInventoryResponse> fetchStorageInventoryCallable()List remote source's inventory of storage resources. The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { FetchStorageInventoryRequest request = FetchStorageInventoryRequest.newBuilder() .setSource(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setForceRefresh(true) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { FetchStorageInventoryResponse response = vmMigrationClient.fetchStorageInventoryCallable().call(request); for (SourceStorageResource element : response.getResourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listUtilizationReports
public final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(SourceName parent) Lists Utilization Reports of the given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); for (UtilizationReport element : vmMigrationClient.listUtilizationReports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The Utilization Reports parent.- Throws:
ApiException- if the remote call fails
-
listUtilizationReports
public final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(String parent) Lists Utilization Reports of the given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); for (UtilizationReport element : vmMigrationClient.listUtilizationReports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The Utilization Reports parent.- Throws:
ApiException- if the remote call fails
-
listUtilizationReports
public final VmMigrationClient.ListUtilizationReportsPagedResponse listUtilizationReports(ListUtilizationReportsRequest request) Lists Utilization Reports of the given 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()) { 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listUtilizationReportsPagedCallable
public final UnaryCallable<ListUtilizationReportsRequest,VmMigrationClient.ListUtilizationReportsPagedResponse> listUtilizationReportsPagedCallable()Lists Utilization Reports of the given 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()) { 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); } } -
listUtilizationReportsCallable
public final UnaryCallable<ListUtilizationReportsRequest,ListUtilizationReportsResponse> listUtilizationReportsCallable()Lists Utilization Reports of the given 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()) { 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; } } } -
getUtilizationReport
Gets a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The Utilization Report name.- Throws:
ApiException- if the remote call fails
-
getUtilizationReport
Gets a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The Utilization Report name.- Throws:
ApiException- if the remote call fails
-
getUtilizationReport
Gets a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getUtilizationReportCallable
public final UnaryCallable<GetUtilizationReportRequest,UtilizationReport> getUtilizationReportCallable()Gets a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createUtilizationReportAsync
public final OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(SourceName parent, UtilizationReport utilizationReport, String utilizationReportId) Creates a new UtilizationReport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
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.
- Throws:
ApiException- if the remote call fails
-
createUtilizationReportAsync
public final OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(String parent, UtilizationReport utilizationReport, String utilizationReportId) Creates a new UtilizationReport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
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.
- Throws:
ApiException- if the remote call fails
-
createUtilizationReportAsync
public final OperationFuture<UtilizationReport,OperationMetadata> createUtilizationReportAsync(CreateUtilizationReportRequest request) Creates a new UtilizationReport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createUtilizationReportOperationCallable
public final OperationCallable<CreateUtilizationReportRequest,UtilizationReport, createUtilizationReportOperationCallable()OperationMetadata> Creates a new UtilizationReport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createUtilizationReportCallable
public final UnaryCallable<CreateUtilizationReportRequest,Operation> createUtilizationReportCallable()Creates a new UtilizationReport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
deleteUtilizationReportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(UtilizationReportName name) Deletes a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
name- Required. The Utilization Report name.- Throws:
ApiException- if the remote call fails
-
deleteUtilizationReportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(String name) Deletes a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
name- Required. The Utilization Report name.- Throws:
ApiException- if the remote call fails
-
deleteUtilizationReportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteUtilizationReportAsync(DeleteUtilizationReportRequest request) Deletes a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteUtilizationReportOperationCallable
public final OperationCallable<DeleteUtilizationReportRequest,com.google.protobuf.Empty, deleteUtilizationReportOperationCallable()OperationMetadata> Deletes a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
deleteUtilizationReportCallable
public final UnaryCallable<DeleteUtilizationReportRequest,Operation> deleteUtilizationReportCallable()Deletes a single Utilization Report.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
listDatacenterConnectors
public final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(SourceName parent) Lists DatacenterConnectors in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); for (DatacenterConnector element : vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of connectors.- Throws:
ApiException- if the remote call fails
-
listDatacenterConnectors
public final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(String parent) Lists DatacenterConnectors in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); for (DatacenterConnector element : vmMigrationClient.listDatacenterConnectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of connectors.- Throws:
ApiException- if the remote call fails
-
listDatacenterConnectors
public final VmMigrationClient.ListDatacenterConnectorsPagedResponse listDatacenterConnectors(ListDatacenterConnectorsRequest request) Lists DatacenterConnectors in a given 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()) { 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDatacenterConnectorsPagedCallable
public final UnaryCallable<ListDatacenterConnectorsRequest,VmMigrationClient.ListDatacenterConnectorsPagedResponse> listDatacenterConnectorsPagedCallable()Lists DatacenterConnectors in a given 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()) { 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); } } -
listDatacenterConnectorsCallable
public final UnaryCallable<ListDatacenterConnectorsRequest,ListDatacenterConnectorsResponse> listDatacenterConnectorsCallable()Lists DatacenterConnectors in a given 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()) { 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; } } } -
getDatacenterConnector
Gets details of a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the DatacenterConnector.- Throws:
ApiException- if the remote call fails
-
getDatacenterConnector
Gets details of a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the DatacenterConnector.- Throws:
ApiException- if the remote call fails
-
getDatacenterConnector
Gets details of a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDatacenterConnectorCallable
public final UnaryCallable<GetDatacenterConnectorRequest,DatacenterConnector> getDatacenterConnectorCallable()Gets details of a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createDatacenterConnectorAsync
public final OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(SourceName parent, DatacenterConnector datacenterConnector, String datacenterConnectorId) Creates a new DatacenterConnector in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build(); String datacenterConnectorId = "datacenterConnectorId-761889719"; DatacenterConnector response = vmMigrationClient .createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId) .get(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
createDatacenterConnectorAsync
public final OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(String parent, DatacenterConnector datacenterConnector, String datacenterConnectorId) Creates a new DatacenterConnector in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); DatacenterConnector datacenterConnector = DatacenterConnector.newBuilder().build(); String datacenterConnectorId = "datacenterConnectorId-761889719"; DatacenterConnector response = vmMigrationClient .createDatacenterConnectorAsync(parent, datacenterConnector, datacenterConnectorId) .get(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
createDatacenterConnectorAsync
public final OperationFuture<DatacenterConnector,OperationMetadata> createDatacenterConnectorAsync(CreateDatacenterConnectorRequest request) Creates a new DatacenterConnector in a given 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()) { 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDatacenterConnectorOperationCallable
public final OperationCallable<CreateDatacenterConnectorRequest,DatacenterConnector, createDatacenterConnectorOperationCallable()OperationMetadata> Creates a new DatacenterConnector in a given 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()) { 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(); } -
createDatacenterConnectorCallable
public final UnaryCallable<CreateDatacenterConnectorRequest,Operation> createDatacenterConnectorCallable()Creates a new DatacenterConnector in a given 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()) { 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(); } -
deleteDatacenterConnectorAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(DatacenterConnectorName name) Deletes a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
name- Required. The DatacenterConnector name.- Throws:
ApiException- if the remote call fails
-
deleteDatacenterConnectorAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(String name) Deletes a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
name- Required. The DatacenterConnector name.- Throws:
ApiException- if the remote call fails
-
deleteDatacenterConnectorAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatacenterConnectorAsync(DeleteDatacenterConnectorRequest request) Deletes a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDatacenterConnectorOperationCallable
public final OperationCallable<DeleteDatacenterConnectorRequest,com.google.protobuf.Empty, deleteDatacenterConnectorOperationCallable()OperationMetadata> Deletes a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
deleteDatacenterConnectorCallable
public final UnaryCallable<DeleteDatacenterConnectorRequest,Operation> deleteDatacenterConnectorCallable()Deletes a single DatacenterConnector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
upgradeApplianceAsync
public final OperationFuture<UpgradeApplianceResponse,OperationMetadata> upgradeApplianceAsync(UpgradeApplianceRequest request) Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
upgradeApplianceOperationCallable
public final OperationCallable<UpgradeApplianceRequest,UpgradeApplianceResponse, upgradeApplianceOperationCallable()OperationMetadata> Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
upgradeApplianceCallable
Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
createMigratingVmAsync
public final OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(SourceName parent, MigratingVm migratingVm, String migratingVmId) Creates a new MigratingVm in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); MigratingVm migratingVm = MigratingVm.newBuilder().build(); String migratingVmId = "migratingVmId441244154"; MigratingVm response = vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get(); }- Parameters:
parent- Required. The MigratingVm's parent.migratingVm- Required. The create request body.migratingVmId- Required. The migratingVm identifier.- Throws:
ApiException- if the remote call fails
-
createMigratingVmAsync
public final OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(String parent, MigratingVm migratingVm, String migratingVmId) Creates a new MigratingVm in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); MigratingVm migratingVm = MigratingVm.newBuilder().build(); String migratingVmId = "migratingVmId441244154"; MigratingVm response = vmMigrationClient.createMigratingVmAsync(parent, migratingVm, migratingVmId).get(); }- Parameters:
parent- Required. The MigratingVm's parent.migratingVm- Required. The create request body.migratingVmId- Required. The migratingVm identifier.- Throws:
ApiException- if the remote call fails
-
createMigratingVmAsync
public final OperationFuture<MigratingVm,OperationMetadata> createMigratingVmAsync(CreateMigratingVmRequest request) Creates a new MigratingVm in a given 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()) { 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createMigratingVmOperationCallable
public final OperationCallable<CreateMigratingVmRequest,MigratingVm, createMigratingVmOperationCallable()OperationMetadata> Creates a new MigratingVm in a given 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()) { 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(); } -
createMigratingVmCallable
Creates a new MigratingVm in a given 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()) { 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(); } -
listMigratingVms
Lists MigratingVms in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of MigratingVms.- Throws:
ApiException- if the remote call fails
-
listMigratingVms
Lists MigratingVms in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); for (MigratingVm element : vmMigrationClient.listMigratingVms(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of MigratingVms.- Throws:
ApiException- if the remote call fails
-
listMigratingVms
public final VmMigrationClient.ListMigratingVmsPagedResponse listMigratingVms(ListMigratingVmsRequest request) Lists MigratingVms in a given 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()) { 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listMigratingVmsPagedCallable
public final UnaryCallable<ListMigratingVmsRequest,VmMigrationClient.ListMigratingVmsPagedResponse> listMigratingVmsPagedCallable()Lists MigratingVms in a given 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()) { 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); } } -
listMigratingVmsCallable
public final UnaryCallable<ListMigratingVmsRequest,ListMigratingVmsResponse> listMigratingVmsCallable()Lists MigratingVms in a given 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()) { 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; } } } -
getMigratingVm
Gets details of a single 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 name = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); MigratingVm response = vmMigrationClient.getMigratingVm(name); }- Parameters:
name- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
getMigratingVm
Gets details of a single 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 name = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); MigratingVm response = vmMigrationClient.getMigratingVm(name); }- Parameters:
name- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
getMigratingVm
Gets details of a single 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()) { GetMigratingVmRequest request = GetMigratingVmRequest.newBuilder() .setName( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .setView(MigratingVmView.forNumber(0)) .build(); MigratingVm response = vmMigrationClient.getMigratingVm(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getMigratingVmCallable
Gets details of a single 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()) { 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(); } -
updateMigratingVmAsync
public final OperationFuture<MigratingVm,OperationMetadata> updateMigratingVmAsync(MigratingVm migratingVm, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single 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()) { MigratingVm migratingVm = MigratingVm.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); MigratingVm response = vmMigrationClient.updateMigratingVmAsync(migratingVm, updateMask).get(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
updateMigratingVmAsync
public final OperationFuture<MigratingVm,OperationMetadata> updateMigratingVmAsync(UpdateMigratingVmRequest request) Updates the parameters of a single 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()) { UpdateMigratingVmRequest request = UpdateMigratingVmRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setMigratingVm(MigratingVm.newBuilder().build()) .setRequestId("requestId693933066") .build(); MigratingVm response = vmMigrationClient.updateMigratingVmAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateMigratingVmOperationCallable
public final OperationCallable<UpdateMigratingVmRequest,MigratingVm, updateMigratingVmOperationCallable()OperationMetadata> Updates the parameters of a single 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()) { 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(); } -
updateMigratingVmCallable
Updates the parameters of a single 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()) { 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(); } -
deleteMigratingVmAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(MigratingVmName name) Deletes a single 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 name = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); vmMigrationClient.deleteMigratingVmAsync(name).get(); }- Parameters:
name- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
deleteMigratingVmAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(String name) Deletes a single 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 name = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); vmMigrationClient.deleteMigratingVmAsync(name).get(); }- Parameters:
name- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
deleteMigratingVmAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMigratingVmAsync(DeleteMigratingVmRequest request) Deletes a single 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()) { DeleteMigratingVmRequest request = DeleteMigratingVmRequest.newBuilder() .setName( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .build(); vmMigrationClient.deleteMigratingVmAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteMigratingVmOperationCallable
public final OperationCallable<DeleteMigratingVmRequest,com.google.protobuf.Empty, deleteMigratingVmOperationCallable()OperationMetadata> Deletes a single 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()) { 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(); } -
deleteMigratingVmCallable
Deletes a single 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()) { 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(); } -
startMigrationAsync
public final OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(MigratingVmName migratingVm) Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
migratingVm- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
startMigrationAsync
public final OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(String migratingVm) Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
migratingVm- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
startMigrationAsync
public final OperationFuture<StartMigrationResponse,OperationMetadata> startMigrationAsync(StartMigrationRequest request) Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startMigrationOperationCallable
public final OperationCallable<StartMigrationRequest,StartMigrationResponse, startMigrationOperationCallable()OperationMetadata> Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
startMigrationCallable
Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
resumeMigrationAsync
public final OperationFuture<ResumeMigrationResponse,OperationMetadata> resumeMigrationAsync(ResumeMigrationRequest request) Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resumeMigrationOperationCallable
public final OperationCallable<ResumeMigrationRequest,ResumeMigrationResponse, resumeMigrationOperationCallable()OperationMetadata> Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
resumeMigrationCallable
Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
pauseMigrationAsync
public final OperationFuture<PauseMigrationResponse,OperationMetadata> pauseMigrationAsync(PauseMigrationRequest request) Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
pauseMigrationOperationCallable
public final OperationCallable<PauseMigrationRequest,PauseMigrationResponse, pauseMigrationOperationCallable()OperationMetadata> Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
pauseMigrationCallable
Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
finalizeMigrationAsync
public final OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(MigratingVmName migratingVm) Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
migratingVm- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
finalizeMigrationAsync
public final OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(String migratingVm) Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
migratingVm- Required. The name of the MigratingVm.- Throws:
ApiException- if the remote call fails
-
finalizeMigrationAsync
public final OperationFuture<FinalizeMigrationResponse,OperationMetadata> finalizeMigrationAsync(FinalizeMigrationRequest request) Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
finalizeMigrationOperationCallable
public final OperationCallable<FinalizeMigrationRequest,FinalizeMigrationResponse, finalizeMigrationOperationCallable()OperationMetadata> Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
finalizeMigrationCallable
Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
extendMigrationAsync
public final OperationFuture<ExtendMigrationResponse,OperationMetadata> extendMigrationAsync(ExtendMigrationRequest request) Extend the migrating VM time to live.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ExtendMigrationRequest request = ExtendMigrationRequest.newBuilder() .setMigratingVm( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .build(); ExtendMigrationResponse response = vmMigrationClient.extendMigrationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
extendMigrationOperationCallable
public final OperationCallable<ExtendMigrationRequest,ExtendMigrationResponse, extendMigrationOperationCallable()OperationMetadata> Extend the migrating VM time to live.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ExtendMigrationRequest request = ExtendMigrationRequest.newBuilder() .setMigratingVm( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .build(); OperationFuture<ExtendMigrationResponse, OperationMetadata> future = vmMigrationClient.extendMigrationOperationCallable().futureCall(request); // Do something. ExtendMigrationResponse response = future.get(); } -
extendMigrationCallable
Extend the migrating VM time to live.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ExtendMigrationRequest request = ExtendMigrationRequest.newBuilder() .setMigratingVm( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .build(); ApiFuture<Operation> future = vmMigrationClient.extendMigrationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createCloneJobAsync
public final OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(MigratingVmName parent, CloneJob cloneJob, String cloneJobId) Initiates a Clone of a specific migrating VM.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
parent- Required. The Clone's parent.cloneJob- Required. The clone request body.cloneJobId- Required. The clone job identifier.- Throws:
ApiException- if the remote call fails
-
createCloneJobAsync
public final OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(String parent, CloneJob cloneJob, String cloneJobId) Initiates a Clone of a specific migrating VM.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
parent- Required. The Clone's parent.cloneJob- Required. The clone request body.cloneJobId- Required. The clone job identifier.- Throws:
ApiException- if the remote call fails
-
createCloneJobAsync
public final OperationFuture<CloneJob,OperationMetadata> createCloneJobAsync(CreateCloneJobRequest request) Initiates a Clone of a specific migrating VM.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCloneJobOperationCallable
public final OperationCallable<CreateCloneJobRequest,CloneJob, createCloneJobOperationCallable()OperationMetadata> Initiates a Clone of a specific migrating VM.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createCloneJobCallable
Initiates a Clone of a specific migrating VM.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
cancelCloneJobAsync
public final OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(CloneJobName name) Initiates the cancellation of a running clone job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { CloneJobName name = CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]"); CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get(); }- Parameters:
name- Required. The clone job id- Throws:
ApiException- if the remote call fails
-
cancelCloneJobAsync
public final OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(String name) Initiates the cancellation of a running clone job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { String name = CloneJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CLONE_JOB]") .toString(); CancelCloneJobResponse response = vmMigrationClient.cancelCloneJobAsync(name).get(); }- Parameters:
name- Required. The clone job id- Throws:
ApiException- if the remote call fails
-
cancelCloneJobAsync
public final OperationFuture<CancelCloneJobResponse,OperationMetadata> cancelCloneJobAsync(CancelCloneJobRequest request) Initiates the cancellation of a running clone job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
cancelCloneJobOperationCallable
public final OperationCallable<CancelCloneJobRequest,CancelCloneJobResponse, cancelCloneJobOperationCallable()OperationMetadata> Initiates the cancellation of a running clone job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
cancelCloneJobCallable
Initiates the cancellation of a running clone job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
listCloneJobs
Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
parent- Required. The parent, which owns this collection of source VMs.- Throws:
ApiException- if the remote call fails
-
listCloneJobs
Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
parent- Required. The parent, which owns this collection of source VMs.- Throws:
ApiException- if the remote call fails
-
listCloneJobs
public final VmMigrationClient.ListCloneJobsPagedResponse listCloneJobs(ListCloneJobsRequest request) Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCloneJobsPagedCallable
public final UnaryCallable<ListCloneJobsRequest,VmMigrationClient.ListCloneJobsPagedResponse> listCloneJobsPagedCallable()Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } } -
listCloneJobsCallable
Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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; } } } -
getCloneJob
Gets details of a single CloneJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the CloneJob.- Throws:
ApiException- if the remote call fails
-
getCloneJob
Gets details of a single CloneJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the CloneJob.- Throws:
ApiException- if the remote call fails
-
getCloneJob
Gets details of a single CloneJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCloneJobCallable
Gets details of a single CloneJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createCutoverJobAsync
public final OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(MigratingVmName parent, CutoverJob cutoverJob, String cutoverJobId) Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
parent- Required. The Cutover's parent.cutoverJob- Required. The cutover request body.cutoverJobId- Required. The cutover job identifier.- Throws:
ApiException- if the remote call fails
-
createCutoverJobAsync
public final OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(String parent, CutoverJob cutoverJob, String cutoverJobId) Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
parent- Required. The Cutover's parent.cutoverJob- Required. The cutover request body.cutoverJobId- Required. The cutover job identifier.- Throws:
ApiException- if the remote call fails
-
createCutoverJobAsync
public final OperationFuture<CutoverJob,OperationMetadata> createCutoverJobAsync(CreateCutoverJobRequest request) Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCutoverJobOperationCallable
public final OperationCallable<CreateCutoverJobRequest,CutoverJob, createCutoverJobOperationCallable()OperationMetadata> Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
createCutoverJobCallable
Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
cancelCutoverJobAsync
public final OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(CutoverJobName name) Initiates the cancellation of a running cutover job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { CutoverJobName name = CutoverJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]"); CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get(); }- Parameters:
name- Required. The cutover job id- Throws:
ApiException- if the remote call fails
-
cancelCutoverJobAsync
public final OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(String name) Initiates the cancellation of a running cutover job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { String name = CutoverJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[CUTOVER_JOB]") .toString(); CancelCutoverJobResponse response = vmMigrationClient.cancelCutoverJobAsync(name).get(); }- Parameters:
name- Required. The cutover job id- Throws:
ApiException- if the remote call fails
-
cancelCutoverJobAsync
public final OperationFuture<CancelCutoverJobResponse,OperationMetadata> cancelCutoverJobAsync(CancelCutoverJobRequest request) Initiates the cancellation of a running cutover job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
cancelCutoverJobOperationCallable
public final OperationCallable<CancelCutoverJobRequest,CancelCutoverJobResponse, cancelCutoverJobOperationCallable()OperationMetadata> Initiates the cancellation of a running cutover job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
cancelCutoverJobCallable
Initiates the cancellation of a running cutover job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
listCutoverJobs
Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
parent- Required. The parent, which owns this collection of migrating VMs.- Throws:
ApiException- if the remote call fails
-
listCutoverJobs
Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
parent- Required. The parent, which owns this collection of migrating VMs.- Throws:
ApiException- if the remote call fails
-
listCutoverJobs
public final VmMigrationClient.ListCutoverJobsPagedResponse listCutoverJobs(ListCutoverJobsRequest request) Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listCutoverJobsPagedCallable
public final UnaryCallable<ListCutoverJobsRequest,VmMigrationClient.ListCutoverJobsPagedResponse> listCutoverJobsPagedCallable()Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); } } -
listCutoverJobsCallable
public final UnaryCallable<ListCutoverJobsRequest,ListCutoverJobsResponse> listCutoverJobsCallable()Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs are listed.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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; } } } -
getCutoverJob
Gets details of a single CutoverJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the CutoverJob.- Throws:
ApiException- if the remote call fails
-
getCutoverJob
Gets details of a single CutoverJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
name- Required. The name of the CutoverJob.- Throws:
ApiException- if the remote call fails
-
getCutoverJob
Gets details of a single CutoverJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCutoverJobCallable
Gets details of a single CutoverJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); } -
listGroups
Lists Groups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of groups.- Throws:
ApiException- if the remote call fails
-
listGroups
Lists Groups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Group element : vmMigrationClient.listGroups(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of groups.- Throws:
ApiException- if the remote call fails
-
listGroups
Lists Groups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listGroupsPagedCallable
public final UnaryCallable<ListGroupsRequest,VmMigrationClient.ListGroupsPagedResponse> listGroupsPagedCallable()Lists Groups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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); } } -
listGroupsCallable
Lists Groups in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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; } } } -
getGroup
Gets details of a single 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 name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); Group response = vmMigrationClient.getGroup(name); }- Parameters:
name- Required. The group name.- Throws:
ApiException- if the remote call fails
-
getGroup
Gets details of a single 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 name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); Group response = vmMigrationClient.getGroup(name); }- Parameters:
name- Required. The group name.- Throws:
ApiException- if the remote call fails
-
getGroup
Gets details of a single 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()) { GetGroupRequest request = GetGroupRequest.newBuilder() .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) .build(); Group response = vmMigrationClient.getGroup(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getGroupCallable
Gets details of a single 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()) { 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(); } -
createGroupAsync
public final OperationFuture<Group,OperationMetadata> createGroupAsync(LocationName parent, Group group, String groupId) Creates a new Group in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
parent- Required. The Group's parent.group- Required. The create request body.groupId- Required. The group identifier.- Throws:
ApiException- if the remote call fails
-
createGroupAsync
public final OperationFuture<Group,OperationMetadata> createGroupAsync(String parent, Group group, String groupId) Creates a new Group in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
parent- Required. The Group's parent.group- Required. The create request body.groupId- Required. The group identifier.- Throws:
ApiException- if the remote call fails
-
createGroupAsync
Creates a new Group in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createGroupOperationCallable
public final OperationCallable<CreateGroupRequest,Group, createGroupOperationCallable()OperationMetadata> Creates a new Group in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
createGroupCallable
Creates a new Group in a given project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (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(); } -
updateGroupAsync
public final OperationFuture<Group,OperationMetadata> updateGroupAsync(Group group, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single 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()) { Group group = Group.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Group response = vmMigrationClient.updateGroupAsync(group, updateMask).get(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
updateGroupAsync
Updates the parameters of a single 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()) { UpdateGroupRequest request = UpdateGroupRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setGroup(Group.newBuilder().build()) .setRequestId("requestId693933066") .build(); Group response = vmMigrationClient.updateGroupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateGroupOperationCallable
public final OperationCallable<UpdateGroupRequest,Group, updateGroupOperationCallable()OperationMetadata> Updates the parameters of a single 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()) { 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(); } -
updateGroupCallable
Updates the parameters of a single 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()) { 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(); } -
deleteGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(GroupName name) Deletes a single 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 name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]"); vmMigrationClient.deleteGroupAsync(name).get(); }- Parameters:
name- Required. The Group name.- Throws:
ApiException- if the remote call fails
-
deleteGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(String name) Deletes a single 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 name = GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString(); vmMigrationClient.deleteGroupAsync(name).get(); }- Parameters:
name- Required. The Group name.- Throws:
ApiException- if the remote call fails
-
deleteGroupAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteGroupAsync(DeleteGroupRequest request) Deletes a single 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()) { DeleteGroupRequest request = DeleteGroupRequest.newBuilder() .setName(GroupName.of("[PROJECT]", "[LOCATION]", "[GROUP]").toString()) .setRequestId("requestId693933066") .build(); vmMigrationClient.deleteGroupAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteGroupOperationCallable
public final OperationCallable<DeleteGroupRequest,com.google.protobuf.Empty, deleteGroupOperationCallable()OperationMetadata> Deletes a single 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()) { 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(); } -
deleteGroupCallable
Deletes a single 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()) { 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(); } -
addGroupMigrationAsync
public final OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(GroupName group) Adds a MigratingVm to a 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(); }- Parameters:
group- Required. The full path name of the Group to add to.- Throws:
ApiException- if the remote call fails
-
addGroupMigrationAsync
public final OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(String group) Adds a MigratingVm to a 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(); }- Parameters:
group- Required. The full path name of the Group to add to.- Throws:
ApiException- if the remote call fails
-
addGroupMigrationAsync
public final OperationFuture<AddGroupMigrationResponse,OperationMetadata> addGroupMigrationAsync(AddGroupMigrationRequest request) Adds a MigratingVm to a 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()) { 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
addGroupMigrationOperationCallable
public final OperationCallable<AddGroupMigrationRequest,AddGroupMigrationResponse, addGroupMigrationOperationCallable()OperationMetadata> Adds a MigratingVm to a 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()) { 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(); } -
addGroupMigrationCallable
Adds a MigratingVm to a 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()) { 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(); } -
removeGroupMigrationAsync
public final OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(GroupName group) Removes a MigratingVm from a 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(); }- Parameters:
group- Required. The name of the Group.- Throws:
ApiException- if the remote call fails
-
removeGroupMigrationAsync
public final OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(String group) Removes a MigratingVm from a 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(); }- Parameters:
group- Required. The name of the Group.- Throws:
ApiException- if the remote call fails
-
removeGroupMigrationAsync
public final OperationFuture<RemoveGroupMigrationResponse,OperationMetadata> removeGroupMigrationAsync(RemoveGroupMigrationRequest request) Removes a MigratingVm from a 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()) { 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeGroupMigrationOperationCallable
public final OperationCallable<RemoveGroupMigrationRequest,RemoveGroupMigrationResponse, removeGroupMigrationOperationCallable()OperationMetadata> Removes a MigratingVm from a 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()) { 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(); } -
removeGroupMigrationCallable
Removes a MigratingVm from a 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()) { 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(); } -
listTargetProjects
public final VmMigrationClient.ListTargetProjectsPagedResponse listTargetProjects(LocationName parent) Lists TargetProjects in a given project.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); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listTargetProjects
Lists TargetProjects in a given project.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); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listTargetProjects
public final VmMigrationClient.ListTargetProjectsPagedResponse listTargetProjects(ListTargetProjectsRequest request) Lists TargetProjects in a given project.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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listTargetProjectsPagedCallable
public final UnaryCallable<ListTargetProjectsRequest,VmMigrationClient.ListTargetProjectsPagedResponse> listTargetProjectsPagedCallable()Lists TargetProjects in a given project.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); } } -
listTargetProjectsCallable
public final UnaryCallable<ListTargetProjectsRequest,ListTargetProjectsResponse> listTargetProjectsCallable()Lists TargetProjects in a given project.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; } } } -
getTargetProject
Gets details of a single TargetProject.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); }- Parameters:
name- Required. The TargetProject name.- Throws:
ApiException- if the remote call fails
-
getTargetProject
Gets details of a single TargetProject.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); }- Parameters:
name- Required. The TargetProject name.- Throws:
ApiException- if the remote call fails
-
getTargetProject
Gets details of a single TargetProject.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getTargetProjectCallable
Gets details of a single TargetProject.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(); } -
createTargetProjectAsync
public final OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(LocationName parent, TargetProject targetProject, String targetProjectId) Creates a new TargetProject in a given project.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(); }- Parameters:
parent- Required. The TargetProject's parent.targetProject- Required. The create request body.targetProjectId- Required. The target_project identifier.- Throws:
ApiException- if the remote call fails
-
createTargetProjectAsync
public final OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(String parent, TargetProject targetProject, String targetProjectId) Creates a new TargetProject in a given project.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(); }- Parameters:
parent- Required. The TargetProject's parent.targetProject- Required. The create request body.targetProjectId- Required. The target_project identifier.- Throws:
ApiException- if the remote call fails
-
createTargetProjectAsync
public final OperationFuture<TargetProject,OperationMetadata> createTargetProjectAsync(CreateTargetProjectRequest request) Creates a new TargetProject in a given project.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createTargetProjectOperationCallable
public final OperationCallable<CreateTargetProjectRequest,TargetProject, createTargetProjectOperationCallable()OperationMetadata> Creates a new TargetProject in a given project.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(); } -
createTargetProjectCallable
Creates a new TargetProject in a given project.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(); } -
updateTargetProjectAsync
public final OperationFuture<TargetProject,OperationMetadata> updateTargetProjectAsync(TargetProject targetProject, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single TargetProject.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(); }- Parameters:
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.- Throws:
ApiException- if the remote call fails
-
updateTargetProjectAsync
public final OperationFuture<TargetProject,OperationMetadata> updateTargetProjectAsync(UpdateTargetProjectRequest request) Updates the parameters of a single TargetProject.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateTargetProjectOperationCallable
public final OperationCallable<UpdateTargetProjectRequest,TargetProject, updateTargetProjectOperationCallable()OperationMetadata> Updates the parameters of a single TargetProject.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(); } -
updateTargetProjectCallable
Updates the parameters of a single TargetProject.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(); } -
deleteTargetProjectAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(TargetProjectName name) Deletes a single TargetProject.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(); }- Parameters:
name- Required. The TargetProject name.- Throws:
ApiException- if the remote call fails
-
deleteTargetProjectAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(String name) Deletes a single TargetProject.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(); }- Parameters:
name- Required. The TargetProject name.- Throws:
ApiException- if the remote call fails
-
deleteTargetProjectAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTargetProjectAsync(DeleteTargetProjectRequest request) Deletes a single TargetProject.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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteTargetProjectOperationCallable
public final OperationCallable<DeleteTargetProjectRequest,com.google.protobuf.Empty, deleteTargetProjectOperationCallable()OperationMetadata> Deletes a single TargetProject.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(); } -
deleteTargetProjectCallable
Deletes a single TargetProject.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(); } -
listReplicationCycles
public final VmMigrationClient.ListReplicationCyclesPagedResponse listReplicationCycles(MigratingVmName parent) Lists ReplicationCycles in a given 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 parent = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]"); for (ReplicationCycle element : vmMigrationClient.listReplicationCycles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of ReplicationCycles.- Throws:
ApiException- if the remote call fails
-
listReplicationCycles
public final VmMigrationClient.ListReplicationCyclesPagedResponse listReplicationCycles(String parent) Lists ReplicationCycles in a given 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 parent = MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]").toString(); for (ReplicationCycle element : vmMigrationClient.listReplicationCycles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of ReplicationCycles.- Throws:
ApiException- if the remote call fails
-
listReplicationCycles
public final VmMigrationClient.ListReplicationCyclesPagedResponse listReplicationCycles(ListReplicationCyclesRequest request) Lists ReplicationCycles in a given 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()) { ListReplicationCyclesRequest request = ListReplicationCyclesRequest.newBuilder() .setParent( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ReplicationCycle element : vmMigrationClient.listReplicationCycles(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listReplicationCyclesPagedCallable
public final UnaryCallable<ListReplicationCyclesRequest,VmMigrationClient.ListReplicationCyclesPagedResponse> listReplicationCyclesPagedCallable()Lists ReplicationCycles in a given 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()) { ListReplicationCyclesRequest request = ListReplicationCyclesRequest.newBuilder() .setParent( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ReplicationCycle> future = vmMigrationClient.listReplicationCyclesPagedCallable().futureCall(request); // Do something. for (ReplicationCycle element : future.get().iterateAll()) { // doThingsWith(element); } } -
listReplicationCyclesCallable
public final UnaryCallable<ListReplicationCyclesRequest,ListReplicationCyclesResponse> listReplicationCyclesCallable()Lists ReplicationCycles in a given 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()) { ListReplicationCyclesRequest request = ListReplicationCyclesRequest.newBuilder() .setParent( MigratingVmName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListReplicationCyclesResponse response = vmMigrationClient.listReplicationCyclesCallable().call(request); for (ReplicationCycle element : response.getReplicationCyclesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getReplicationCycle
Gets details of a single ReplicationCycle.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ReplicationCycleName name = ReplicationCycleName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]"); ReplicationCycle response = vmMigrationClient.getReplicationCycle(name); }- Parameters:
name- Required. The name of the ReplicationCycle.- Throws:
ApiException- if the remote call fails
-
getReplicationCycle
Gets details of a single ReplicationCycle.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ReplicationCycleName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]") .toString(); ReplicationCycle response = vmMigrationClient.getReplicationCycle(name); }- Parameters:
name- Required. The name of the ReplicationCycle.- Throws:
ApiException- if the remote call fails
-
getReplicationCycle
Gets details of a single ReplicationCycle.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetReplicationCycleRequest request = GetReplicationCycleRequest.newBuilder() .setName( ReplicationCycleName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]") .toString()) .build(); ReplicationCycle response = vmMigrationClient.getReplicationCycle(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getReplicationCycleCallable
public final UnaryCallable<GetReplicationCycleRequest,ReplicationCycle> getReplicationCycleCallable()Gets details of a single ReplicationCycle.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetReplicationCycleRequest request = GetReplicationCycleRequest.newBuilder() .setName( ReplicationCycleName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[MIGRATING_VM]", "[REPLICATION_CYCLE]") .toString()) .build(); ApiFuture<ReplicationCycle> future = vmMigrationClient.getReplicationCycleCallable().futureCall(request); // Do something. ReplicationCycle response = future.get(); } -
listImageImports
Lists ImageImports in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 (ImageImport element : vmMigrationClient.listImageImports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listImageImports
Lists ImageImports in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 (ImageImport element : vmMigrationClient.listImageImports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listImageImports
public final VmMigrationClient.ListImageImportsPagedResponse listImageImports(ListImageImportsRequest request) Lists ImageImports in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportsRequest request = ListImageImportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ImageImport element : vmMigrationClient.listImageImports(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listImageImportsPagedCallable
public final UnaryCallable<ListImageImportsRequest,VmMigrationClient.ListImageImportsPagedResponse> listImageImportsPagedCallable()Lists ImageImports in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportsRequest request = ListImageImportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ImageImport> future = vmMigrationClient.listImageImportsPagedCallable().futureCall(request); // Do something. for (ImageImport element : future.get().iterateAll()) { // doThingsWith(element); } } -
listImageImportsCallable
public final UnaryCallable<ListImageImportsRequest,ListImageImportsResponse> listImageImportsCallable()Lists ImageImports in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportsRequest request = ListImageImportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListImageImportsResponse response = vmMigrationClient.listImageImportsCallable().call(request); for (ImageImport element : response.getImageImportsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getImageImport
Gets details of a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ImageImportName name = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]"); ImageImport response = vmMigrationClient.getImageImport(name); }- Parameters:
name- Required. The ImageImport name.- Throws:
ApiException- if the remote call fails
-
getImageImport
Gets details of a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString(); ImageImport response = vmMigrationClient.getImageImport(name); }- Parameters:
name- Required. The ImageImport name.- Throws:
ApiException- if the remote call fails
-
getImageImport
Gets details of a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetImageImportRequest request = GetImageImportRequest.newBuilder() .setName(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .build(); ImageImport response = vmMigrationClient.getImageImport(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getImageImportCallable
Gets details of a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetImageImportRequest request = GetImageImportRequest.newBuilder() .setName(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .build(); ApiFuture<ImageImport> future = vmMigrationClient.getImageImportCallable().futureCall(request); // Do something. ImageImport response = future.get(); } -
createImageImportAsync
public final OperationFuture<ImageImport,OperationMetadata> createImageImportAsync(LocationName parent, ImageImport imageImport, String imageImportId) Creates a new ImageImport in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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]"); ImageImport imageImport = ImageImport.newBuilder().build(); String imageImportId = "imageImportId943893019"; ImageImport response = vmMigrationClient.createImageImportAsync(parent, imageImport, imageImportId).get(); }- Parameters:
parent- Required. The ImageImport's parent.imageImport- Required. The create request body.imageImportId- Required. The image import identifier. 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.- Throws:
ApiException- if the remote call fails
-
createImageImportAsync
public final OperationFuture<ImageImport,OperationMetadata> createImageImportAsync(String parent, ImageImport imageImport, String imageImportId) Creates a new ImageImport in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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(); ImageImport imageImport = ImageImport.newBuilder().build(); String imageImportId = "imageImportId943893019"; ImageImport response = vmMigrationClient.createImageImportAsync(parent, imageImport, imageImportId).get(); }- Parameters:
parent- Required. The ImageImport's parent.imageImport- Required. The create request body.imageImportId- Required. The image import identifier. 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.- Throws:
ApiException- if the remote call fails
-
createImageImportAsync
public final OperationFuture<ImageImport,OperationMetadata> createImageImportAsync(CreateImageImportRequest request) Creates a new ImageImport in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CreateImageImportRequest request = CreateImageImportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setImageImportId("imageImportId943893019") .setImageImport(ImageImport.newBuilder().build()) .setRequestId("requestId693933066") .build(); ImageImport response = vmMigrationClient.createImageImportAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createImageImportOperationCallable
public final OperationCallable<CreateImageImportRequest,ImageImport, createImageImportOperationCallable()OperationMetadata> Creates a new ImageImport in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CreateImageImportRequest request = CreateImageImportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setImageImportId("imageImportId943893019") .setImageImport(ImageImport.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ImageImport, OperationMetadata> future = vmMigrationClient.createImageImportOperationCallable().futureCall(request); // Do something. ImageImport response = future.get(); } -
createImageImportCallable
Creates a new ImageImport in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CreateImageImportRequest request = CreateImageImportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setImageImportId("imageImportId943893019") .setImageImport(ImageImport.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vmMigrationClient.createImageImportCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteImageImportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteImageImportAsync(ImageImportName name) Deletes a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ImageImportName name = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]"); vmMigrationClient.deleteImageImportAsync(name).get(); }- Parameters:
name- Required. The ImageImport name.- Throws:
ApiException- if the remote call fails
-
deleteImageImportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteImageImportAsync(String name) Deletes a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString(); vmMigrationClient.deleteImageImportAsync(name).get(); }- Parameters:
name- Required. The ImageImport name.- Throws:
ApiException- if the remote call fails
-
deleteImageImportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteImageImportAsync(DeleteImageImportRequest request) Deletes a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteImageImportRequest request = DeleteImageImportRequest.newBuilder() .setName(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setRequestId("requestId693933066") .build(); vmMigrationClient.deleteImageImportAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteImageImportOperationCallable
public final OperationCallable<DeleteImageImportRequest,com.google.protobuf.Empty, deleteImageImportOperationCallable()OperationMetadata> Deletes a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteImageImportRequest request = DeleteImageImportRequest.newBuilder() .setName(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = vmMigrationClient.deleteImageImportOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteImageImportCallable
Deletes a single ImageImport.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteImageImportRequest request = DeleteImageImportRequest.newBuilder() .setName(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vmMigrationClient.deleteImageImportCallable().futureCall(request); // Do something. future.get(); } -
listImageImportJobs
public final VmMigrationClient.ListImageImportJobsPagedResponse listImageImportJobs(ImageImportName parent) Lists ImageImportJobs in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ImageImportName parent = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]"); for (ImageImportJob element : vmMigrationClient.listImageImportJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listImageImportJobs
Lists ImageImportJobs in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString(); for (ImageImportJob element : vmMigrationClient.listImageImportJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of targets.- Throws:
ApiException- if the remote call fails
-
listImageImportJobs
public final VmMigrationClient.ListImageImportJobsPagedResponse listImageImportJobs(ListImageImportJobsRequest request) Lists ImageImportJobs in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportJobsRequest request = ListImageImportJobsRequest.newBuilder() .setParent(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ImageImportJob element : vmMigrationClient.listImageImportJobs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listImageImportJobsPagedCallable
public final UnaryCallable<ListImageImportJobsRequest,VmMigrationClient.ListImageImportJobsPagedResponse> listImageImportJobsPagedCallable()Lists ImageImportJobs in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportJobsRequest request = ListImageImportJobsRequest.newBuilder() .setParent(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ImageImportJob> future = vmMigrationClient.listImageImportJobsPagedCallable().futureCall(request); // Do something. for (ImageImportJob element : future.get().iterateAll()) { // doThingsWith(element); } } -
listImageImportJobsCallable
public final UnaryCallable<ListImageImportJobsRequest,ListImageImportJobsResponse> listImageImportJobsCallable()Lists ImageImportJobs in a given project.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListImageImportJobsRequest request = ListImageImportJobsRequest.newBuilder() .setParent(ImageImportName.of("[PROJECT]", "[LOCATION]", "[JOB]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListImageImportJobsResponse response = vmMigrationClient.listImageImportJobsCallable().call(request); for (ImageImportJob element : response.getImageImportJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getImageImportJob
Gets details of a single ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ImageImportJobName name = ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]"); ImageImportJob response = vmMigrationClient.getImageImportJob(name); }- Parameters:
name- Required. The ImageImportJob name.- Throws:
ApiException- if the remote call fails
-
getImageImportJob
Gets details of a single ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString(); ImageImportJob response = vmMigrationClient.getImageImportJob(name); }- Parameters:
name- Required. The ImageImportJob name.- Throws:
ApiException- if the remote call fails
-
getImageImportJob
Gets details of a single ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetImageImportJobRequest request = GetImageImportJobRequest.newBuilder() .setName( ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString()) .build(); ImageImportJob response = vmMigrationClient.getImageImportJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getImageImportJobCallable
Gets details of a single ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetImageImportJobRequest request = GetImageImportJobRequest.newBuilder() .setName( ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString()) .build(); ApiFuture<ImageImportJob> future = vmMigrationClient.getImageImportJobCallable().futureCall(request); // Do something. ImageImportJob response = future.get(); } -
cancelImageImportJobAsync
public final OperationFuture<CancelImageImportJobResponse,OperationMetadata> cancelImageImportJobAsync(ImageImportJobName name) Initiates the cancellation of a running ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ImageImportJobName name = ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]"); CancelImageImportJobResponse response = vmMigrationClient.cancelImageImportJobAsync(name).get(); }- Parameters:
name- Required. The image import job id.- Throws:
ApiException- if the remote call fails
-
cancelImageImportJobAsync
public final OperationFuture<CancelImageImportJobResponse,OperationMetadata> cancelImageImportJobAsync(String name) Initiates the cancellation of a running ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString(); CancelImageImportJobResponse response = vmMigrationClient.cancelImageImportJobAsync(name).get(); }- Parameters:
name- Required. The image import job id.- Throws:
ApiException- if the remote call fails
-
cancelImageImportJobAsync
public final OperationFuture<CancelImageImportJobResponse,OperationMetadata> cancelImageImportJobAsync(CancelImageImportJobRequest request) Initiates the cancellation of a running ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CancelImageImportJobRequest request = CancelImageImportJobRequest.newBuilder() .setName( ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString()) .build(); CancelImageImportJobResponse response = vmMigrationClient.cancelImageImportJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
cancelImageImportJobOperationCallable
public final OperationCallable<CancelImageImportJobRequest,CancelImageImportJobResponse, cancelImageImportJobOperationCallable()OperationMetadata> Initiates the cancellation of a running ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CancelImageImportJobRequest request = CancelImageImportJobRequest.newBuilder() .setName( ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString()) .build(); OperationFuture<CancelImageImportJobResponse, OperationMetadata> future = vmMigrationClient.cancelImageImportJobOperationCallable().futureCall(request); // Do something. CancelImageImportJobResponse response = future.get(); } -
cancelImageImportJobCallable
Initiates the cancellation of a running ImageImportJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { CancelImageImportJobRequest request = CancelImageImportJobRequest.newBuilder() .setName( ImageImportJobName.of("[PROJECT]", "[LOCATION]", "[JOB]", "[RESULT]").toString()) .build(); ApiFuture<Operation> future = vmMigrationClient.cancelImageImportJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createDiskMigrationJobAsync
public final OperationFuture<DiskMigrationJob,OperationMetadata> createDiskMigrationJobAsync(SourceName parent, DiskMigrationJob diskMigrationJob, String diskMigrationJobId) Creates a new disk migration job in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); DiskMigrationJob diskMigrationJob = DiskMigrationJob.newBuilder().build(); String diskMigrationJobId = "diskMigrationJobId-173409913"; DiskMigrationJob response = vmMigrationClient .createDiskMigrationJobAsync(parent, diskMigrationJob, diskMigrationJobId) .get(); }- Parameters:
parent- Required. The DiskMigrationJob's parent.diskMigrationJob- Required. The create request body.diskMigrationJobId- Required. The DiskMigrationJob identifier. The maximum length of this value is 63 characters. Valid characters are lower case Latin letters, digits and hyphen. It must start with a Latin letter and must not end with a hyphen.- Throws:
ApiException- if the remote call fails
-
createDiskMigrationJobAsync
public final OperationFuture<DiskMigrationJob,OperationMetadata> createDiskMigrationJobAsync(String parent, DiskMigrationJob diskMigrationJob, String diskMigrationJobId) Creates a new disk migration job in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); DiskMigrationJob diskMigrationJob = DiskMigrationJob.newBuilder().build(); String diskMigrationJobId = "diskMigrationJobId-173409913"; DiskMigrationJob response = vmMigrationClient .createDiskMigrationJobAsync(parent, diskMigrationJob, diskMigrationJobId) .get(); }- Parameters:
parent- Required. The DiskMigrationJob's parent.diskMigrationJob- Required. The create request body.diskMigrationJobId- Required. The DiskMigrationJob identifier. The maximum length of this value is 63 characters. Valid characters are lower case Latin letters, digits and hyphen. It must start with a Latin letter and must not end with a hyphen.- Throws:
ApiException- if the remote call fails
-
createDiskMigrationJobAsync
public final OperationFuture<DiskMigrationJob,OperationMetadata> createDiskMigrationJobAsync(CreateDiskMigrationJobRequest request) Creates a new disk migration job in a given 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()) { CreateDiskMigrationJobRequest request = CreateDiskMigrationJobRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setDiskMigrationJobId("diskMigrationJobId-173409913") .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); DiskMigrationJob response = vmMigrationClient.createDiskMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDiskMigrationJobOperationCallable
public final OperationCallable<CreateDiskMigrationJobRequest,DiskMigrationJob, createDiskMigrationJobOperationCallable()OperationMetadata> Creates a new disk migration job in a given 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()) { CreateDiskMigrationJobRequest request = CreateDiskMigrationJobRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setDiskMigrationJobId("diskMigrationJobId-173409913") .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<DiskMigrationJob, OperationMetadata> future = vmMigrationClient.createDiskMigrationJobOperationCallable().futureCall(request); // Do something. DiskMigrationJob response = future.get(); } -
createDiskMigrationJobCallable
public final UnaryCallable<CreateDiskMigrationJobRequest,Operation> createDiskMigrationJobCallable()Creates a new disk migration job in a given 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()) { CreateDiskMigrationJobRequest request = CreateDiskMigrationJobRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setDiskMigrationJobId("diskMigrationJobId-173409913") .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vmMigrationClient.createDiskMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listDiskMigrationJobs
public final VmMigrationClient.ListDiskMigrationJobsPagedResponse listDiskMigrationJobs(SourceName parent) Lists DiskMigrationJobs in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]"); for (DiskMigrationJob element : vmMigrationClient.listDiskMigrationJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of DiskMigrationJobs.- Throws:
ApiException- if the remote call fails
-
listDiskMigrationJobs
public final VmMigrationClient.ListDiskMigrationJobsPagedResponse listDiskMigrationJobs(String parent) Lists DiskMigrationJobs in a given 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 parent = SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString(); for (DiskMigrationJob element : vmMigrationClient.listDiskMigrationJobs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of DiskMigrationJobs.- Throws:
ApiException- if the remote call fails
-
listDiskMigrationJobs
public final VmMigrationClient.ListDiskMigrationJobsPagedResponse listDiskMigrationJobs(ListDiskMigrationJobsRequest request) Lists DiskMigrationJobs in a given 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()) { ListDiskMigrationJobsRequest request = ListDiskMigrationJobsRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DiskMigrationJob element : vmMigrationClient.listDiskMigrationJobs(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDiskMigrationJobsPagedCallable
public final UnaryCallable<ListDiskMigrationJobsRequest,VmMigrationClient.ListDiskMigrationJobsPagedResponse> listDiskMigrationJobsPagedCallable()Lists DiskMigrationJobs in a given 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()) { ListDiskMigrationJobsRequest request = ListDiskMigrationJobsRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DiskMigrationJob> future = vmMigrationClient.listDiskMigrationJobsPagedCallable().futureCall(request); // Do something. for (DiskMigrationJob element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDiskMigrationJobsCallable
public final UnaryCallable<ListDiskMigrationJobsRequest,ListDiskMigrationJobsResponse> listDiskMigrationJobsCallable()Lists DiskMigrationJobs in a given 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()) { ListDiskMigrationJobsRequest request = ListDiskMigrationJobsRequest.newBuilder() .setParent(SourceName.of("[PROJECT]", "[LOCATION]", "[SOURCE]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListDiskMigrationJobsResponse response = vmMigrationClient.listDiskMigrationJobsCallable().call(request); for (DiskMigrationJob element : response.getDiskMigrationJobsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDiskMigrationJob
Gets details of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DiskMigrationJobName name = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]"); DiskMigrationJob response = vmMigrationClient.getDiskMigrationJob(name); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
getDiskMigrationJob
Gets details of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString(); DiskMigrationJob response = vmMigrationClient.getDiskMigrationJob(name); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
getDiskMigrationJob
Gets details of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetDiskMigrationJobRequest request = GetDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); DiskMigrationJob response = vmMigrationClient.getDiskMigrationJob(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDiskMigrationJobCallable
public final UnaryCallable<GetDiskMigrationJobRequest,DiskMigrationJob> getDiskMigrationJobCallable()Gets details of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { GetDiskMigrationJobRequest request = GetDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); ApiFuture<DiskMigrationJob> future = vmMigrationClient.getDiskMigrationJobCallable().futureCall(request); // Do something. DiskMigrationJob response = future.get(); } -
updateDiskMigrationJobAsync
public final OperationFuture<DiskMigrationJob,OperationMetadata> updateDiskMigrationJobAsync(DiskMigrationJob diskMigrationJob, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DiskMigrationJob diskMigrationJob = DiskMigrationJob.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DiskMigrationJob response = vmMigrationClient.updateDiskMigrationJobAsync(diskMigrationJob, updateMask).get(); }- Parameters:
diskMigrationJob- Required. The update request body.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the DiskMigrationJob 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 a mask equivalent to all fields that are populated (have a non-empty value), will be implied.- Throws:
ApiException- if the remote call fails
-
updateDiskMigrationJobAsync
public final OperationFuture<DiskMigrationJob,OperationMetadata> updateDiskMigrationJobAsync(UpdateDiskMigrationJobRequest request) Updates the parameters of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { UpdateDiskMigrationJobRequest request = UpdateDiskMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); DiskMigrationJob response = vmMigrationClient.updateDiskMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDiskMigrationJobOperationCallable
public final OperationCallable<UpdateDiskMigrationJobRequest,DiskMigrationJob, updateDiskMigrationJobOperationCallable()OperationMetadata> Updates the parameters of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { UpdateDiskMigrationJobRequest request = UpdateDiskMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<DiskMigrationJob, OperationMetadata> future = vmMigrationClient.updateDiskMigrationJobOperationCallable().futureCall(request); // Do something. DiskMigrationJob response = future.get(); } -
updateDiskMigrationJobCallable
public final UnaryCallable<UpdateDiskMigrationJobRequest,Operation> updateDiskMigrationJobCallable()Updates the parameters of a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { UpdateDiskMigrationJobRequest request = UpdateDiskMigrationJobRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDiskMigrationJob(DiskMigrationJob.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = vmMigrationClient.updateDiskMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteDiskMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDiskMigrationJobAsync(DiskMigrationJobName name) Deletes a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DiskMigrationJobName name = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]"); vmMigrationClient.deleteDiskMigrationJobAsync(name).get(); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
deleteDiskMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDiskMigrationJobAsync(String name) Deletes a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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 = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString(); vmMigrationClient.deleteDiskMigrationJobAsync(name).get(); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
deleteDiskMigrationJobAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDiskMigrationJobAsync(DeleteDiskMigrationJobRequest request) Deletes a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteDiskMigrationJobRequest request = DeleteDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); vmMigrationClient.deleteDiskMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDiskMigrationJobOperationCallable
public final OperationCallable<DeleteDiskMigrationJobRequest,com.google.protobuf.Empty, deleteDiskMigrationJobOperationCallable()OperationMetadata> Deletes a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteDiskMigrationJobRequest request = DeleteDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); OperationFuture<Empty, OperationMetadata> future = vmMigrationClient.deleteDiskMigrationJobOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteDiskMigrationJobCallable
public final UnaryCallable<DeleteDiskMigrationJobRequest,Operation> deleteDiskMigrationJobCallable()Deletes a single DiskMigrationJob.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { DeleteDiskMigrationJobRequest request = DeleteDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); ApiFuture<Operation> future = vmMigrationClient.deleteDiskMigrationJobCallable().futureCall(request); // Do something. future.get(); } -
runDiskMigrationJobAsync
public final OperationFuture<RunDiskMigrationJobResponse,OperationMetadata> runDiskMigrationJobAsync(DiskMigrationJobName name) Runs the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { DiskMigrationJobName name = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]"); RunDiskMigrationJobResponse response = vmMigrationClient.runDiskMigrationJobAsync(name).get(); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
runDiskMigrationJobAsync
public final OperationFuture<RunDiskMigrationJobResponse,OperationMetadata> runDiskMigrationJobAsync(String name) Runs the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { String name = DiskMigrationJobName.of("[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString(); RunDiskMigrationJobResponse response = vmMigrationClient.runDiskMigrationJobAsync(name).get(); }- Parameters:
name- Required. The name of the DiskMigrationJob.- Throws:
ApiException- if the remote call fails
-
runDiskMigrationJobAsync
public final OperationFuture<RunDiskMigrationJobResponse,OperationMetadata> runDiskMigrationJobAsync(RunDiskMigrationJobRequest request) Runs the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { RunDiskMigrationJobRequest request = RunDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); RunDiskMigrationJobResponse response = vmMigrationClient.runDiskMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
runDiskMigrationJobOperationCallable
public final OperationCallable<RunDiskMigrationJobRequest,RunDiskMigrationJobResponse, runDiskMigrationJobOperationCallable()OperationMetadata> Runs the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { RunDiskMigrationJobRequest request = RunDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); OperationFuture<RunDiskMigrationJobResponse, OperationMetadata> future = vmMigrationClient.runDiskMigrationJobOperationCallable().futureCall(request); // Do something. RunDiskMigrationJobResponse response = future.get(); } -
runDiskMigrationJobCallable
Runs the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { RunDiskMigrationJobRequest request = RunDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); ApiFuture<Operation> future = vmMigrationClient.runDiskMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
cancelDiskMigrationJobAsync
public final OperationFuture<CancelDiskMigrationJobResponse,OperationMetadata> cancelDiskMigrationJobAsync(CancelDiskMigrationJobRequest request) Cancels the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { CancelDiskMigrationJobRequest request = CancelDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); CancelDiskMigrationJobResponse response = vmMigrationClient.cancelDiskMigrationJobAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
cancelDiskMigrationJobOperationCallable
public final OperationCallable<CancelDiskMigrationJobRequest,CancelDiskMigrationJobResponse, cancelDiskMigrationJobOperationCallable()OperationMetadata> Cancels the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { CancelDiskMigrationJobRequest request = CancelDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); OperationFuture<CancelDiskMigrationJobResponse, OperationMetadata> future = vmMigrationClient.cancelDiskMigrationJobOperationCallable().futureCall(request); // Do something. CancelDiskMigrationJobResponse response = future.get(); } -
cancelDiskMigrationJobCallable
public final UnaryCallable<CancelDiskMigrationJobRequest,Operation> cancelDiskMigrationJobCallable()Cancels the disk migration job.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { CancelDiskMigrationJobRequest request = CancelDiskMigrationJobRequest.newBuilder() .setName( DiskMigrationJobName.of( "[PROJECT]", "[LOCATION]", "[SOURCE]", "[DISK_MIGRATION_JOB]") .toString()) .build(); ApiFuture<Operation> future = vmMigrationClient.cancelDiskMigrationJobCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
public final VmMigrationClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : vmMigrationClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,VmMigrationClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = vmMigrationClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying 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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = vmMigrationClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = vmMigrationClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (VmMigrationClient vmMigrationClient = VmMigrationClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = vmMigrationClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-