@Generated(value="by gapic-generator-java") public class JobServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
CustomJob customJob = CustomJob.newBuilder().build();
CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
}
Note: close() needs to be called on the JobServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of JobServiceSettings to create(). For example:
To customize credentials:
JobServiceSettings jobServiceSettings =
JobServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
To customize the endpoint:
JobServiceSettings jobServiceSettings =
JobServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier and Type | Class and Description |
---|---|
static class |
JobServiceClient.ListBatchPredictionJobsFixedSizeCollection |
static class |
JobServiceClient.ListBatchPredictionJobsPage |
static class |
JobServiceClient.ListBatchPredictionJobsPagedResponse |
static class |
JobServiceClient.ListCustomJobsFixedSizeCollection |
static class |
JobServiceClient.ListCustomJobsPage |
static class |
JobServiceClient.ListCustomJobsPagedResponse |
static class |
JobServiceClient.ListDataLabelingJobsFixedSizeCollection |
static class |
JobServiceClient.ListDataLabelingJobsPage |
static class |
JobServiceClient.ListDataLabelingJobsPagedResponse |
static class |
JobServiceClient.ListHyperparameterTuningJobsFixedSizeCollection |
static class |
JobServiceClient.ListHyperparameterTuningJobsPage |
static class |
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
JobServiceClient(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.
|
protected |
JobServiceClient(JobServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
cancelBatchPredictionJob(BatchPredictionJobName name)
Cancels a BatchPredictionJob.
|
void |
cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)
Cancels a BatchPredictionJob.
|
void |
cancelBatchPredictionJob(String name)
Cancels a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelBatchPredictionJobRequest,com.google.protobuf.Empty> |
cancelBatchPredictionJobCallable()
Cancels a BatchPredictionJob.
|
void |
cancelCustomJob(CancelCustomJobRequest request)
Cancels a CustomJob.
|
void |
cancelCustomJob(CustomJobName name)
Cancels a CustomJob.
|
void |
cancelCustomJob(String name)
Cancels a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelCustomJobRequest,com.google.protobuf.Empty> |
cancelCustomJobCallable()
Cancels a CustomJob.
|
void |
cancelDataLabelingJob(CancelDataLabelingJobRequest request)
Cancels a DataLabelingJob.
|
void |
cancelDataLabelingJob(DataLabelingJobName name)
Cancels a DataLabelingJob.
|
void |
cancelDataLabelingJob(String name)
Cancels a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelDataLabelingJobRequest,com.google.protobuf.Empty> |
cancelDataLabelingJobCallable()
Cancels a DataLabelingJob.
|
void |
cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)
Cancels a HyperparameterTuningJob.
|
void |
cancelHyperparameterTuningJob(HyperparameterTuningJobName name)
Cancels a HyperparameterTuningJob.
|
void |
cancelHyperparameterTuningJob(String name)
Cancels a HyperparameterTuningJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelHyperparameterTuningJobRequest,com.google.protobuf.Empty> |
cancelHyperparameterTuningJobCallable()
Cancels a HyperparameterTuningJob.
|
void |
close() |
static JobServiceClient |
create()
Constructs an instance of JobServiceClient with default settings.
|
static JobServiceClient |
create(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.
|
static JobServiceClient |
create(JobServiceStub stub)
Constructs an instance of JobServiceClient, using the given stub for making calls.
|
BatchPredictionJob |
createBatchPredictionJob(CreateBatchPredictionJobRequest request)
Creates a BatchPredictionJob.
|
BatchPredictionJob |
createBatchPredictionJob(LocationName parent,
BatchPredictionJob batchPredictionJob)
Creates a BatchPredictionJob.
|
BatchPredictionJob |
createBatchPredictionJob(String parent,
BatchPredictionJob batchPredictionJob)
Creates a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob> |
createBatchPredictionJobCallable()
Creates a BatchPredictionJob.
|
CustomJob |
createCustomJob(CreateCustomJobRequest request)
Creates a CustomJob.
|
CustomJob |
createCustomJob(LocationName parent,
CustomJob customJob)
Creates a CustomJob.
|
CustomJob |
createCustomJob(String parent,
CustomJob customJob)
Creates a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateCustomJobRequest,CustomJob> |
createCustomJobCallable()
Creates a CustomJob.
|
DataLabelingJob |
createDataLabelingJob(CreateDataLabelingJobRequest request)
Creates a DataLabelingJob.
|
DataLabelingJob |
createDataLabelingJob(LocationName parent,
DataLabelingJob dataLabelingJob)
Creates a DataLabelingJob.
|
DataLabelingJob |
createDataLabelingJob(String parent,
DataLabelingJob dataLabelingJob)
Creates a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob> |
createDataLabelingJobCallable()
Creates a DataLabelingJob.
|
HyperparameterTuningJob |
createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)
Creates a HyperparameterTuningJob
|
HyperparameterTuningJob |
createHyperparameterTuningJob(LocationName parent,
HyperparameterTuningJob hyperparameterTuningJob)
Creates a HyperparameterTuningJob
|
HyperparameterTuningJob |
createHyperparameterTuningJob(String parent,
HyperparameterTuningJob hyperparameterTuningJob)
Creates a HyperparameterTuningJob
|
com.google.api.gax.rpc.UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob> |
createHyperparameterTuningJobCallable()
Creates a HyperparameterTuningJob
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(BatchPredictionJobName name)
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(String name)
Deletes a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBatchPredictionJobRequest,com.google.longrunning.Operation> |
deleteBatchPredictionJobCallable()
Deletes a BatchPredictionJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteBatchPredictionJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobOperationCallable()
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(CustomJobName name)
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(DeleteCustomJobRequest request)
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(String name)
Deletes a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteCustomJobRequest,com.google.longrunning.Operation> |
deleteCustomJobCallable()
Deletes a CustomJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteCustomJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobOperationCallable()
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(DataLabelingJobName name)
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(String name)
Deletes a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDataLabelingJobRequest,com.google.longrunning.Operation> |
deleteDataLabelingJobCallable()
Deletes a DataLabelingJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteDataLabelingJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobOperationCallable()
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(String name)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteHyperparameterTuningJobRequest,com.google.longrunning.Operation> |
deleteHyperparameterTuningJobCallable()
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteHyperparameterTuningJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobOperationCallable()
Deletes a HyperparameterTuningJob.
|
BatchPredictionJob |
getBatchPredictionJob(BatchPredictionJobName name)
Gets a BatchPredictionJob
|
BatchPredictionJob |
getBatchPredictionJob(GetBatchPredictionJobRequest request)
Gets a BatchPredictionJob
|
BatchPredictionJob |
getBatchPredictionJob(String name)
Gets a BatchPredictionJob
|
com.google.api.gax.rpc.UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob> |
getBatchPredictionJobCallable()
Gets a BatchPredictionJob
|
CustomJob |
getCustomJob(CustomJobName name)
Gets a CustomJob.
|
CustomJob |
getCustomJob(GetCustomJobRequest request)
Gets a CustomJob.
|
CustomJob |
getCustomJob(String name)
Gets a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<GetCustomJobRequest,CustomJob> |
getCustomJobCallable()
Gets a CustomJob.
|
DataLabelingJob |
getDataLabelingJob(DataLabelingJobName name)
Gets a DataLabelingJob.
|
DataLabelingJob |
getDataLabelingJob(GetDataLabelingJobRequest request)
Gets a DataLabelingJob.
|
DataLabelingJob |
getDataLabelingJob(String name)
Gets a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<GetDataLabelingJobRequest,DataLabelingJob> |
getDataLabelingJobCallable()
Gets a DataLabelingJob.
|
HyperparameterTuningJob |
getHyperparameterTuningJob(GetHyperparameterTuningJobRequest request)
Gets a HyperparameterTuningJob
|
HyperparameterTuningJob |
getHyperparameterTuningJob(HyperparameterTuningJobName name)
Gets a HyperparameterTuningJob
|
HyperparameterTuningJob |
getHyperparameterTuningJob(String name)
Gets a HyperparameterTuningJob
|
com.google.api.gax.rpc.UnaryCallable<GetHyperparameterTuningJobRequest,HyperparameterTuningJob> |
getHyperparameterTuningJobCallable()
Gets a HyperparameterTuningJob
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
JobServiceSettings |
getSettings() |
JobServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(ListBatchPredictionJobsRequest request)
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(LocationName parent)
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(String parent)
Lists BatchPredictionJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,ListBatchPredictionJobsResponse> |
listBatchPredictionJobsCallable()
Lists BatchPredictionJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,JobServiceClient.ListBatchPredictionJobsPagedResponse> |
listBatchPredictionJobsPagedCallable()
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(ListCustomJobsRequest request)
Lists CustomJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(LocationName parent)
Lists CustomJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(String parent)
Lists CustomJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,ListCustomJobsResponse> |
listCustomJobsCallable()
Lists CustomJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,JobServiceClient.ListCustomJobsPagedResponse> |
listCustomJobsPagedCallable()
Lists CustomJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(ListDataLabelingJobsRequest request)
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(LocationName parent)
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(String parent)
Lists DataLabelingJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,ListDataLabelingJobsResponse> |
listDataLabelingJobsCallable()
Lists DataLabelingJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,JobServiceClient.ListDataLabelingJobsPagedResponse> |
listDataLabelingJobsPagedCallable()
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest request)
Lists HyperparameterTuningJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(LocationName parent)
Lists HyperparameterTuningJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(String parent)
Lists HyperparameterTuningJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,ListHyperparameterTuningJobsResponse> |
listHyperparameterTuningJobsCallable()
Lists HyperparameterTuningJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,JobServiceClient.ListHyperparameterTuningJobsPagedResponse> |
listHyperparameterTuningJobsPagedCallable()
Lists HyperparameterTuningJobs in a Location.
|
void |
shutdown() |
void |
shutdownNow() |
protected JobServiceClient(JobServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected JobServiceClient(JobServiceStub stub)
public static final JobServiceClient create() throws IOException
IOException
public static final JobServiceClient create(JobServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final JobServiceClient create(JobServiceStub stub)
public final JobServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public JobServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final CustomJob createCustomJob(LocationName parent, CustomJob customJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
CustomJob customJob = CustomJob.newBuilder().build();
CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
}
parent
- Required. The resource name of the Location to create the CustomJob in. Format:
`projects/{project}/locations/{location}`customJob
- Required. The CustomJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final CustomJob createCustomJob(String parent, CustomJob customJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
CustomJob customJob = CustomJob.newBuilder().build();
CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
}
parent
- Required. The resource name of the Location to create the CustomJob in. Format:
`projects/{project}/locations/{location}`customJob
- Required. The CustomJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final CustomJob createCustomJob(CreateCustomJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateCustomJobRequest request =
CreateCustomJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCustomJob(CustomJob.newBuilder().build())
.build();
CustomJob response = jobServiceClient.createCustomJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateCustomJobRequest,CustomJob> createCustomJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateCustomJobRequest request =
CreateCustomJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCustomJob(CustomJob.newBuilder().build())
.build();
ApiFuture<CustomJob> future = jobServiceClient.createCustomJobCallable().futureCall(request);
// Do something.
CustomJob response = future.get();
}
public final CustomJob getCustomJob(CustomJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
CustomJob response = jobServiceClient.getCustomJob(name);
}
name
- Required. The name of the CustomJob resource. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final CustomJob getCustomJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString();
CustomJob response = jobServiceClient.getCustomJob(name);
}
name
- Required. The name of the CustomJob resource. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final CustomJob getCustomJob(GetCustomJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetCustomJobRequest request =
GetCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
CustomJob response = jobServiceClient.getCustomJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCustomJobRequest,CustomJob> getCustomJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetCustomJobRequest request =
GetCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
ApiFuture<CustomJob> future = jobServiceClient.getCustomJobCallable().futureCall(request);
// Do something.
CustomJob response = future.get();
}
public final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(LocationName parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the CustomJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(String parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the CustomJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(ListCustomJobsRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (CustomJob element : jobServiceClient.listCustomJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,JobServiceClient.ListCustomJobsPagedResponse> listCustomJobsPagedCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CustomJob> future =
jobServiceClient.listCustomJobsPagedCallable().futureCall(request);
// Do something.
for (CustomJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,ListCustomJobsResponse> listCustomJobsCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListCustomJobsResponse response = jobServiceClient.listCustomJobsCallable().call(request);
for (CustomJob element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(CustomJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
jobServiceClient.deleteCustomJobAsync(name).get();
}
name
- Required. The name of the CustomJob resource to be deleted. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString();
jobServiceClient.deleteCustomJobAsync(name).get();
}
name
- Required. The name of the CustomJob resource to be deleted. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(DeleteCustomJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteCustomJobRequest request =
DeleteCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
jobServiceClient.deleteCustomJobAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteCustomJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobOperationCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteCustomJobRequest request =
DeleteCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
jobServiceClient.deleteCustomJobOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteCustomJobRequest,com.google.longrunning.Operation> deleteCustomJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteCustomJobRequest request =
DeleteCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
ApiFuture<Operation> future = jobServiceClient.deleteCustomJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void cancelCustomJob(CustomJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
jobServiceClient.cancelCustomJob(name);
}
name
- Required. The name of the CustomJob to cancel. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelCustomJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString();
jobServiceClient.cancelCustomJob(name);
}
name
- Required. The name of the CustomJob to cancel. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelCustomJob(CancelCustomJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelCustomJobRequest request =
CancelCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
jobServiceClient.cancelCustomJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelCustomJobRequest,com.google.protobuf.Empty> cancelCustomJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelCustomJobRequest request =
CancelCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
ApiFuture<Empty> future = jobServiceClient.cancelCustomJobCallable().futureCall(request);
// Do something.
future.get();
}
public final DataLabelingJob createDataLabelingJob(LocationName parent, DataLabelingJob dataLabelingJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob);
}
parent
- Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`dataLabelingJob
- Required. The DataLabelingJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingJob createDataLabelingJob(String parent, DataLabelingJob dataLabelingJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob);
}
parent
- Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`dataLabelingJob
- Required. The DataLabelingJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateDataLabelingJobRequest request =
CreateDataLabelingJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataLabelingJob(DataLabelingJob.newBuilder().build())
.build();
DataLabelingJob response = jobServiceClient.createDataLabelingJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob> createDataLabelingJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateDataLabelingJobRequest request =
CreateDataLabelingJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setDataLabelingJob(DataLabelingJob.newBuilder().build())
.build();
ApiFuture<DataLabelingJob> future =
jobServiceClient.createDataLabelingJobCallable().futureCall(request);
// Do something.
DataLabelingJob response = future.get();
}
public final DataLabelingJob getDataLabelingJob(DataLabelingJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DataLabelingJobName name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
DataLabelingJob response = jobServiceClient.getDataLabelingJob(name);
}
name
- Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingJob getDataLabelingJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
DataLabelingJob response = jobServiceClient.getDataLabelingJob(name);
}
name
- Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DataLabelingJob getDataLabelingJob(GetDataLabelingJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetDataLabelingJobRequest request =
GetDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
DataLabelingJob response = jobServiceClient.getDataLabelingJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataLabelingJobRequest,DataLabelingJob> getDataLabelingJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetDataLabelingJobRequest request =
GetDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
ApiFuture<DataLabelingJob> future =
jobServiceClient.getDataLabelingJobCallable().futureCall(request);
// Do something.
DataLabelingJob response = future.get();
}
public final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(LocationName parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(String parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(ListDataLabelingJobsRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,JobServiceClient.ListDataLabelingJobsPagedResponse> listDataLabelingJobsPagedCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<DataLabelingJob> future =
jobServiceClient.listDataLabelingJobsPagedCallable().futureCall(request);
// Do something.
for (DataLabelingJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,ListDataLabelingJobsResponse> listDataLabelingJobsCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListDataLabelingJobsResponse response =
jobServiceClient.listDataLabelingJobsCallable().call(request);
for (DataLabelingJob element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DataLabelingJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DataLabelingJobName name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
jobServiceClient.deleteDataLabelingJobAsync(name).get();
}
name
- Required. The name of the DataLabelingJob to be deleted. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
jobServiceClient.deleteDataLabelingJobAsync(name).get();
}
name
- Required. The name of the DataLabelingJob to be deleted. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteDataLabelingJobRequest request =
DeleteDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
jobServiceClient.deleteDataLabelingJobAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteDataLabelingJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobOperationCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteDataLabelingJobRequest request =
DeleteDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
jobServiceClient.deleteDataLabelingJobOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDataLabelingJobRequest,com.google.longrunning.Operation> deleteDataLabelingJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteDataLabelingJobRequest request =
DeleteDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
ApiFuture<Operation> future =
jobServiceClient.deleteDataLabelingJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void cancelDataLabelingJob(DataLabelingJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DataLabelingJobName name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
jobServiceClient.cancelDataLabelingJob(name);
}
name
- Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelDataLabelingJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
jobServiceClient.cancelDataLabelingJob(name);
}
name
- Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelDataLabelingJob(CancelDataLabelingJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelDataLabelingJobRequest request =
CancelDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
jobServiceClient.cancelDataLabelingJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelDataLabelingJobRequest,com.google.protobuf.Empty> cancelDataLabelingJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelDataLabelingJobRequest request =
CancelDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
jobServiceClient.cancelDataLabelingJobCallable().futureCall(request);
// Do something.
future.get();
}
public final HyperparameterTuningJob createHyperparameterTuningJob(LocationName parent, HyperparameterTuningJob hyperparameterTuningJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
HyperparameterTuningJob hyperparameterTuningJob =
HyperparameterTuningJob.newBuilder().build();
HyperparameterTuningJob response =
jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
}
parent
- Required. The resource name of the Location to create the HyperparameterTuningJob
in. Format: `projects/{project}/locations/{location}`hyperparameterTuningJob
- Required. The HyperparameterTuningJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final HyperparameterTuningJob createHyperparameterTuningJob(String parent, HyperparameterTuningJob hyperparameterTuningJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
HyperparameterTuningJob hyperparameterTuningJob =
HyperparameterTuningJob.newBuilder().build();
HyperparameterTuningJob response =
jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
}
parent
- Required. The resource name of the Location to create the HyperparameterTuningJob
in. Format: `projects/{project}/locations/{location}`hyperparameterTuningJob
- Required. The HyperparameterTuningJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final HyperparameterTuningJob createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateHyperparameterTuningJobRequest request =
CreateHyperparameterTuningJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build())
.build();
HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob> createHyperparameterTuningJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateHyperparameterTuningJobRequest request =
CreateHyperparameterTuningJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build())
.build();
ApiFuture<HyperparameterTuningJob> future =
jobServiceClient.createHyperparameterTuningJobCallable().futureCall(request);
// Do something.
HyperparameterTuningJob response = future.get();
}
public final HyperparameterTuningJob getHyperparameterTuningJob(HyperparameterTuningJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
HyperparameterTuningJobName name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
}
name
- Required. The name of the HyperparameterTuningJob resource. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final HyperparameterTuningJob getHyperparameterTuningJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString();
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
}
name
- Required. The name of the HyperparameterTuningJob resource. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final HyperparameterTuningJob getHyperparameterTuningJob(GetHyperparameterTuningJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetHyperparameterTuningJobRequest request =
GetHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetHyperparameterTuningJobRequest,HyperparameterTuningJob> getHyperparameterTuningJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetHyperparameterTuningJobRequest request =
GetHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
ApiFuture<HyperparameterTuningJob> future =
jobServiceClient.getHyperparameterTuningJobCallable().futureCall(request);
// Do something.
HyperparameterTuningJob response = future.get();
}
public final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(LocationName parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the HyperparameterTuningJobs
from. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(String parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the HyperparameterTuningJobs
from. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,JobServiceClient.ListHyperparameterTuningJobsPagedResponse> listHyperparameterTuningJobsPagedCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<HyperparameterTuningJob> future =
jobServiceClient.listHyperparameterTuningJobsPagedCallable().futureCall(request);
// Do something.
for (HyperparameterTuningJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,ListHyperparameterTuningJobsResponse> listHyperparameterTuningJobsCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListHyperparameterTuningJobsResponse response =
jobServiceClient.listHyperparameterTuningJobsCallable().call(request);
for (HyperparameterTuningJob element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
HyperparameterTuningJobName name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
}
name
- Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString();
jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
}
name
- Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteHyperparameterTuningJobRequest request =
DeleteHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
jobServiceClient.deleteHyperparameterTuningJobAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteHyperparameterTuningJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobOperationCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteHyperparameterTuningJobRequest request =
DeleteHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
jobServiceClient.deleteHyperparameterTuningJobOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteHyperparameterTuningJobRequest,com.google.longrunning.Operation> deleteHyperparameterTuningJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteHyperparameterTuningJobRequest request =
DeleteHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
ApiFuture<Operation> future =
jobServiceClient.deleteHyperparameterTuningJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
HyperparameterTuningJobName name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
jobServiceClient.cancelHyperparameterTuningJob(name);
}
name
- Required. The name of the HyperparameterTuningJob to cancel. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelHyperparameterTuningJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString();
jobServiceClient.cancelHyperparameterTuningJob(name);
}
name
- Required. The name of the HyperparameterTuningJob to cancel. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelHyperparameterTuningJobRequest request =
CancelHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
jobServiceClient.cancelHyperparameterTuningJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelHyperparameterTuningJobRequest,com.google.protobuf.Empty> cancelHyperparameterTuningJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelHyperparameterTuningJobRequest request =
CancelHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
jobServiceClient.cancelHyperparameterTuningJobCallable().futureCall(request);
// Do something.
future.get();
}
public final BatchPredictionJob createBatchPredictionJob(LocationName parent, BatchPredictionJob batchPredictionJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
BatchPredictionJob response =
jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
}
parent
- Required. The resource name of the Location to create the BatchPredictionJob in.
Format: `projects/{project}/locations/{location}`batchPredictionJob
- Required. The BatchPredictionJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final BatchPredictionJob createBatchPredictionJob(String parent, BatchPredictionJob batchPredictionJob)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
BatchPredictionJob response =
jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
}
parent
- Required. The resource name of the Location to create the BatchPredictionJob in.
Format: `projects/{project}/locations/{location}`batchPredictionJob
- Required. The BatchPredictionJob to create.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final BatchPredictionJob createBatchPredictionJob(CreateBatchPredictionJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateBatchPredictionJobRequest request =
CreateBatchPredictionJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setBatchPredictionJob(BatchPredictionJob.newBuilder().build())
.build();
BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob> createBatchPredictionJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CreateBatchPredictionJobRequest request =
CreateBatchPredictionJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setBatchPredictionJob(BatchPredictionJob.newBuilder().build())
.build();
ApiFuture<BatchPredictionJob> future =
jobServiceClient.createBatchPredictionJobCallable().futureCall(request);
// Do something.
BatchPredictionJob response = future.get();
}
public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
BatchPredictionJobName name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
}
name
- Required. The name of the BatchPredictionJob resource. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final BatchPredictionJob getBatchPredictionJob(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
}
name
- Required. The name of the BatchPredictionJob resource. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetBatchPredictionJobRequest request =
GetBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob> getBatchPredictionJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
GetBatchPredictionJobRequest request =
GetBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
ApiFuture<BatchPredictionJob> future =
jobServiceClient.getBatchPredictionJobCallable().futureCall(request);
// Do something.
BatchPredictionJob response = future.get();
}
public final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(LocationName parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the BatchPredictionJobs from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(String parent)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The resource name of the Location to list the BatchPredictionJobs from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(ListBatchPredictionJobsRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,JobServiceClient.ListBatchPredictionJobsPagedResponse> listBatchPredictionJobsPagedCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<BatchPredictionJob> future =
jobServiceClient.listBatchPredictionJobsPagedCallable().futureCall(request);
// Do something.
for (BatchPredictionJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,ListBatchPredictionJobsResponse> listBatchPredictionJobsCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListBatchPredictionJobsResponse response =
jobServiceClient.listBatchPredictionJobsCallable().call(request);
for (BatchPredictionJob element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(BatchPredictionJobName name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
BatchPredictionJobName name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
jobServiceClient.deleteBatchPredictionJobAsync(name).get();
}
name
- Required. The name of the BatchPredictionJob resource to be deleted. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(String name)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
jobServiceClient.deleteBatchPredictionJobAsync(name).get();
}
name
- Required. The name of the BatchPredictionJob resource to be deleted. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteBatchPredictionJobRequest request =
DeleteBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
jobServiceClient.deleteBatchPredictionJobAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteBatchPredictionJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobOperationCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteBatchPredictionJobRequest request =
DeleteBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
jobServiceClient.deleteBatchPredictionJobOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteBatchPredictionJobRequest,com.google.longrunning.Operation> deleteBatchPredictionJobCallable()
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
DeleteBatchPredictionJobRequest request =
DeleteBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
ApiFuture<Operation> future =
jobServiceClient.deleteBatchPredictionJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void cancelBatchPredictionJob(BatchPredictionJobName name)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already outputted by the job are not deleted.
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
BatchPredictionJobName name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
jobServiceClient.cancelBatchPredictionJob(name);
}
name
- Required. The name of the BatchPredictionJob to cancel. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelBatchPredictionJob(String name)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already outputted by the job are not deleted.
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
String name =
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
jobServiceClient.cancelBatchPredictionJob(name);
}
name
- Required. The name of the BatchPredictionJob to cancel. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException
- if the remote call failspublic final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already outputted by the job are not deleted.
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelBatchPredictionJobRequest request =
CancelBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
jobServiceClient.cancelBatchPredictionJob(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelBatchPredictionJobRequest,com.google.protobuf.Empty> cancelBatchPredictionJobCallable()
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to `CANCELLED`. Any files already outputted by the job are not deleted.
Sample code:
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
CancelBatchPredictionJobRequest request =
CancelBatchPredictionJobRequest.newBuilder()
.setName(
BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
jobServiceClient.cancelBatchPredictionJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2021 Google LLC. All rights reserved.