Class RapidMigrationAssessmentClient
- 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
RapidMigrationAssessmentClient.create()) {
AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]");
Annotation response = rapidMigrationAssessmentClient.getAnnotation(name);
}
Note: close() needs to be called on the RapidMigrationAssessmentClient 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 |
|---|---|---|
CreateCollector |
Create a Collector to manage the on-prem appliance which collects information about Customer assets. |
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.
|
CreateAnnotation |
Creates an Annotation |
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.
|
GetAnnotation |
Gets details of a single Annotation. |
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.
|
ListCollectors |
Lists Collectors 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.
|
GetCollector |
Gets details of a single Collector. |
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.
|
UpdateCollector |
Updates the parameters of a single Collector. |
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.
|
DeleteCollector |
Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API. |
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.
|
ResumeCollector |
Resumes the given collector. |
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.
|
RegisterCollector |
Registers the given collector. |
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.
|
PauseCollector |
Pauses the given collector. |
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.
|
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 RapidMigrationAssessmentSettings 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
RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
RapidMigrationAssessmentSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
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
RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
RapidMigrationAssessmentSettings.newBuilder().setEndpoint(myEndpoint).build();
RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
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
RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
RapidMigrationAssessmentSettings.newHttpJsonBuilder().build();
RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
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 class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of RapidMigrationAssessmentClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final RapidMigrationAssessmentClientcreate()Constructs an instance of RapidMigrationAssessmentClient with default settings.static final RapidMigrationAssessmentClientcreate(RapidMigrationAssessmentSettings settings) Constructs an instance of RapidMigrationAssessmentClient, using the given settings.static final RapidMigrationAssessmentClientConstructs an instance of RapidMigrationAssessmentClient, using the given stub for making calls.Creates an AnnotationcreateAnnotationAsync(LocationName parent, Annotation annotation) Creates an AnnotationcreateAnnotationAsync(String parent, Annotation annotation) Creates an AnnotationCreates an AnnotationCreates an AnnotationCreate a Collector to manage the on-prem appliance which collects information about Customer assets.createCollectorAsync(LocationName parent, Collector collector, String collectorId) Create a Collector to manage the on-prem appliance which collects information about Customer assets.createCollectorAsync(String parent, Collector collector, String collectorId) Create a Collector to manage the on-prem appliance which collects information about Customer assets.Create a Collector to manage the on-prem appliance which collects information about Customer assets.Create a Collector to manage the on-prem appliance which collects information about Customer assets.Deletes a single Collector - changes state of collector to "Deleting".Deletes a single Collector - changes state of collector to "Deleting".deleteCollectorAsync(String name) Deletes a single Collector - changes state of collector to "Deleting".Deletes a single Collector - changes state of collector to "Deleting".Deletes a single Collector - changes state of collector to "Deleting".final AnnotationgetAnnotation(AnnotationName name) Gets details of a single Annotation.final AnnotationgetAnnotation(GetAnnotationRequest request) Gets details of a single Annotation.final AnnotationgetAnnotation(String name) Gets details of a single Annotation.Gets details of a single Annotation.final CollectorgetCollector(CollectorName name) Gets details of a single Collector.final CollectorgetCollector(GetCollectorRequest request) Gets details of a single Collector.final CollectorgetCollector(String name) Gets details of a single Collector.Gets details of a single Collector.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.getStub()booleanbooleanlistCollectors(ListCollectorsRequest request) Lists Collectors in a given project and location.listCollectors(LocationName parent) Lists Collectors in a given project and location.listCollectors(String parent) Lists Collectors in a given project and location.Lists Collectors in a given project and location.final UnaryCallable<ListCollectorsRequest,RapidMigrationAssessmentClient.ListCollectorsPagedResponse> Lists Collectors in a given project and location.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.Pauses the given collector.pauseCollectorAsync(PauseCollectorRequest request) Pauses the given collector.pauseCollectorAsync(String name) Pauses the given collector.Pauses the given collector.Pauses the given collector.Registers the given collector.Registers the given collector.registerCollectorAsync(String name) Registers the given collector.Registers the given collector.Registers the given collector.Resumes the given collector.Resumes the given collector.resumeCollectorAsync(String name) Resumes the given collector.Resumes the given collector.Resumes the given collector.voidshutdown()voidupdateCollectorAsync(Collector collector, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Collector.Updates the parameters of a single Collector.Updates the parameters of a single Collector.Updates the parameters of a single Collector.
-
Constructor Details
-
RapidMigrationAssessmentClient
protected RapidMigrationAssessmentClient(RapidMigrationAssessmentSettings settings) throws IOException Constructs an instance of RapidMigrationAssessmentClient, 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
-
RapidMigrationAssessmentClient
-
-
Method Details
-
create
Constructs an instance of RapidMigrationAssessmentClient with default settings.- Throws:
IOException
-
create
public static final RapidMigrationAssessmentClient create(RapidMigrationAssessmentSettings settings) throws IOException Constructs an instance of RapidMigrationAssessmentClient, 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 RapidMigrationAssessmentClient, using the given stub for making calls. This is for advanced usage - prefer using create(RapidMigrationAssessmentSettings). -
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. -
createCollectorAsync
public final OperationFuture<Collector,OperationMetadata> createCollectorAsync(LocationName parent, Collector collector, String collectorId) Create a Collector to manage the on-prem appliance which collects information about Customer assets.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Collector collector = Collector.newBuilder().build(); String collectorId = "collectorId1854072456"; Collector response = rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get(); }- Parameters:
parent- Required. Name of the parent (project+location).collector- Required. The resource being created.collectorId- Required. Id of the requesting object.- Throws:
ApiException- if the remote call fails
-
createCollectorAsync
public final OperationFuture<Collector,OperationMetadata> createCollectorAsync(String parent, Collector collector, String collectorId) Create a Collector to manage the on-prem appliance which collects information about Customer assets.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Collector collector = Collector.newBuilder().build(); String collectorId = "collectorId1854072456"; Collector response = rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get(); }- Parameters:
parent- Required. Name of the parent (project+location).collector- Required. The resource being created.collectorId- Required. Id of the requesting object.- Throws:
ApiException- if the remote call fails
-
createCollectorAsync
public final OperationFuture<Collector,OperationMetadata> createCollectorAsync(CreateCollectorRequest request) Create a Collector to manage the on-prem appliance which collects information about Customer assets.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateCollectorRequest request = CreateCollectorRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectorId("collectorId1854072456") .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.createCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createCollectorOperationCallable
public final OperationCallable<CreateCollectorRequest,Collector, createCollectorOperationCallable()OperationMetadata> Create a Collector to manage the on-prem appliance which collects information about Customer assets.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateCollectorRequest request = CreateCollectorRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectorId("collectorId1854072456") .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.createCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
createCollectorCallable
Create a Collector to manage the on-prem appliance which collects information about Customer assets.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateCollectorRequest request = CreateCollectorRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setCollectorId("collectorId1854072456") .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.createCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createAnnotationAsync
public final OperationFuture<Annotation,OperationMetadata> createAnnotationAsync(LocationName parent, Annotation annotation) Creates an AnnotationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Annotation annotation = Annotation.newBuilder().build(); Annotation response = rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get(); }- Parameters:
parent- Required. Name of the parent (project+location).annotation- Required. The resource being created.- Throws:
ApiException- if the remote call fails
-
createAnnotationAsync
public final OperationFuture<Annotation,OperationMetadata> createAnnotationAsync(String parent, Annotation annotation) Creates an AnnotationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Annotation annotation = Annotation.newBuilder().build(); Annotation response = rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get(); }- Parameters:
parent- Required. Name of the parent (project+location).annotation- Required. The resource being created.- Throws:
ApiException- if the remote call fails
-
createAnnotationAsync
public final OperationFuture<Annotation,OperationMetadata> createAnnotationAsync(CreateAnnotationRequest request) Creates an AnnotationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateAnnotationRequest request = CreateAnnotationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAnnotation(Annotation.newBuilder().build()) .setRequestId("requestId693933066") .build(); Annotation response = rapidMigrationAssessmentClient.createAnnotationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAnnotationOperationCallable
public final OperationCallable<CreateAnnotationRequest,Annotation, createAnnotationOperationCallable()OperationMetadata> Creates an AnnotationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateAnnotationRequest request = CreateAnnotationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAnnotation(Annotation.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Annotation, OperationMetadata> future = rapidMigrationAssessmentClient.createAnnotationOperationCallable().futureCall(request); // Do something. Annotation response = future.get(); } -
createAnnotationCallable
Creates an AnnotationSample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CreateAnnotationRequest request = CreateAnnotationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setAnnotation(Annotation.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.createAnnotationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getAnnotation
Gets details of a single Annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); Annotation response = rapidMigrationAssessmentClient.getAnnotation(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getAnnotation
Gets details of a single Annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString(); Annotation response = rapidMigrationAssessmentClient.getAnnotation(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getAnnotation
Gets details of a single Annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetAnnotationRequest request = GetAnnotationRequest.newBuilder() .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) .build(); Annotation response = rapidMigrationAssessmentClient.getAnnotation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAnnotationCallable
Gets details of a single Annotation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetAnnotationRequest request = GetAnnotationRequest.newBuilder() .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) .build(); ApiFuture<Annotation> future = rapidMigrationAssessmentClient.getAnnotationCallable().futureCall(request); // Do something. Annotation response = future.get(); } -
listCollectors
public final RapidMigrationAssessmentClient.ListCollectorsPagedResponse listCollectors(LocationName parent) Lists Collectors 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListCollectorsRequest.- Throws:
ApiException- if the remote call fails
-
listCollectors
public final RapidMigrationAssessmentClient.ListCollectorsPagedResponse listCollectors(String parent) Lists Collectors 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListCollectorsRequest.- Throws:
ApiException- if the remote call fails
-
listCollectors
public final RapidMigrationAssessmentClient.ListCollectorsPagedResponse listCollectors(ListCollectorsRequest request) Lists Collectors 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListCollectorsRequest request = ListCollectorsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Collector element : rapidMigrationAssessmentClient.listCollectors(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
-
listCollectorsPagedCallable
public final UnaryCallable<ListCollectorsRequest,RapidMigrationAssessmentClient.ListCollectorsPagedResponse> listCollectorsPagedCallable()Lists Collectors 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListCollectorsRequest request = ListCollectorsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Collector> future = rapidMigrationAssessmentClient.listCollectorsPagedCallable().futureCall(request); // Do something. for (Collector element : future.get().iterateAll()) { // doThingsWith(element); } } -
listCollectorsCallable
Lists Collectors 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListCollectorsRequest request = ListCollectorsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListCollectorsResponse response = rapidMigrationAssessmentClient.listCollectorsCallable().call(request); for (Collector element : response.getCollectorsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getCollector
Gets details of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); Collector response = rapidMigrationAssessmentClient.getCollector(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getCollector
Gets details of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); Collector response = rapidMigrationAssessmentClient.getCollector(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getCollector
Gets details of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetCollectorRequest request = GetCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .build(); Collector response = rapidMigrationAssessmentClient.getCollector(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getCollectorCallable
Gets details of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetCollectorRequest request = GetCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .build(); ApiFuture<Collector> future = rapidMigrationAssessmentClient.getCollectorCallable().futureCall(request); // Do something. Collector response = future.get(); } -
updateCollectorAsync
public final OperationFuture<Collector,OperationMetadata> updateCollectorAsync(Collector collector, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { Collector collector = Collector.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Collector response = rapidMigrationAssessmentClient.updateCollectorAsync(collector, updateMask).get(); }- Parameters:
collector- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Collector 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
-
updateCollectorAsync
public final OperationFuture<Collector,OperationMetadata> updateCollectorAsync(UpdateCollectorRequest request) Updates the parameters of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { UpdateCollectorRequest request = UpdateCollectorRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.updateCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateCollectorOperationCallable
public final OperationCallable<UpdateCollectorRequest,Collector, updateCollectorOperationCallable()OperationMetadata> Updates the parameters of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { UpdateCollectorRequest request = UpdateCollectorRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.updateCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
updateCollectorCallable
Updates the parameters of a single Collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { UpdateCollectorRequest request = UpdateCollectorRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setCollector(Collector.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.updateCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteCollectorAsync
Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteCollectorAsync
Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteCollectorAsync
public final OperationFuture<Collector,OperationMetadata> deleteCollectorAsync(DeleteCollectorRequest request) Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { DeleteCollectorRequest request = DeleteCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteCollectorOperationCallable
public final OperationCallable<DeleteCollectorRequest,Collector, deleteCollectorOperationCallable()OperationMetadata> Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { DeleteCollectorRequest request = DeleteCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.deleteCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
deleteCollectorCallable
Deletes a single Collector - changes state of collector to "Deleting". Background jobs does final deletion through producer API.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { DeleteCollectorRequest request = DeleteCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.deleteCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
resumeCollectorAsync
Resumes the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
resumeCollectorAsync
Resumes the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
resumeCollectorAsync
public final OperationFuture<Collector,OperationMetadata> resumeCollectorAsync(ResumeCollectorRequest request) Resumes the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ResumeCollectorRequest request = ResumeCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resumeCollectorOperationCallable
public final OperationCallable<ResumeCollectorRequest,Collector, resumeCollectorOperationCallable()OperationMetadata> Resumes the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ResumeCollectorRequest request = ResumeCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.resumeCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
resumeCollectorCallable
Resumes the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ResumeCollectorRequest request = ResumeCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.resumeCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
registerCollectorAsync
public final OperationFuture<Collector,OperationMetadata> registerCollectorAsync(CollectorName name) Registers the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
registerCollectorAsync
Registers the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
registerCollectorAsync
public final OperationFuture<Collector,OperationMetadata> registerCollectorAsync(RegisterCollectorRequest request) Registers the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { RegisterCollectorRequest request = RegisterCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
registerCollectorOperationCallable
public final OperationCallable<RegisterCollectorRequest,Collector, registerCollectorOperationCallable()OperationMetadata> Registers the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { RegisterCollectorRequest request = RegisterCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.registerCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
registerCollectorCallable
Registers the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { RegisterCollectorRequest request = RegisterCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.registerCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
pauseCollectorAsync
Pauses the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
pauseCollectorAsync
Pauses the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
pauseCollectorAsync
public final OperationFuture<Collector,OperationMetadata> pauseCollectorAsync(PauseCollectorRequest request) Pauses the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { PauseCollectorRequest request = PauseCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
pauseCollectorOperationCallable
public final OperationCallable<PauseCollectorRequest,Collector, pauseCollectorOperationCallable()OperationMetadata> Pauses the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { PauseCollectorRequest request = PauseCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Collector, OperationMetadata> future = rapidMigrationAssessmentClient.pauseCollectorOperationCallable().futureCall(request); // Do something. Collector response = future.get(); } -
pauseCollectorCallable
Pauses the given collector.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { PauseCollectorRequest request = PauseCollectorRequest.newBuilder() .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = rapidMigrationAssessmentClient.pauseCollectorCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
public final RapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : rapidMigrationAssessmentClient.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,RapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = RapidMigrationAssessmentClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = rapidMigrationAssessmentClient.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
-