Class AutoMlClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.
An ID of a resource is the last element of the item's resource name. For `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then the id for the item is `{dataset_id}`.
Currently the only supported `location_id` is "us-central1".
On any input that is documented to expect a string parameter in snake_case or dash-case, either of those cases is accepted.
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 (AutoMlClient autoMlClient = AutoMlClient.create()) {
DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
Dataset response = autoMlClient.getDataset(name);
}
Note: close() needs to be called on the AutoMlClient 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 |
|---|---|---|
CreateDataset |
Creates a dataset. |
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.
|
GetDataset |
Gets a dataset. |
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.
|
ListDatasets |
Lists datasets in a 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.
|
UpdateDataset |
Updates a dataset. |
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.
|
DeleteDataset |
Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field. |
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.
|
ImportData |
Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables:
|
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.
|
ExportData |
Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes. |
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.
|
GetAnnotationSpec |
Gets an annotation spec. |
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.
|
CreateModel |
Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec. |
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.
|
GetModel |
Gets a model. |
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.
|
ListModels |
Lists models. |
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.
|
DeleteModel |
Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field. |
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.
|
UpdateModel |
Updates a model. |
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.
|
DeployModel |
Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes. |
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.
|
UndeployModel |
Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes. |
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.
|
ExportModel |
Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes. |
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.
|
GetModelEvaluation |
Gets a model evaluation. |
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.
|
ListModelEvaluations |
Lists model evaluations. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of AutoMlSettings 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
AutoMlSettings autoMlSettings =
AutoMlSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
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
AutoMlSettings autoMlSettings = AutoMlSettings.newBuilder().setEndpoint(myEndpoint).build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
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
AutoMlSettings autoMlSettings = AutoMlSettings.newHttpJsonBuilder().build();
AutoMlClient autoMlClient = AutoMlClient.create(autoMlSettings);
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 class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAutoMlClient(AutoMlSettings settings) Constructs an instance of AutoMlClient, using the given settings.protectedAutoMlClient(AutoMlStub stub) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final AutoMlClientcreate()Constructs an instance of AutoMlClient with default settings.static final AutoMlClientcreate(AutoMlSettings settings) Constructs an instance of AutoMlClient, using the given settings.static final AutoMlClientcreate(AutoMlStub stub) Constructs an instance of AutoMlClient, using the given stub for making calls.createDatasetAsync(CreateDatasetRequest request) Creates a dataset.createDatasetAsync(LocationName parent, Dataset dataset) Creates a dataset.createDatasetAsync(String parent, Dataset dataset) Creates a dataset.Creates a dataset.Creates a dataset.createModelAsync(CreateModelRequest request) Creates a model.createModelAsync(LocationName parent, Model model) Creates a model.createModelAsync(String parent, Model model) Creates a model.Creates a model.Creates a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a dataset and all of its contents.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request) Deletes a dataset and all of its contents.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(String name) Deletes a dataset and all of its contents.Deletes a dataset and all of its contents.final OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a dataset and all of its contents.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(DeleteModelRequest request) Deletes a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(ModelName name) Deletes a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(String name) Deletes a model.Deletes a model.final OperationCallable<DeleteModelRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(DeployModelRequest request) Deploys a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(ModelName name) Deploys a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(String name) Deploys a model.Deploys a model.final OperationCallable<DeployModelRequest,com.google.protobuf.Empty, OperationMetadata> Deploys a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(DatasetName name, OutputConfig outputConfig) Exports dataset's data to the provided output location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(ExportDataRequest request) Exports dataset's data to the provided output location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(String name, OutputConfig outputConfig) Exports dataset's data to the provided output location.Exports dataset's data to the provided output location.final OperationCallable<ExportDataRequest,com.google.protobuf.Empty, OperationMetadata> Exports dataset's data to the provided output location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(ExportModelRequest request) Exports a trained, "export-able", model to a user specified Google Cloud Storage location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(ModelName name, ModelExportOutputConfig outputConfig) Exports a trained, "export-able", model to a user specified Google Cloud Storage location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(String name, ModelExportOutputConfig outputConfig) Exports a trained, "export-able", model to a user specified Google Cloud Storage location.Exports a trained, "export-able", model to a user specified Google Cloud Storage location.final OperationCallable<ExportModelRequest,com.google.protobuf.Empty, OperationMetadata> Exports a trained, "export-able", model to a user specified Google Cloud Storage location.final AnnotationSpecGets an annotation spec.final AnnotationSpecGets an annotation spec.final AnnotationSpecgetAnnotationSpec(String name) Gets an annotation spec.Gets an annotation spec.final DatasetgetDataset(DatasetName name) Gets a dataset.final DatasetgetDataset(GetDatasetRequest request) Gets a dataset.final DatasetgetDataset(String name) Gets a dataset.Gets a dataset.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ModelgetModel(GetModelRequest request) Gets a model.final ModelGets a model.final ModelGets a model.final UnaryCallable<GetModelRequest,Model> Gets a model.final ModelEvaluationGets a model evaluation.final ModelEvaluationGets a model evaluation.final ModelEvaluationgetModelEvaluation(String name) Gets a model evaluation.Gets a model evaluation.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final AutoMlSettingsgetStub()final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(DatasetName name, InputConfig inputConfig) Imports data into a dataset.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(ImportDataRequest request) Imports data into a dataset.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(String name, InputConfig inputConfig) Imports data into a dataset.Imports data into a dataset.final OperationCallable<ImportDataRequest,com.google.protobuf.Empty, OperationMetadata> Imports data into a dataset.booleanbooleanlistDatasets(ListDatasetsRequest request) Lists datasets in a project.listDatasets(LocationName parent) Lists datasets in a project.listDatasets(String parent) Lists datasets in a project.Lists datasets in a project.Lists datasets in a project.Lists model evaluations.listModelEvaluations(ModelName parent, String filter) Lists model evaluations.listModelEvaluations(String parent, String filter) Lists model evaluations.Lists model evaluations.Lists model evaluations.listModels(ListModelsRequest request) Lists models.listModels(LocationName parent) Lists models.listModels(String parent) Lists models.Lists models.Lists models.voidshutdown()voidfinal OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(ModelName name) Undeploys a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(UndeployModelRequest request) Undeploys a model.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(String name) Undeploys a model.Undeploys a model.final OperationCallable<UndeployModelRequest,com.google.protobuf.Empty, OperationMetadata> Undeploys a model.final DatasetupdateDataset(Dataset dataset, com.google.protobuf.FieldMask updateMask) Updates a dataset.final DatasetupdateDataset(UpdateDatasetRequest request) Updates a dataset.Updates a dataset.final ModelupdateModel(Model model, com.google.protobuf.FieldMask updateMask) Updates a model.final ModelupdateModel(UpdateModelRequest request) Updates a model.final UnaryCallable<UpdateModelRequest,Model> Updates a model.
-
Constructor Details
-
AutoMlClient
Constructs an instance of AutoMlClient, 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
-
AutoMlClient
-
-
Method Details
-
create
Constructs an instance of AutoMlClient with default settings.- Throws:
IOException
-
create
Constructs an instance of AutoMlClient, 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 AutoMlClient, using the given stub for making calls. This is for advanced usage - prefer using create(AutoMlSettings). -
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. -
createDatasetAsync
public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset) Creates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Dataset dataset = Dataset.newBuilder().build(); Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get(); }- Parameters:
parent- Required. The resource name of the project to create the dataset for.dataset- Required. The dataset to create.- Throws:
ApiException- if the remote call fails
-
createDatasetAsync
public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(String parent, Dataset dataset) Creates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Dataset dataset = Dataset.newBuilder().build(); Dataset response = autoMlClient.createDatasetAsync(parent, dataset).get(); }- Parameters:
parent- Required. The resource name of the project to create the dataset for.dataset- Required. The dataset to create.- Throws:
ApiException- if the remote call fails
-
createDatasetAsync
public final OperationFuture<Dataset,OperationMetadata> createDatasetAsync(CreateDatasetRequest request) Creates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); Dataset response = autoMlClient.createDatasetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDatasetOperationCallable
public final OperationCallable<CreateDatasetRequest,Dataset, createDatasetOperationCallable()OperationMetadata> Creates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); OperationFuture<Dataset, OperationMetadata> future = autoMlClient.createDatasetOperationCallable().futureCall(request); // Do something. Dataset response = future.get(); } -
createDatasetCallable
Creates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateDatasetRequest request = CreateDatasetRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataset(Dataset.newBuilder().build()) .build(); ApiFuture<Operation> future = autoMlClient.createDatasetCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getDataset
Gets a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); Dataset response = autoMlClient.getDataset(name); }- Parameters:
name- Required. The resource name of the dataset to retrieve.- Throws:
ApiException- if the remote call fails
-
getDataset
Gets a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); Dataset response = autoMlClient.getDataset(name); }- Parameters:
name- Required. The resource name of the dataset to retrieve.- Throws:
ApiException- if the remote call fails
-
getDataset
Gets a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); Dataset response = autoMlClient.getDataset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDatasetCallable
Gets a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetDatasetRequest request = GetDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); ApiFuture<Dataset> future = autoMlClient.getDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); } -
listDatasets
Lists datasets in a 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 (AutoMlClient autoMlClient = AutoMlClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the project from which to list datasets.- Throws:
ApiException- if the remote call fails
-
listDatasets
Lists datasets in a 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 (AutoMlClient autoMlClient = AutoMlClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Dataset element : autoMlClient.listDatasets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the project from which to list datasets.- Throws:
ApiException- if the remote call fails
-
listDatasets
Lists datasets in a 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 (AutoMlClient autoMlClient = AutoMlClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Dataset element : autoMlClient.listDatasets(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
-
listDatasetsPagedCallable
public final UnaryCallable<ListDatasetsRequest,AutoMlClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()Lists datasets in a 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 (AutoMlClient autoMlClient = AutoMlClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Dataset> future = autoMlClient.listDatasetsPagedCallable().futureCall(request); // Do something. for (Dataset element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDatasetsCallable
Lists datasets in a 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 (AutoMlClient autoMlClient = AutoMlClient.create()) { ListDatasetsRequest request = ListDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDatasetsResponse response = autoMlClient.listDatasetsCallable().call(request); for (Dataset element : response.getDatasetsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateDataset
Updates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { Dataset dataset = Dataset.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Dataset response = autoMlClient.updateDataset(dataset, updateMask); }- Parameters:
dataset- Required. The dataset which replaces the resource on the server.updateMask- Required. The update mask applies to the resource.- Throws:
ApiException- if the remote call fails
-
updateDataset
Updates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder() .setDataset(Dataset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Dataset response = autoMlClient.updateDataset(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDatasetCallable
Updates a dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UpdateDatasetRequest request = UpdateDatasetRequest.newBuilder() .setDataset(Dataset.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Dataset> future = autoMlClient.updateDatasetCallable().futureCall(request); // Do something. Dataset response = future.get(); } -
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DatasetName name) Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); autoMlClient.deleteDatasetAsync(name).get(); }- Parameters:
name- Required. The resource name of the dataset to delete.- Throws:
ApiException- if the remote call fails
-
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(String name) Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); autoMlClient.deleteDatasetAsync(name).get(); }- Parameters:
name- Required. The resource name of the dataset to delete.- Throws:
ApiException- if the remote call fails
-
deleteDatasetAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request) Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); autoMlClient.deleteDatasetAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDatasetOperationCallable
public final OperationCallable<DeleteDatasetRequest,com.google.protobuf.Empty, deleteDatasetOperationCallable()OperationMetadata> Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteDatasetOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteDatasetCallable
Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteDatasetRequest request = DeleteDatasetRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .build(); ApiFuture<Operation> future = autoMlClient.deleteDatasetCallable().futureCall(request); // Do something. future.get(); } -
importDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(DatasetName name, InputConfig inputConfig) Imports data into a dataset. For Tables this method can only be called on an empty Dataset.For Tables:
- A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); InputConfig inputConfig = InputConfig.newBuilder().build(); autoMlClient.importDataAsync(name, inputConfig).get(); }- Parameters:
name- Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.inputConfig- Required. The desired input location and its domain specific semantics, if any.- Throws:
ApiException- if the remote call fails
-
importDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(String name, InputConfig inputConfig) Imports data into a dataset. For Tables this method can only be called on an empty Dataset.For Tables:
- A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); InputConfig inputConfig = InputConfig.newBuilder().build(); autoMlClient.importDataAsync(name, inputConfig).get(); }- Parameters:
name- Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.inputConfig- Required. The desired input location and its domain specific semantics, if any.- Throws:
ApiException- if the remote call fails
-
importDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> importDataAsync(ImportDataRequest request) Imports data into a dataset. For Tables this method can only be called on an empty Dataset.For Tables:
- A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); autoMlClient.importDataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importDataOperationCallable
public final OperationCallable<ImportDataRequest,com.google.protobuf.Empty, importDataOperationCallable()OperationMetadata> Imports data into a dataset. For Tables this method can only be called on an empty Dataset.For Tables:
- A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.importDataOperationCallable().futureCall(request); // Do something. future.get(); } -
importDataCallable
Imports data into a dataset. For Tables this method can only be called on an empty Dataset.For Tables:
- A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = autoMlClient.importDataCallable().futureCall(request); // Do something. future.get(); } -
exportDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(DatasetName name, OutputConfig outputConfig) Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); OutputConfig outputConfig = OutputConfig.newBuilder().build(); autoMlClient.exportDataAsync(name, outputConfig).get(); }- Parameters:
name- Required. The resource name of the dataset.outputConfig- Required. The desired output location.- Throws:
ApiException- if the remote call fails
-
exportDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(String name, OutputConfig outputConfig) Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); OutputConfig outputConfig = OutputConfig.newBuilder().build(); autoMlClient.exportDataAsync(name, outputConfig).get(); }- Parameters:
name- Required. The resource name of the dataset.outputConfig- Required. The desired output location.- Throws:
ApiException- if the remote call fails
-
exportDataAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportDataAsync(ExportDataRequest request) Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .build(); autoMlClient.exportDataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportDataOperationCallable
public final OperationCallable<ExportDataRequest,com.google.protobuf.Empty, exportDataOperationCallable()OperationMetadata> Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportDataOperationCallable().futureCall(request); // Do something. future.get(); } -
exportDataCallable
Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = autoMlClient.exportDataCallable().futureCall(request); // Do something. future.get(); } -
getAnnotationSpec
Gets an annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { AnnotationSpecName name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); AnnotationSpec response = autoMlClient.getAnnotationSpec(name); }- Parameters:
name- Required. The resource name of the annotation spec to retrieve.- Throws:
ApiException- if the remote call fails
-
getAnnotationSpec
Gets an annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") .toString(); AnnotationSpec response = autoMlClient.getAnnotationSpec(name); }- Parameters:
name- Required. The resource name of the annotation spec to retrieve.- Throws:
ApiException- if the remote call fails
-
getAnnotationSpec
Gets an annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder() .setName( AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") .toString()) .build(); AnnotationSpec response = autoMlClient.getAnnotationSpec(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAnnotationSpecCallable
Gets an annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetAnnotationSpecRequest request = GetAnnotationSpecRequest.newBuilder() .setName( AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") .toString()) .build(); ApiFuture<AnnotationSpec> future = autoMlClient.getAnnotationSpecCallable().futureCall(request); // Do something. AnnotationSpec response = future.get(); } -
createModelAsync
public final OperationFuture<Model,OperationMetadata> createModelAsync(LocationName parent, Model model) Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Model model = Model.newBuilder().build(); Model response = autoMlClient.createModelAsync(parent, model).get(); }- Parameters:
parent- Required. Resource name of the parent project where the model is being created.model- Required. The model to create.- Throws:
ApiException- if the remote call fails
-
createModelAsync
Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Model model = Model.newBuilder().build(); Model response = autoMlClient.createModelAsync(parent, model).get(); }- Parameters:
parent- Required. Resource name of the parent project where the model is being created.model- Required. The model to create.- Throws:
ApiException- if the remote call fails
-
createModelAsync
Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateModelRequest request = CreateModelRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setModel(Model.newBuilder().build()) .build(); Model response = autoMlClient.createModelAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createModelOperationCallable
public final OperationCallable<CreateModelRequest,Model, createModelOperationCallable()OperationMetadata> Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateModelRequest request = CreateModelRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setModel(Model.newBuilder().build()) .build(); OperationFuture<Model, OperationMetadata> future = autoMlClient.createModelOperationCallable().futureCall(request); // Do something. Model response = future.get(); } -
createModelCallable
Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { CreateModelRequest request = CreateModelRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setModel(Model.newBuilder().build()) .build(); ApiFuture<Operation> future = autoMlClient.createModelCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getModel
Gets a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); Model response = autoMlClient.getModel(name); }- Parameters:
name- Required. Resource name of the model.- Throws:
ApiException- if the remote call fails
-
getModel
Gets a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); Model response = autoMlClient.getModel(name); }- Parameters:
name- Required. Resource name of the model.- Throws:
ApiException- if the remote call fails
-
getModel
Gets a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetModelRequest request = GetModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); Model response = autoMlClient.getModel(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getModelCallable
Gets a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetModelRequest request = GetModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); ApiFuture<Model> future = autoMlClient.getModelCallable().futureCall(request); // Do something. Model response = future.get(); } -
listModels
Lists models.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Model element : autoMlClient.listModels(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the project, from which to list the models.- Throws:
ApiException- if the remote call fails
-
listModels
Lists models.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Model element : autoMlClient.listModels(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the project, from which to list the models.- Throws:
ApiException- if the remote call fails
-
listModels
Lists models.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelsRequest request = ListModelsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Model element : autoMlClient.listModels(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
-
listModelsPagedCallable
public final UnaryCallable<ListModelsRequest,AutoMlClient.ListModelsPagedResponse> listModelsPagedCallable()Lists models.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelsRequest request = ListModelsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Model> future = autoMlClient.listModelsPagedCallable().futureCall(request); // Do something. for (Model element : future.get().iterateAll()) { // doThingsWith(element); } } -
listModelsCallable
Lists models.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelsRequest request = ListModelsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListModelsResponse response = autoMlClient.listModelsCallable().call(request); for (Model element : response.getModelList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(ModelName name) Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); autoMlClient.deleteModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model being deleted.- Throws:
ApiException- if the remote call fails
-
deleteModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(String name) Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); autoMlClient.deleteModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model being deleted.- Throws:
ApiException- if the remote call fails
-
deleteModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteModelAsync(DeleteModelRequest request) Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteModelRequest request = DeleteModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); autoMlClient.deleteModelAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteModelOperationCallable
public final OperationCallable<DeleteModelRequest,com.google.protobuf.Empty, deleteModelOperationCallable()OperationMetadata> Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteModelRequest request = DeleteModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.deleteModelOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteModelCallable
Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeleteModelRequest request = DeleteModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); ApiFuture<Operation> future = autoMlClient.deleteModelCallable().futureCall(request); // Do something. future.get(); } -
updateModel
Updates a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { Model model = Model.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Model response = autoMlClient.updateModel(model, updateMask); }- Parameters:
model- Required. The model which replaces the resource on the server.updateMask- Required. The update mask applies to the resource.- Throws:
ApiException- if the remote call fails
-
updateModel
Updates a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UpdateModelRequest request = UpdateModelRequest.newBuilder() .setModel(Model.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Model response = autoMlClient.updateModel(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateModelCallable
Updates a model.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UpdateModelRequest request = UpdateModelRequest.newBuilder() .setModel(Model.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Model> future = autoMlClient.updateModelCallable().futureCall(request); // Do something. Model response = future.get(); } -
deployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(ModelName name) Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); autoMlClient.deployModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model to deploy.- Throws:
ApiException- if the remote call fails
-
deployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(String name) Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); autoMlClient.deployModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model to deploy.- Throws:
ApiException- if the remote call fails
-
deployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deployModelAsync(DeployModelRequest request) Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeployModelRequest request = DeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); autoMlClient.deployModelAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deployModelOperationCallable
public final OperationCallable<DeployModelRequest,com.google.protobuf.Empty, deployModelOperationCallable()OperationMetadata> Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeployModelRequest request = DeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.deployModelOperationCallable().futureCall(request); // Do something. future.get(); } -
deployModelCallable
Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability.Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { DeployModelRequest request = DeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); ApiFuture<Operation> future = autoMlClient.deployModelCallable().futureCall(request); // Do something. future.get(); } -
undeployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(ModelName name) Undeploys a model. If the model is not deployed this method has no effect.Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); autoMlClient.undeployModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model to undeploy.- Throws:
ApiException- if the remote call fails
-
undeployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(String name) Undeploys a model. If the model is not deployed this method has no effect.Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); autoMlClient.undeployModelAsync(name).get(); }- Parameters:
name- Required. Resource name of the model to undeploy.- Throws:
ApiException- if the remote call fails
-
undeployModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> undeployModelAsync(UndeployModelRequest request) Undeploys a model. If the model is not deployed this method has no effect.Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UndeployModelRequest request = UndeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); autoMlClient.undeployModelAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
undeployModelOperationCallable
public final OperationCallable<UndeployModelRequest,com.google.protobuf.Empty, undeployModelOperationCallable()OperationMetadata> Undeploys a model. If the model is not deployed this method has no effect.Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UndeployModelRequest request = UndeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.undeployModelOperationCallable().futureCall(request); // Do something. future.get(); } -
undeployModelCallable
Undeploys a model. If the model is not deployed this method has no effect.Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { UndeployModelRequest request = UndeployModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .build(); ApiFuture<Operation> future = autoMlClient.undeployModelCallable().futureCall(request); // Do something. future.get(); } -
exportModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(ModelName name, ModelExportOutputConfig outputConfig) Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); autoMlClient.exportModelAsync(name, outputConfig).get(); }- Parameters:
name- Required. The resource name of the model to export.outputConfig- Required. The desired output location and configuration.- Throws:
ApiException- if the remote call fails
-
exportModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(String name, ModelExportOutputConfig outputConfig) Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); ModelExportOutputConfig outputConfig = ModelExportOutputConfig.newBuilder().build(); autoMlClient.exportModelAsync(name, outputConfig).get(); }- Parameters:
name- Required. The resource name of the model to export.outputConfig- Required. The desired output location and configuration.- Throws:
ApiException- if the remote call fails
-
exportModelAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> exportModelAsync(ExportModelRequest request) Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportModelRequest request = ExportModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) .build(); autoMlClient.exportModelAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportModelOperationCallable
public final OperationCallable<ExportModelRequest,com.google.protobuf.Empty, exportModelOperationCallable()OperationMetadata> Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportModelRequest request = ExportModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) .build(); OperationFuture<Empty, OperationMetadata> future = autoMlClient.exportModelOperationCallable().futureCall(request); // Do something. future.get(); } -
exportModelCallable
Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig].Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ExportModelRequest request = ExportModelRequest.newBuilder() .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setOutputConfig(ModelExportOutputConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = autoMlClient.exportModelCallable().futureCall(request); // Do something. future.get(); } -
getModelEvaluation
Gets a model evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelEvaluationName name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]"); ModelEvaluation response = autoMlClient.getModelEvaluation(name); }- Parameters:
name- Required. Resource name for the model evaluation.- Throws:
ApiException- if the remote call fails
-
getModelEvaluation
Gets a model evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String name = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") .toString(); ModelEvaluation response = autoMlClient.getModelEvaluation(name); }- Parameters:
name- Required. Resource name for the model evaluation.- Throws:
ApiException- if the remote call fails
-
getModelEvaluation
Gets a model evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder() .setName( ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") .toString()) .build(); ModelEvaluation response = autoMlClient.getModelEvaluation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getModelEvaluationCallable
Gets a model evaluation.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { GetModelEvaluationRequest request = GetModelEvaluationRequest.newBuilder() .setName( ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[MODEL_EVALUATION]") .toString()) .build(); ApiFuture<ModelEvaluation> future = autoMlClient.getModelEvaluationCallable().futureCall(request); // Do something. ModelEvaluation response = future.get(); } -
listModelEvaluations
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ModelName parent, String filter) Lists model evaluations.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]"); String filter = "filter-1274492040"; for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.filter- Required. An expression for filtering the results of the request.* `annotation_spec_id` - for =, != or existence. See example below for the last.
Some examples of using the filter are:
* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation was done for aggregate of all annotation specs.
- Throws:
ApiException- if the remote call fails
-
listModelEvaluations
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(String parent, String filter) Lists model evaluations.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString(); String filter = "filter-1274492040"; for (ModelEvaluation element : autoMlClient.listModelEvaluations(parent, filter).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.filter- Required. An expression for filtering the results of the request.* `annotation_spec_id` - for =, != or existence. See example below for the last.
Some examples of using the filter are:
* `annotation_spec_id!=4` --> The model evaluation was done for annotation spec with ID different than 4. * `NOT annotation_spec_id:*` --> The model evaluation was done for aggregate of all annotation specs.
- Throws:
ApiException- if the remote call fails
-
listModelEvaluations
public final AutoMlClient.ListModelEvaluationsPagedResponse listModelEvaluations(ListModelEvaluationsRequest request) Lists model evaluations.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder() .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ModelEvaluation element : autoMlClient.listModelEvaluations(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
-
listModelEvaluationsPagedCallable
public final UnaryCallable<ListModelEvaluationsRequest,AutoMlClient.ListModelEvaluationsPagedResponse> listModelEvaluationsPagedCallable()Lists model evaluations.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder() .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ModelEvaluation> future = autoMlClient.listModelEvaluationsPagedCallable().futureCall(request); // Do something. for (ModelEvaluation element : future.get().iterateAll()) { // doThingsWith(element); } } -
listModelEvaluationsCallable
public final UnaryCallable<ListModelEvaluationsRequest,ListModelEvaluationsResponse> listModelEvaluationsCallable()Lists model evaluations.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AutoMlClient autoMlClient = AutoMlClient.create()) { ListModelEvaluationsRequest request = ListModelEvaluationsRequest.newBuilder() .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListModelEvaluationsResponse response = autoMlClient.listModelEvaluationsCallable().call(request); for (ModelEvaluation element : response.getModelEvaluationList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-