Class JobServiceClient (3.28.0)

public class JobServiceClient implements BackgroundResource

Service Description: A service for creating and managing Vertex AI's jobs.

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 (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:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns 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 JobServiceSettings 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
 JobServiceSettings jobServiceSettings =
     JobServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings);
 

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
 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.

Inheritance

java.lang.Object > JobServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final JobServiceClient create()

Constructs an instance of JobServiceClient with default settings.

Returns
Type Description
JobServiceClient
Exceptions
Type Description
IOException

create(JobServiceSettings settings)

public static final JobServiceClient create(JobServiceSettings settings)

Constructs an instance of JobServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings JobServiceSettings
Returns
Type Description
JobServiceClient
Exceptions
Type Description
IOException

create(JobServiceStub stub)

public static final JobServiceClient create(JobServiceStub stub)

Constructs an instance of JobServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(JobServiceSettings).

Parameter
Name Description
stub JobServiceStub
Returns
Type Description
JobServiceClient

Constructors

JobServiceClient(JobServiceSettings settings)

protected JobServiceClient(JobServiceSettings settings)

Constructs an instance of JobServiceClient, 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.

Parameter
Name Description
settings JobServiceSettings

JobServiceClient(JobServiceStub stub)

protected JobServiceClient(JobServiceStub stub)
Parameter
Name Description
stub JobServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

cancelBatchPredictionJob(BatchPredictionJobName name)

public final void cancelBatchPredictionJob(BatchPredictionJobName name)

Cancels a BatchPredictionJob.

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 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 is set to CANCELLED. Any files already outputted by the job are not deleted.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   BatchPredictionJobName name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
   jobServiceClient.cancelBatchPredictionJob(name);
 }
 
Parameter
Name Description
name BatchPredictionJobName

Required. The name of the BatchPredictionJob to cancel. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)

public final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)

Cancels a BatchPredictionJob.

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 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 is set to CANCELLED. Any files already outputted by the job are not deleted.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelBatchPredictionJobRequest request =
       CancelBatchPredictionJobRequest.newBuilder()
           .setName(
               BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
                   .toString())
           .build();
   jobServiceClient.cancelBatchPredictionJob(request);
 }
 
Parameter
Name Description
request CancelBatchPredictionJobRequest

The request object containing all of the parameters for the API call.

cancelBatchPredictionJob(String name)

public final void cancelBatchPredictionJob(String name)

Cancels a BatchPredictionJob.

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 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 is set to CANCELLED. Any files already outputted by the job are not deleted.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
   jobServiceClient.cancelBatchPredictionJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the BatchPredictionJob to cancel. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

cancelBatchPredictionJobCallable()

public final UnaryCallable<CancelBatchPredictionJobRequest,Empty> cancelBatchPredictionJobCallable()

Cancels a BatchPredictionJob.

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 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 is set to CANCELLED. Any files already outputted by the job are not deleted.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CancelBatchPredictionJobRequest,Empty>

cancelCustomJob(CancelCustomJobRequest request)

public final void cancelCustomJob(CancelCustomJobRequest request)

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelCustomJobRequest request =
       CancelCustomJobRequest.newBuilder()
           .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
           .build();
   jobServiceClient.cancelCustomJob(request);
 }
 
Parameter
Name Description
request CancelCustomJobRequest

The request object containing all of the parameters for the API call.

cancelCustomJob(CustomJobName name)

public final void cancelCustomJob(CustomJobName name)

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
   jobServiceClient.cancelCustomJob(name);
 }
 
Parameter
Name Description
name CustomJobName

Required. The name of the CustomJob to cancel. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

cancelCustomJob(String name)

public final void cancelCustomJob(String name)

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString();
   jobServiceClient.cancelCustomJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the CustomJob to cancel. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

cancelCustomJobCallable()

public final UnaryCallable<CancelCustomJobRequest,Empty> cancelCustomJobCallable()

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CancelCustomJobRequest,Empty>

cancelDataLabelingJob(CancelDataLabelingJobRequest request)

public final void cancelDataLabelingJob(CancelDataLabelingJobRequest request)

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelDataLabelingJobRequest request =
       CancelDataLabelingJobRequest.newBuilder()
           .setName(
               DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
                   .toString())
           .build();
   jobServiceClient.cancelDataLabelingJob(request);
 }
 
Parameter
Name Description
request CancelDataLabelingJobRequest

The request object containing all of the parameters for the API call.

cancelDataLabelingJob(DataLabelingJobName name)

public final void cancelDataLabelingJob(DataLabelingJobName name)

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DataLabelingJobName name =
       DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
   jobServiceClient.cancelDataLabelingJob(name);
 }
 
Parameter
Name Description
name DataLabelingJobName

Required. The name of the DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

cancelDataLabelingJob(String name)

public final void cancelDataLabelingJob(String name)

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
   jobServiceClient.cancelDataLabelingJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the DataLabelingJob. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

cancelDataLabelingJobCallable()

public final UnaryCallable<CancelDataLabelingJobRequest,Empty> cancelDataLabelingJobCallable()

Cancels a DataLabelingJob. Success of cancellation is not guaranteed.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CancelDataLabelingJobRequest,Empty>

cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)

public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)

Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelHyperparameterTuningJobRequest request =
       CancelHyperparameterTuningJobRequest.newBuilder()
           .setName(
               HyperparameterTuningJobName.of(
                       "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
                   .toString())
           .build();
   jobServiceClient.cancelHyperparameterTuningJob(request);
 }
 
Parameter
Name Description
request CancelHyperparameterTuningJobRequest

The request object containing all of the parameters for the API call.

cancelHyperparameterTuningJob(HyperparameterTuningJobName name)

public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name)

Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   HyperparameterTuningJobName name =
       HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
   jobServiceClient.cancelHyperparameterTuningJob(name);
 }
 
Parameter
Name Description
name HyperparameterTuningJobName

Required. The name of the HyperparameterTuningJob to cancel. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

cancelHyperparameterTuningJob(String name)

public final void cancelHyperparameterTuningJob(String name)

Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
           .toString();
   jobServiceClient.cancelHyperparameterTuningJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the HyperparameterTuningJob to cancel. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

cancelHyperparameterTuningJobCallable()

public final UnaryCallable<CancelHyperparameterTuningJobRequest,Empty> cancelHyperparameterTuningJobCallable()

Cancels a HyperparameterTuningJob. Starts asynchronous cancellation on the HyperparameterTuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetHyperparameterTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the HyperparameterTuningJob is not deleted; instead it becomes a job with a HyperparameterTuningJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and HyperparameterTuningJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CancelHyperparameterTuningJobRequest,Empty>

cancelNasJob(CancelNasJobRequest request)

public final void cancelNasJob(CancelNasJobRequest request)

Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelNasJobRequest request =
       CancelNasJobRequest.newBuilder()
           .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
           .build();
   jobServiceClient.cancelNasJob(request);
 }
 
Parameter
Name Description
request CancelNasJobRequest

The request object containing all of the parameters for the API call.

cancelNasJob(NasJobName name)

public final void cancelNasJob(NasJobName name)

Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]");
   jobServiceClient.cancelNasJob(name);
 }
 
Parameter
Name Description
name NasJobName

Required. The name of the NasJob to cancel. Format: projects/{project}/locations/{location}/nasJobs/{nas_job}

cancelNasJob(String name)

public final void cancelNasJob(String name)

Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString();
   jobServiceClient.cancelNasJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the NasJob to cancel. Format: projects/{project}/locations/{location}/nasJobs/{nas_job}

cancelNasJobCallable()

public final UnaryCallable<CancelNasJobRequest,Empty> cancelNasJobCallable()

Cancels a NasJob. Starts asynchronous cancellation on the NasJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetNasJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the NasJob is not deleted; instead it becomes a job with a NasJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and NasJob.state is set to CANCELLED.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CancelNasJobRequest request =
       CancelNasJobRequest.newBuilder()
           .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
           .build();
   ApiFuture<Empty> future = jobServiceClient.cancelNasJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<CancelNasJobRequest,Empty>

close()

public final void close()

createBatchPredictionJob(CreateBatchPredictionJobRequest request)

public final BatchPredictionJob createBatchPredictionJob(CreateBatchPredictionJobRequest request)

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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);
 }
 
Parameter
Name Description
request CreateBatchPredictionJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchPredictionJob

createBatchPredictionJob(LocationName parent, BatchPredictionJob batchPredictionJob)

public final BatchPredictionJob createBatchPredictionJob(LocationName parent, BatchPredictionJob batchPredictionJob)

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
   BatchPredictionJob response =
       jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to create the BatchPredictionJob in. Format: projects/{project}/locations/{location}

batchPredictionJob BatchPredictionJob

Required. The BatchPredictionJob to create.

Returns
Type Description
BatchPredictionJob

createBatchPredictionJob(String parent, BatchPredictionJob batchPredictionJob)

public final BatchPredictionJob createBatchPredictionJob(String parent, BatchPredictionJob batchPredictionJob)

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
   BatchPredictionJob response =
       jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to create the BatchPredictionJob in. Format: projects/{project}/locations/{location}

batchPredictionJob BatchPredictionJob

Required. The BatchPredictionJob to create.

Returns
Type Description
BatchPredictionJob

createBatchPredictionJobCallable()

public final UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob> createBatchPredictionJobCallable()

Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob>

createCustomJob(CreateCustomJobRequest request)

public final CustomJob createCustomJob(CreateCustomJobRequest request)

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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);
 }
 
Parameter
Name Description
request CreateCustomJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CustomJob

createCustomJob(LocationName parent, CustomJob customJob)

public final CustomJob createCustomJob(LocationName parent, CustomJob customJob)

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   CustomJob customJob = CustomJob.newBuilder().build();
   CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to create the CustomJob in. Format: projects/{project}/locations/{location}

customJob CustomJob

Required. The CustomJob to create.

Returns
Type Description
CustomJob

createCustomJob(String parent, CustomJob customJob)

public final CustomJob createCustomJob(String parent, CustomJob customJob)

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   CustomJob customJob = CustomJob.newBuilder().build();
   CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to create the CustomJob in. Format: projects/{project}/locations/{location}

customJob CustomJob

Required. The CustomJob to create.

Returns
Type Description
CustomJob

createCustomJobCallable()

public final UnaryCallable<CreateCustomJobRequest,CustomJob> createCustomJobCallable()

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CreateCustomJobRequest,CustomJob>

createDataLabelingJob(CreateDataLabelingJobRequest request)

public final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest request)

Creates a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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);
 }
 
Parameter
Name Description
request CreateDataLabelingJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
DataLabelingJob

createDataLabelingJob(LocationName parent, DataLabelingJob dataLabelingJob)

public final DataLabelingJob createDataLabelingJob(LocationName parent, DataLabelingJob dataLabelingJob)

Creates a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
   DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The parent of the DataLabelingJob. Format: projects/{project}/locations/{location}

dataLabelingJob DataLabelingJob

Required. The DataLabelingJob to create.

Returns
Type Description
DataLabelingJob

createDataLabelingJob(String parent, DataLabelingJob dataLabelingJob)

public final DataLabelingJob createDataLabelingJob(String parent, DataLabelingJob dataLabelingJob)

Creates a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build();
   DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob);
 }
 
Parameters
Name Description
parent String

Required. The parent of the DataLabelingJob. Format: projects/{project}/locations/{location}

dataLabelingJob DataLabelingJob

Required. The DataLabelingJob to create.

Returns
Type Description
DataLabelingJob

createDataLabelingJobCallable()

public final UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob> createDataLabelingJobCallable()

Creates a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob>

createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)

public final HyperparameterTuningJob createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)

Creates a HyperparameterTuningJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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);
 }
 
Parameter
Name Description
request CreateHyperparameterTuningJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
HyperparameterTuningJob

createHyperparameterTuningJob(LocationName parent, HyperparameterTuningJob hyperparameterTuningJob)

public final HyperparameterTuningJob createHyperparameterTuningJob(LocationName parent, HyperparameterTuningJob hyperparameterTuningJob)

Creates a HyperparameterTuningJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   HyperparameterTuningJob hyperparameterTuningJob =
       HyperparameterTuningJob.newBuilder().build();
   HyperparameterTuningJob response =
       jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to create the HyperparameterTuningJob in. Format: projects/{project}/locations/{location}

hyperparameterTuningJob HyperparameterTuningJob

Required. The HyperparameterTuningJob to create.

Returns
Type Description
HyperparameterTuningJob

createHyperparameterTuningJob(String parent, HyperparameterTuningJob hyperparameterTuningJob)

public final HyperparameterTuningJob createHyperparameterTuningJob(String parent, HyperparameterTuningJob hyperparameterTuningJob)

Creates a HyperparameterTuningJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   HyperparameterTuningJob hyperparameterTuningJob =
       HyperparameterTuningJob.newBuilder().build();
   HyperparameterTuningJob response =
       jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to create the HyperparameterTuningJob in. Format: projects/{project}/locations/{location}

hyperparameterTuningJob HyperparameterTuningJob

Required. The HyperparameterTuningJob to create.

Returns
Type Description
HyperparameterTuningJob

createHyperparameterTuningJobCallable()

public final UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob> createHyperparameterTuningJobCallable()

Creates a HyperparameterTuningJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob>

createModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest request)

public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest request)

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CreateModelDeploymentMonitoringJobRequest request =
       CreateModelDeploymentMonitoringJobRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build())
           .build();
   ModelDeploymentMonitoringJob response =
       jobServiceClient.createModelDeploymentMonitoringJob(request);
 }
 
Parameter
Name Description
request CreateModelDeploymentMonitoringJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ModelDeploymentMonitoringJob

createModelDeploymentMonitoringJob(LocationName parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)

public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(LocationName parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   ModelDeploymentMonitoringJob modelDeploymentMonitoringJob =
       ModelDeploymentMonitoringJob.newBuilder().build();
   ModelDeploymentMonitoringJob response =
       jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The parent of the ModelDeploymentMonitoringJob. Format: projects/{project}/locations/{location}

modelDeploymentMonitoringJob ModelDeploymentMonitoringJob

Required. The ModelDeploymentMonitoringJob to create

Returns
Type Description
ModelDeploymentMonitoringJob

createModelDeploymentMonitoringJob(String parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)

public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(String parent, ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   ModelDeploymentMonitoringJob modelDeploymentMonitoringJob =
       ModelDeploymentMonitoringJob.newBuilder().build();
   ModelDeploymentMonitoringJob response =
       jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob);
 }
 
Parameters
Name Description
parent String

Required. The parent of the ModelDeploymentMonitoringJob. Format: projects/{project}/locations/{location}

modelDeploymentMonitoringJob ModelDeploymentMonitoringJob

Required. The ModelDeploymentMonitoringJob to create

Returns
Type Description
ModelDeploymentMonitoringJob

createModelDeploymentMonitoringJobCallable()

public final UnaryCallable<CreateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob> createModelDeploymentMonitoringJobCallable()

Creates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CreateModelDeploymentMonitoringJobRequest request =
       CreateModelDeploymentMonitoringJobRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build())
           .build();
   ApiFuture<ModelDeploymentMonitoringJob> future =
       jobServiceClient.createModelDeploymentMonitoringJobCallable().futureCall(request);
   // Do something.
   ModelDeploymentMonitoringJob response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob>

createNasJob(CreateNasJobRequest request)

public final NasJob createNasJob(CreateNasJobRequest request)

Creates a NasJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CreateNasJobRequest request =
       CreateNasJobRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNasJob(NasJob.newBuilder().build())
           .build();
   NasJob response = jobServiceClient.createNasJob(request);
 }
 
Parameter
Name Description
request CreateNasJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
NasJob

createNasJob(LocationName parent, NasJob nasJob)

public final NasJob createNasJob(LocationName parent, NasJob nasJob)

Creates a NasJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   NasJob nasJob = NasJob.newBuilder().build();
   NasJob response = jobServiceClient.createNasJob(parent, nasJob);
 }
 
Parameters
Name Description
parent LocationName

Required. The resource name of the Location to create the NasJob in. Format: projects/{project}/locations/{location}

nasJob NasJob

Required. The NasJob to create.

Returns
Type Description
NasJob

createNasJob(String parent, NasJob nasJob)

public final NasJob createNasJob(String parent, NasJob nasJob)

Creates a NasJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   NasJob nasJob = NasJob.newBuilder().build();
   NasJob response = jobServiceClient.createNasJob(parent, nasJob);
 }
 
Parameters
Name Description
parent String

Required. The resource name of the Location to create the NasJob in. Format: projects/{project}/locations/{location}

nasJob NasJob

Required. The NasJob to create.

Returns
Type Description
NasJob

createNasJobCallable()

public final UnaryCallable<CreateNasJobRequest,NasJob> createNasJobCallable()

Creates a NasJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CreateNasJobRequest request =
       CreateNasJobRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setNasJob(NasJob.newBuilder().build())
           .build();
   ApiFuture<NasJob> future = jobServiceClient.createNasJobCallable().futureCall(request);
   // Do something.
   NasJob response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateNasJobRequest,NasJob>

deleteBatchPredictionJobAsync(BatchPredictionJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(BatchPredictionJobName name)

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   BatchPredictionJobName name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
   jobServiceClient.deleteBatchPredictionJobAsync(name).get();
 }
 
Parameter
Name Description
name BatchPredictionJobName

Required. The name of the BatchPredictionJob resource to be deleted. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteBatchPredictionJobRequest request =
       DeleteBatchPredictionJobRequest.newBuilder()
           .setName(
               BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
                   .toString())
           .build();
   jobServiceClient.deleteBatchPredictionJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteBatchPredictionJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteBatchPredictionJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(String name)

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
   jobServiceClient.deleteBatchPredictionJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the BatchPredictionJob resource to be deleted. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteBatchPredictionJobCallable()

public final UnaryCallable<DeleteBatchPredictionJobRequest,Operation> deleteBatchPredictionJobCallable()

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteBatchPredictionJobRequest,Operation>

deleteBatchPredictionJobOperationCallable()

public final OperationCallable<DeleteBatchPredictionJobRequest,Empty,DeleteOperationMetadata> deleteBatchPredictionJobOperationCallable()

Deletes a BatchPredictionJob. Can only be called on jobs that already finished.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
OperationCallable<DeleteBatchPredictionJobRequest,Empty,DeleteOperationMetadata>

deleteCustomJobAsync(CustomJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteCustomJobAsync(CustomJobName name)

Deletes a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
   jobServiceClient.deleteCustomJobAsync(name).get();
 }
 
Parameter
Name Description
name CustomJobName

Required. The name of the CustomJob resource to be deleted. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteCustomJobAsync(DeleteCustomJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteCustomJobAsync(DeleteCustomJobRequest request)

Deletes a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteCustomJobRequest request =
       DeleteCustomJobRequest.newBuilder()
           .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
           .build();
   jobServiceClient.deleteCustomJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteCustomJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteCustomJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteCustomJobAsync(String name)

Deletes a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString();
   jobServiceClient.deleteCustomJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the CustomJob resource to be deleted. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteCustomJobCallable()

public final UnaryCallable<DeleteCustomJobRequest,Operation> deleteCustomJobCallable()

Deletes a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteCustomJobRequest,Operation>

deleteCustomJobOperationCallable()

public final OperationCallable<DeleteCustomJobRequest,Empty,DeleteOperationMetadata> deleteCustomJobOperationCallable()

Deletes a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
OperationCallable<DeleteCustomJobRequest,Empty,DeleteOperationMetadata>

deleteDataLabelingJobAsync(DataLabelingJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DataLabelingJobName name)

Deletes a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DataLabelingJobName name =
       DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
   jobServiceClient.deleteDataLabelingJobAsync(name).get();
 }
 
Parameter
Name Description
name DataLabelingJobName

Required. The name of the DataLabelingJob to be deleted. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)

Deletes a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteDataLabelingJobRequest request =
       DeleteDataLabelingJobRequest.newBuilder()
           .setName(
               DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
                   .toString())
           .build();
   jobServiceClient.deleteDataLabelingJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteDataLabelingJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteDataLabelingJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(String name)

Deletes a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
   jobServiceClient.deleteDataLabelingJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the DataLabelingJob to be deleted. Format: projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteDataLabelingJobCallable()

public final UnaryCallable<DeleteDataLabelingJobRequest,Operation> deleteDataLabelingJobCallable()

Deletes a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteDataLabelingJobRequest,Operation>

deleteDataLabelingJobOperationCallable()

public final OperationCallable<DeleteDataLabelingJobRequest,Empty,DeleteOperationMetadata> deleteDataLabelingJobOperationCallable()

Deletes a DataLabelingJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
OperationCallable<DeleteDataLabelingJobRequest,Empty,DeleteOperationMetadata>

deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)

Deletes a HyperparameterTuningJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteHyperparameterTuningJobRequest request =
       DeleteHyperparameterTuningJobRequest.newBuilder()
           .setName(
               HyperparameterTuningJobName.of(
                       "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
                   .toString())
           .build();
   jobServiceClient.deleteHyperparameterTuningJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteHyperparameterTuningJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)

Deletes a HyperparameterTuningJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   HyperparameterTuningJobName name =
       HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
   jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
 }
 
Parameter
Name Description
name HyperparameterTuningJobName

Required. The name of the HyperparameterTuningJob resource to be deleted. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteHyperparameterTuningJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(String name)

Deletes a HyperparameterTuningJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
           .toString();
   jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the HyperparameterTuningJob resource to be deleted. Format: projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteHyperparameterTuningJobCallable()

public final UnaryCallable<DeleteHyperparameterTuningJobRequest,Operation> deleteHyperparameterTuningJobCallable()

Deletes a HyperparameterTuningJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<DeleteHyperparameterTuningJobRequest,Operation>

deleteHyperparameterTuningJobOperationCallable()

public final OperationCallable<DeleteHyperparameterTuningJobRequest,Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobOperationCallable()

Deletes a HyperparameterTuningJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
OperationCallable<DeleteHyperparameterTuningJobRequest,Empty,DeleteOperationMetadata>

deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request)

Deletes a ModelDeploymentMonitoringJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteModelDeploymentMonitoringJobRequest request =
       DeleteModelDeploymentMonitoringJobRequest.newBuilder()
           .setName(
               ModelDeploymentMonitoringJobName.of(
                       "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
                   .toString())
           .build();
   jobServiceClient.deleteModelDeploymentMonitoringJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteModelDeploymentMonitoringJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name)

Deletes a ModelDeploymentMonitoringJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   ModelDeploymentMonitoringJobName name =
       ModelDeploymentMonitoringJobName.of(
           "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]");
   jobServiceClient.deleteModelDeploymentMonitoringJobAsync(name).get();
 }
 
Parameter
Name Description
name ModelDeploymentMonitoringJobName

Required. The resource name of the model monitoring job to delete. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteModelDeploymentMonitoringJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(String name)

Deletes a ModelDeploymentMonitoringJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       ModelDeploymentMonitoringJobName.of(
               "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
           .toString();
   jobServiceClient.deleteModelDeploymentMonitoringJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the model monitoring job to delete. Format: projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteModelDeploymentMonitoringJobCallable()

public final UnaryCallable<DeleteModelDeploymentMonitoringJobRequest,Operation> deleteModelDeploymentMonitoringJobCallable()

Deletes a ModelDeploymentMonitoringJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteModelDeploymentMonitoringJobRequest request =
       DeleteModelDeploymentMonitoringJobRequest.newBuilder()
           .setName(
               ModelDeploymentMonitoringJobName.of(
                       "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       jobServiceClient.deleteModelDeploymentMonitoringJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteModelDeploymentMonitoringJobRequest,Operation>

deleteModelDeploymentMonitoringJobOperationCallable()

public final OperationCallable<DeleteModelDeploymentMonitoringJobRequest,Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobOperationCallable()

Deletes a ModelDeploymentMonitoringJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteModelDeploymentMonitoringJobRequest request =
       DeleteModelDeploymentMonitoringJobRequest.newBuilder()
           .setName(
               ModelDeploymentMonitoringJobName.of(
                       "[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       jobServiceClient
           .deleteModelDeploymentMonitoringJobOperationCallable()
           .futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteModelDeploymentMonitoringJobRequest,Empty,DeleteOperationMetadata>

deleteNasJobAsync(DeleteNasJobRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNasJobAsync(DeleteNasJobRequest request)

Deletes a NasJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteNasJobRequest request =
       DeleteNasJobRequest.newBuilder()
           .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
           .build();
   jobServiceClient.deleteNasJobAsync(request).get();
 }
 
Parameter
Name Description
request DeleteNasJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNasJobAsync(NasJobName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNasJobAsync(NasJobName name)

Deletes a NasJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   NasJobName name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]");
   jobServiceClient.deleteNasJobAsync(name).get();
 }
 
Parameter
Name Description
name NasJobName

Required. The name of the NasJob resource to be deleted. Format: projects/{project}/locations/{location}/nasJobs/{nas_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNasJobAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteNasJobAsync(String name)

Deletes a NasJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString();
   jobServiceClient.deleteNasJobAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the NasJob resource to be deleted. Format: projects/{project}/locations/{location}/nasJobs/{nas_job}

Returns
Type Description
OperationFuture<Empty,DeleteOperationMetadata>

deleteNasJobCallable()

public final UnaryCallable<DeleteNasJobRequest,Operation> deleteNasJobCallable()

Deletes a NasJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteNasJobRequest request =
       DeleteNasJobRequest.newBuilder()
           .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
           .build();
   ApiFuture<Operation> future = jobServiceClient.deleteNasJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteNasJobRequest,Operation>

deleteNasJobOperationCallable()

public final OperationCallable<DeleteNasJobRequest,Empty,DeleteOperationMetadata> deleteNasJobOperationCallable()

Deletes a NasJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   DeleteNasJobRequest request =
       DeleteNasJobRequest.newBuilder()
           .setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       jobServiceClient.deleteNasJobOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteNasJobRequest,Empty,DeleteOperationMetadata>

getBatchPredictionJob(BatchPredictionJobName name)

public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName name)

Gets a BatchPredictionJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   BatchPredictionJobName name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
   BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
 }
 
Parameter
Name Description
name BatchPredictionJobName

Required. The name of the BatchPredictionJob resource. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Returns
Type Description
BatchPredictionJob

getBatchPredictionJob(GetBatchPredictionJobRequest request)

public final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobRequest request)

Gets a BatchPredictionJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   GetBatchPredictionJobRequest request =
       GetBatchPredictionJobRequest.newBuilder()
           .setName(
               BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
                   .toString())
           .build();
   BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(request);
 }
 
Parameter
Name Description
request GetBatchPredictionJobRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchPredictionJob

getBatchPredictionJob(String name)

public final BatchPredictionJob getBatchPredictionJob(String name)

Gets a BatchPredictionJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   String name =
       BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
   BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
 }
 
Parameter
Name Description
name String

Required. The name of the BatchPredictionJob resource. Format: projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}

Returns
Type Description
BatchPredictionJob

getBatchPredictionJobCallable()

public final UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob> getBatchPredictionJobCallable()

Gets a BatchPredictionJob

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 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();
 }
 
Returns
Type Description
UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob>

getCustomJob(CustomJobName name)

public final CustomJob getCustomJob(CustomJobName name)

Gets a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
   CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]");
   CustomJob response = jobServiceClient.getCustomJob(name);
 }
 
Parameter
Name Description
name CustomJobName

Required. The name of the CustomJob resource. Format: projects/{project}/locations/{location}/customJobs/{custom_job}

Returns
Type Description
CustomJob

getCustomJob(GetCustomJobRequest request)

public final CustomJob getCustomJob(GetCustomJobRequest request)

Gets a CustomJob.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (JobServiceClient jobServiceClient = JobServiceClient.create())