@BetaApi @Generated(value="by gapic-generator-java") public class JobServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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:
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.
| Modifier | Constructor and Description |
|---|---|
protected |
JobServiceClient(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.
|
protected |
JobServiceClient(JobServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
cancelBatchPredictionJob(BatchPredictionJobName name)
Cancels a BatchPredictionJob.
|
void |
cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)
Cancels a BatchPredictionJob.
|
void |
cancelBatchPredictionJob(String name)
Cancels a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelBatchPredictionJobRequest,com.google.protobuf.Empty> |
cancelBatchPredictionJobCallable()
Cancels a BatchPredictionJob.
|
void |
cancelCustomJob(CancelCustomJobRequest request)
Cancels a CustomJob.
|
void |
cancelCustomJob(CustomJobName name)
Cancels a CustomJob.
|
void |
cancelCustomJob(String name)
Cancels a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelCustomJobRequest,com.google.protobuf.Empty> |
cancelCustomJobCallable()
Cancels a CustomJob.
|
void |
cancelDataLabelingJob(CancelDataLabelingJobRequest request)
Cancels a DataLabelingJob.
|
void |
cancelDataLabelingJob(DataLabelingJobName name)
Cancels a DataLabelingJob.
|
void |
cancelDataLabelingJob(String name)
Cancels a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelDataLabelingJobRequest,com.google.protobuf.Empty> |
cancelDataLabelingJobCallable()
Cancels a DataLabelingJob.
|
void |
cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)
Cancels a HyperparameterTuningJob.
|
void |
cancelHyperparameterTuningJob(HyperparameterTuningJobName name)
Cancels a HyperparameterTuningJob.
|
void |
cancelHyperparameterTuningJob(String name)
Cancels a HyperparameterTuningJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelHyperparameterTuningJobRequest,com.google.protobuf.Empty> |
cancelHyperparameterTuningJobCallable()
Cancels a HyperparameterTuningJob.
|
void |
cancelNasJob(CancelNasJobRequest request)
Cancels a NasJob.
|
void |
cancelNasJob(NasJobName name)
Cancels a NasJob.
|
void |
cancelNasJob(String name)
Cancels a NasJob.
|
com.google.api.gax.rpc.UnaryCallable<CancelNasJobRequest,com.google.protobuf.Empty> |
cancelNasJobCallable()
Cancels a NasJob.
|
void |
close() |
static JobServiceClient |
create()
Constructs an instance of JobServiceClient with default settings.
|
static JobServiceClient |
create(JobServiceSettings settings)
Constructs an instance of JobServiceClient, using the given settings.
|
static JobServiceClient |
create(JobServiceStub stub)
Constructs an instance of JobServiceClient, using the given stub for making calls.
|
BatchPredictionJob |
createBatchPredictionJob(CreateBatchPredictionJobRequest request)
Creates a BatchPredictionJob.
|
BatchPredictionJob |
createBatchPredictionJob(LocationName parent,
BatchPredictionJob batchPredictionJob)
Creates a BatchPredictionJob.
|
BatchPredictionJob |
createBatchPredictionJob(String parent,
BatchPredictionJob batchPredictionJob)
Creates a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob> |
createBatchPredictionJobCallable()
Creates a BatchPredictionJob.
|
CustomJob |
createCustomJob(CreateCustomJobRequest request)
Creates a CustomJob.
|
CustomJob |
createCustomJob(LocationName parent,
CustomJob customJob)
Creates a CustomJob.
|
CustomJob |
createCustomJob(String parent,
CustomJob customJob)
Creates a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateCustomJobRequest,CustomJob> |
createCustomJobCallable()
Creates a CustomJob.
|
DataLabelingJob |
createDataLabelingJob(CreateDataLabelingJobRequest request)
Creates a DataLabelingJob.
|
DataLabelingJob |
createDataLabelingJob(LocationName parent,
DataLabelingJob dataLabelingJob)
Creates a DataLabelingJob.
|
DataLabelingJob |
createDataLabelingJob(String parent,
DataLabelingJob dataLabelingJob)
Creates a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob> |
createDataLabelingJobCallable()
Creates a DataLabelingJob.
|
HyperparameterTuningJob |
createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)
Creates a HyperparameterTuningJob
|
HyperparameterTuningJob |
createHyperparameterTuningJob(LocationName parent,
HyperparameterTuningJob hyperparameterTuningJob)
Creates a HyperparameterTuningJob
|
HyperparameterTuningJob |
createHyperparameterTuningJob(String parent,
HyperparameterTuningJob hyperparameterTuningJob)
Creates a HyperparameterTuningJob
|
com.google.api.gax.rpc.UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob> |
createHyperparameterTuningJobCallable()
Creates a HyperparameterTuningJob
|
ModelDeploymentMonitoringJob |
createModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest request)
Creates a ModelDeploymentMonitoringJob.
|
ModelDeploymentMonitoringJob |
createModelDeploymentMonitoringJob(LocationName parent,
ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)
Creates a ModelDeploymentMonitoringJob.
|
ModelDeploymentMonitoringJob |
createModelDeploymentMonitoringJob(String parent,
ModelDeploymentMonitoringJob modelDeploymentMonitoringJob)
Creates a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<CreateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob> |
createModelDeploymentMonitoringJobCallable()
Creates a ModelDeploymentMonitoringJob.
|
NasJob |
createNasJob(CreateNasJobRequest request)
Creates a NasJob
|
NasJob |
createNasJob(LocationName parent,
NasJob nasJob)
Creates a NasJob
|
NasJob |
createNasJob(String parent,
NasJob nasJob)
Creates a NasJob
|
com.google.api.gax.rpc.UnaryCallable<CreateNasJobRequest,NasJob> |
createNasJobCallable()
Creates a NasJob
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(BatchPredictionJobName name)
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobAsync(String name)
Deletes a BatchPredictionJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBatchPredictionJobRequest,com.google.longrunning.Operation> |
deleteBatchPredictionJobCallable()
Deletes a BatchPredictionJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteBatchPredictionJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteBatchPredictionJobOperationCallable()
Deletes a BatchPredictionJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(CustomJobName name)
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(DeleteCustomJobRequest request)
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobAsync(String name)
Deletes a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteCustomJobRequest,com.google.longrunning.Operation> |
deleteCustomJobCallable()
Deletes a CustomJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteCustomJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteCustomJobOperationCallable()
Deletes a CustomJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(DataLabelingJobName name)
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobAsync(String name)
Deletes a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDataLabelingJobRequest,com.google.longrunning.Operation> |
deleteDataLabelingJobCallable()
Deletes a DataLabelingJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteDataLabelingJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteDataLabelingJobOperationCallable()
Deletes a DataLabelingJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobAsync(String name)
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteHyperparameterTuningJobRequest,com.google.longrunning.Operation> |
deleteHyperparameterTuningJobCallable()
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteHyperparameterTuningJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteHyperparameterTuningJobOperationCallable()
Deletes a HyperparameterTuningJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request)
Deletes a ModelDeploymentMonitoringJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name)
Deletes a ModelDeploymentMonitoringJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteModelDeploymentMonitoringJobAsync(String name)
Deletes a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteModelDeploymentMonitoringJobRequest,com.google.longrunning.Operation> |
deleteModelDeploymentMonitoringJobCallable()
Deletes a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteModelDeploymentMonitoringJobOperationCallable()
Deletes a ModelDeploymentMonitoringJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteNasJobAsync(DeleteNasJobRequest request)
Deletes a NasJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteNasJobAsync(NasJobName name)
Deletes a NasJob.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteNasJobAsync(String name)
Deletes a NasJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNasJobRequest,com.google.longrunning.Operation> |
deleteNasJobCallable()
Deletes a NasJob.
|
com.google.api.gax.rpc.OperationCallable<DeleteNasJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteNasJobOperationCallable()
Deletes a NasJob.
|
BatchPredictionJob |
getBatchPredictionJob(BatchPredictionJobName name)
Gets a BatchPredictionJob
|
BatchPredictionJob |
getBatchPredictionJob(GetBatchPredictionJobRequest request)
Gets a BatchPredictionJob
|
BatchPredictionJob |
getBatchPredictionJob(String name)
Gets a BatchPredictionJob
|
com.google.api.gax.rpc.UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob> |
getBatchPredictionJobCallable()
Gets a BatchPredictionJob
|
CustomJob |
getCustomJob(CustomJobName name)
Gets a CustomJob.
|
CustomJob |
getCustomJob(GetCustomJobRequest request)
Gets a CustomJob.
|
CustomJob |
getCustomJob(String name)
Gets a CustomJob.
|
com.google.api.gax.rpc.UnaryCallable<GetCustomJobRequest,CustomJob> |
getCustomJobCallable()
Gets a CustomJob.
|
DataLabelingJob |
getDataLabelingJob(DataLabelingJobName name)
Gets a DataLabelingJob.
|
DataLabelingJob |
getDataLabelingJob(GetDataLabelingJobRequest request)
Gets a DataLabelingJob.
|
DataLabelingJob |
getDataLabelingJob(String name)
Gets a DataLabelingJob.
|
com.google.api.gax.rpc.UnaryCallable<GetDataLabelingJobRequest,DataLabelingJob> |
getDataLabelingJobCallable()
Gets a DataLabelingJob.
|
HyperparameterTuningJob |
getHyperparameterTuningJob(GetHyperparameterTuningJobRequest request)
Gets a HyperparameterTuningJob
|
HyperparameterTuningJob |
getHyperparameterTuningJob(HyperparameterTuningJobName name)
Gets a HyperparameterTuningJob
|
HyperparameterTuningJob |
getHyperparameterTuningJob(String name)
Gets a HyperparameterTuningJob
|
com.google.api.gax.rpc.UnaryCallable<GetHyperparameterTuningJobRequest,HyperparameterTuningJob> |
getHyperparameterTuningJobCallable()
Gets a HyperparameterTuningJob
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
ModelDeploymentMonitoringJob |
getModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest request)
Gets a ModelDeploymentMonitoringJob.
|
ModelDeploymentMonitoringJob |
getModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Gets a ModelDeploymentMonitoringJob.
|
ModelDeploymentMonitoringJob |
getModelDeploymentMonitoringJob(String name)
Gets a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<GetModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob> |
getModelDeploymentMonitoringJobCallable()
Gets a ModelDeploymentMonitoringJob.
|
NasJob |
getNasJob(GetNasJobRequest request)
Gets a NasJob
|
NasJob |
getNasJob(NasJobName name)
Gets a NasJob
|
NasJob |
getNasJob(String name)
Gets a NasJob
|
com.google.api.gax.rpc.UnaryCallable<GetNasJobRequest,NasJob> |
getNasJobCallable()
Gets a NasJob
|
NasTrialDetail |
getNasTrialDetail(GetNasTrialDetailRequest request)
Gets a NasTrialDetail.
|
NasTrialDetail |
getNasTrialDetail(NasTrialDetailName name)
Gets a NasTrialDetail.
|
NasTrialDetail |
getNasTrialDetail(String name)
Gets a NasTrialDetail.
|
com.google.api.gax.rpc.UnaryCallable<GetNasTrialDetailRequest,NasTrialDetail> |
getNasTrialDetailCallable()
Gets a NasTrialDetail.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
JobServiceSettings |
getSettings() |
JobServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(ListBatchPredictionJobsRequest request)
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(LocationName parent)
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListBatchPredictionJobsPagedResponse |
listBatchPredictionJobs(String parent)
Lists BatchPredictionJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,ListBatchPredictionJobsResponse> |
listBatchPredictionJobsCallable()
Lists BatchPredictionJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,JobServiceClient.ListBatchPredictionJobsPagedResponse> |
listBatchPredictionJobsPagedCallable()
Lists BatchPredictionJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(ListCustomJobsRequest request)
Lists CustomJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(LocationName parent)
Lists CustomJobs in a Location.
|
JobServiceClient.ListCustomJobsPagedResponse |
listCustomJobs(String parent)
Lists CustomJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,ListCustomJobsResponse> |
listCustomJobsCallable()
Lists CustomJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,JobServiceClient.ListCustomJobsPagedResponse> |
listCustomJobsPagedCallable()
Lists CustomJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(ListDataLabelingJobsRequest request)
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(LocationName parent)
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListDataLabelingJobsPagedResponse |
listDataLabelingJobs(String parent)
Lists DataLabelingJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,ListDataLabelingJobsResponse> |
listDataLabelingJobsCallable()
Lists DataLabelingJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,JobServiceClient.ListDataLabelingJobsPagedResponse> |
listDataLabelingJobsPagedCallable()
Lists DataLabelingJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest request)
Lists HyperparameterTuningJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(LocationName parent)
Lists HyperparameterTuningJobs in a Location.
|
JobServiceClient.ListHyperparameterTuningJobsPagedResponse |
listHyperparameterTuningJobs(String parent)
Lists HyperparameterTuningJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,ListHyperparameterTuningJobsResponse> |
listHyperparameterTuningJobsCallable()
Lists HyperparameterTuningJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,JobServiceClient.ListHyperparameterTuningJobsPagedResponse> |
listHyperparameterTuningJobsPagedCallable()
Lists HyperparameterTuningJobs in a Location.
|
JobServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,JobServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse |
listModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest request)
Lists ModelDeploymentMonitoringJobs in a Location.
|
JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse |
listModelDeploymentMonitoringJobs(LocationName parent)
Lists ModelDeploymentMonitoringJobs in a Location.
|
JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse |
listModelDeploymentMonitoringJobs(String parent)
Lists ModelDeploymentMonitoringJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListModelDeploymentMonitoringJobsRequest,ListModelDeploymentMonitoringJobsResponse> |
listModelDeploymentMonitoringJobsCallable()
Lists ModelDeploymentMonitoringJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListModelDeploymentMonitoringJobsRequest,JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse> |
listModelDeploymentMonitoringJobsPagedCallable()
Lists ModelDeploymentMonitoringJobs in a Location.
|
JobServiceClient.ListNasJobsPagedResponse |
listNasJobs(ListNasJobsRequest request)
Lists NasJobs in a Location.
|
JobServiceClient.ListNasJobsPagedResponse |
listNasJobs(LocationName parent)
Lists NasJobs in a Location.
|
JobServiceClient.ListNasJobsPagedResponse |
listNasJobs(String parent)
Lists NasJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListNasJobsRequest,ListNasJobsResponse> |
listNasJobsCallable()
Lists NasJobs in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListNasJobsRequest,JobServiceClient.ListNasJobsPagedResponse> |
listNasJobsPagedCallable()
Lists NasJobs in a Location.
|
JobServiceClient.ListNasTrialDetailsPagedResponse |
listNasTrialDetails(ListNasTrialDetailsRequest request)
List top NasTrialDetails of a NasJob.
|
JobServiceClient.ListNasTrialDetailsPagedResponse |
listNasTrialDetails(NasJobName parent)
List top NasTrialDetails of a NasJob.
|
JobServiceClient.ListNasTrialDetailsPagedResponse |
listNasTrialDetails(String parent)
List top NasTrialDetails of a NasJob.
|
com.google.api.gax.rpc.UnaryCallable<ListNasTrialDetailsRequest,ListNasTrialDetailsResponse> |
listNasTrialDetailsCallable()
List top NasTrialDetails of a NasJob.
|
com.google.api.gax.rpc.UnaryCallable<ListNasTrialDetailsRequest,JobServiceClient.ListNasTrialDetailsPagedResponse> |
listNasTrialDetailsPagedCallable()
List top NasTrialDetails of a NasJob.
|
void |
pauseModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Pauses a ModelDeploymentMonitoringJob.
|
void |
pauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest request)
Pauses a ModelDeploymentMonitoringJob.
|
void |
pauseModelDeploymentMonitoringJob(String name)
Pauses a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<PauseModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty> |
pauseModelDeploymentMonitoringJobCallable()
Pauses a ModelDeploymentMonitoringJob.
|
void |
resumeModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Resumes a paused ModelDeploymentMonitoringJob.
|
void |
resumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest request)
Resumes a paused ModelDeploymentMonitoringJob.
|
void |
resumeModelDeploymentMonitoringJob(String name)
Resumes a paused ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<ResumeModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty> |
resumeModelDeploymentMonitoringJobCallable()
Resumes a paused ModelDeploymentMonitoringJob.
|
JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse |
searchModelDeploymentMonitoringStatsAnomalies(ModelDeploymentMonitoringJobName modelDeploymentMonitoringJob,
String deployedModelId)
Searches Model Monitoring Statistics generated within a given time window.
|
JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse |
searchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest request)
Searches Model Monitoring Statistics generated within a given time window.
|
JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse |
searchModelDeploymentMonitoringStatsAnomalies(String modelDeploymentMonitoringJob,
String deployedModelId)
Searches Model Monitoring Statistics generated within a given time window.
|
com.google.api.gax.rpc.UnaryCallable<SearchModelDeploymentMonitoringStatsAnomaliesRequest,SearchModelDeploymentMonitoringStatsAnomaliesResponse> |
searchModelDeploymentMonitoringStatsAnomaliesCallable()
Searches Model Monitoring Statistics generated within a given time window.
|
com.google.api.gax.rpc.UnaryCallable<SearchModelDeploymentMonitoringStatsAnomaliesRequest,JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> |
searchModelDeploymentMonitoringStatsAnomaliesPagedCallable()
Searches Model Monitoring Statistics generated within a given time window.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> |
updateModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJob modelDeploymentMonitoringJob,
com.google.protobuf.FieldMask updateMask)
Updates a ModelDeploymentMonitoringJob.
|
com.google.api.gax.longrunning.OperationFuture<ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> |
updateModelDeploymentMonitoringJobAsync(UpdateModelDeploymentMonitoringJobRequest request)
Updates a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.UnaryCallable<UpdateModelDeploymentMonitoringJobRequest,com.google.longrunning.Operation> |
updateModelDeploymentMonitoringJobCallable()
Updates a ModelDeploymentMonitoringJob.
|
com.google.api.gax.rpc.OperationCallable<UpdateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> |
updateModelDeploymentMonitoringJobOperationCallable()
Updates a ModelDeploymentMonitoringJob.
|
protected JobServiceClient(JobServiceSettings settings) throws IOException
IOExceptionprotected JobServiceClient(JobServiceStub stub)
public static final JobServiceClient create() throws IOException
IOExceptionpublic static final JobServiceClient create(JobServiceSettings settings) throws IOException
IOExceptionpublic static final JobServiceClient create(JobServiceStub stub)
public final JobServiceSettings getSettings()
public JobServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final CustomJob createCustomJob(LocationName parent, CustomJob 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()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
CustomJob customJob = CustomJob.newBuilder().build();
CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
}
parent - Required. The resource name of the Location to create the CustomJob in. Format:
`projects/{project}/locations/{location}`customJob - Required. The CustomJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomJob createCustomJob(String parent, CustomJob customJob)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The resource name of the Location to create the CustomJob in. Format:
`projects/{project}/locations/{location}`customJob - Required. The CustomJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomJob createCustomJob(CreateCustomJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateCustomJobRequest,CustomJob> createCustomJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final CustomJob getCustomJob(CustomJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the CustomJob resource. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomJob getCustomJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
CustomJob response = jobServiceClient.getCustomJob(name);
}
name - Required. The name of the CustomJob resource. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomJob getCustomJob(GetCustomJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetCustomJobRequest request =
GetCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
CustomJob response = jobServiceClient.getCustomJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCustomJobRequest,CustomJob> getCustomJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetCustomJobRequest request =
GetCustomJobRequest.newBuilder()
.setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString())
.build();
ApiFuture<CustomJob> future = jobServiceClient.getCustomJobCallable().futureCall(request);
// Do something.
CustomJob response = future.get();
}
public final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the CustomJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the CustomJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListCustomJobsPagedResponse listCustomJobs(ListCustomJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (CustomJob element : jobServiceClient.listCustomJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,JobServiceClient.ListCustomJobsPagedResponse> listCustomJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CustomJob> future =
jobServiceClient.listCustomJobsPagedCallable().futureCall(request);
// Do something.
for (CustomJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCustomJobsRequest,ListCustomJobsResponse> listCustomJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListCustomJobsRequest request =
ListCustomJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListCustomJobsResponse response = jobServiceClient.listCustomJobsCallable().call(request);
for (CustomJob element : response.getCustomJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(CustomJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the CustomJob resource to be deleted. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the CustomJob resource to be deleted. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobAsync(DeleteCustomJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteCustomJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteCustomJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteCustomJobRequest,com.google.longrunning.Operation> deleteCustomJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void cancelCustomJob(CustomJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the CustomJob to cancel. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelCustomJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the CustomJob to cancel. Format:
`projects/{project}/locations/{location}/customJobs/{custom_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelCustomJob(CancelCustomJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelCustomJobRequest,com.google.protobuf.Empty> cancelCustomJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final DataLabelingJob createDataLabelingJob(LocationName parent, DataLabelingJob 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);
}
parent - Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`dataLabelingJob - Required. The DataLabelingJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataLabelingJob createDataLabelingJob(String parent, DataLabelingJob dataLabelingJob)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`dataLabelingJob - Required. The DataLabelingJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDataLabelingJobRequest,DataLabelingJob> createDataLabelingJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final DataLabelingJob getDataLabelingJob(DataLabelingJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
DataLabelingJob response = jobServiceClient.getDataLabelingJob(name);
}
name - Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataLabelingJob getDataLabelingJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
DataLabelingJob response = jobServiceClient.getDataLabelingJob(name);
}
name - Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final DataLabelingJob getDataLabelingJob(GetDataLabelingJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetDataLabelingJobRequest request =
GetDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
DataLabelingJob response = jobServiceClient.getDataLabelingJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDataLabelingJobRequest,DataLabelingJob> getDataLabelingJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetDataLabelingJobRequest request =
GetDataLabelingJobRequest.newBuilder()
.setName(
DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
.toString())
.build();
ApiFuture<DataLabelingJob> future =
jobServiceClient.getDataLabelingJobCallable().futureCall(request);
// Do something.
DataLabelingJob response = future.get();
}
public final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the DataLabelingJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListDataLabelingJobsPagedResponse listDataLabelingJobs(ListDataLabelingJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,JobServiceClient.ListDataLabelingJobsPagedResponse> listDataLabelingJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<DataLabelingJob> future =
jobServiceClient.listDataLabelingJobsPagedCallable().futureCall(request);
// Do something.
for (DataLabelingJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListDataLabelingJobsRequest,ListDataLabelingJobsResponse> listDataLabelingJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListDataLabelingJobsRequest request =
ListDataLabelingJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListDataLabelingJobsResponse response =
jobServiceClient.listDataLabelingJobsCallable().call(request);
for (DataLabelingJob element : response.getDataLabelingJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DataLabelingJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the DataLabelingJob to be deleted. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the DataLabelingJob to be deleted. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobAsync(DeleteDataLabelingJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteDataLabelingJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteDataLabelingJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteDataLabelingJobRequest,com.google.longrunning.Operation> deleteDataLabelingJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void cancelDataLabelingJob(DataLabelingJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelDataLabelingJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the DataLabelingJob. Format:
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelDataLabelingJob(CancelDataLabelingJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelDataLabelingJobRequest,com.google.protobuf.Empty> cancelDataLabelingJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final HyperparameterTuningJob createHyperparameterTuningJob(LocationName parent, HyperparameterTuningJob 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);
}
parent - Required. The resource name of the Location to create the HyperparameterTuningJob
in. Format: `projects/{project}/locations/{location}`hyperparameterTuningJob - Required. The HyperparameterTuningJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final HyperparameterTuningJob createHyperparameterTuningJob(String parent, HyperparameterTuningJob hyperparameterTuningJob)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The resource name of the Location to create the HyperparameterTuningJob
in. Format: `projects/{project}/locations/{location}`hyperparameterTuningJob - Required. The HyperparameterTuningJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final HyperparameterTuningJob createHyperparameterTuningJob(CreateHyperparameterTuningJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateHyperparameterTuningJobRequest,HyperparameterTuningJob> createHyperparameterTuningJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final HyperparameterTuningJob getHyperparameterTuningJob(HyperparameterTuningJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
}
name - Required. The name of the HyperparameterTuningJob resource. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final HyperparameterTuningJob getHyperparameterTuningJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
}
name - Required. The name of the HyperparameterTuningJob resource. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final HyperparameterTuningJob getHyperparameterTuningJob(GetHyperparameterTuningJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetHyperparameterTuningJobRequest request =
GetHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetHyperparameterTuningJobRequest,HyperparameterTuningJob> getHyperparameterTuningJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetHyperparameterTuningJobRequest request =
GetHyperparameterTuningJobRequest.newBuilder()
.setName(
HyperparameterTuningJobName.of(
"[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
.toString())
.build();
ApiFuture<HyperparameterTuningJob> future =
jobServiceClient.getHyperparameterTuningJobCallable().futureCall(request);
// Do something.
HyperparameterTuningJob response = future.get();
}
public final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the HyperparameterTuningJobs
from. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the HyperparameterTuningJobs
from. Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJobs(ListHyperparameterTuningJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (HyperparameterTuningJob element :
jobServiceClient.listHyperparameterTuningJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,JobServiceClient.ListHyperparameterTuningJobsPagedResponse> listHyperparameterTuningJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<HyperparameterTuningJob> future =
jobServiceClient.listHyperparameterTuningJobsPagedCallable().futureCall(request);
// Do something.
for (HyperparameterTuningJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListHyperparameterTuningJobsRequest,ListHyperparameterTuningJobsResponse> listHyperparameterTuningJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListHyperparameterTuningJobsRequest request =
ListHyperparameterTuningJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListHyperparameterTuningJobsResponse response =
jobServiceClient.listHyperparameterTuningJobsCallable().call(request);
for (HyperparameterTuningJob element : response.getHyperparameterTuningJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(HyperparameterTuningJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobAsync(DeleteHyperparameterTuningJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteHyperparameterTuningJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteHyperparameterTuningJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteHyperparameterTuningJobRequest,com.google.longrunning.Operation> deleteHyperparameterTuningJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the HyperparameterTuningJob to cancel. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelHyperparameterTuningJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the HyperparameterTuningJob to cancel. Format:
`projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelHyperparameterTuningJobRequest,com.google.protobuf.Empty> cancelHyperparameterTuningJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final NasJob createNasJob(LocationName parent, NasJob 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);
}
parent - Required. The resource name of the Location to create the NasJob in. Format:
`projects/{project}/locations/{location}`nasJob - Required. The NasJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasJob createNasJob(String parent, NasJob 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);
}
parent - Required. The resource name of the Location to create the NasJob in. Format:
`projects/{project}/locations/{location}`nasJob - Required. The NasJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasJob createNasJob(CreateNasJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateNasJobRequest,NasJob> createNasJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final NasJob getNasJob(NasJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
NasJob response = jobServiceClient.getNasJob(name);
}
name - Required. The name of the NasJob resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasJob getNasJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
NasJob response = jobServiceClient.getNasJob(name);
}
name - Required. The name of the NasJob resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasJob getNasJob(GetNasJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetNasJobRequest request =
GetNasJobRequest.newBuilder()
.setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
.build();
NasJob response = jobServiceClient.getNasJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNasJobRequest,NasJob> getNasJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetNasJobRequest request =
GetNasJobRequest.newBuilder()
.setName(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
.build();
ApiFuture<NasJob> future = jobServiceClient.getNasJobCallable().futureCall(request);
// Do something.
NasJob response = future.get();
}
public final JobServiceClient.ListNasJobsPagedResponse listNasJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the NasJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListNasJobsPagedResponse listNasJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (NasJob element : jobServiceClient.listNasJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the NasJobs from. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListNasJobsPagedResponse listNasJobs(ListNasJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasJobsRequest request =
ListNasJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (NasJob element : jobServiceClient.listNasJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNasJobsRequest,JobServiceClient.ListNasJobsPagedResponse> listNasJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasJobsRequest request =
ListNasJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<NasJob> future = jobServiceClient.listNasJobsPagedCallable().futureCall(request);
// Do something.
for (NasJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNasJobsRequest,ListNasJobsResponse> listNasJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasJobsRequest request =
ListNasJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListNasJobsResponse response = jobServiceClient.listNasJobsCallable().call(request);
for (NasJob element : response.getNasJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNasJobAsync(NasJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the NasJob resource to be deleted. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNasJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the NasJob resource to be deleted. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteNasJobAsync(DeleteNasJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteNasJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteNasJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteNasJobRequest,com.google.longrunning.Operation> deleteNasJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void cancelNasJob(NasJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the NasJob to cancel. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelNasJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the NasJob to cancel. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelNasJob(CancelNasJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelNasJobRequest,com.google.protobuf.Empty> cancelNasJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final NasTrialDetail getNasTrialDetail(NasTrialDetailName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
NasTrialDetailName name =
NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]");
NasTrialDetail response = jobServiceClient.getNasTrialDetail(name);
}
name - Required. The name of the NasTrialDetail resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasTrialDetail getNasTrialDetail(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 =
NasTrialDetailName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]")
.toString();
NasTrialDetail response = jobServiceClient.getNasTrialDetail(name);
}
name - Required. The name of the NasTrialDetail resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final NasTrialDetail getNasTrialDetail(GetNasTrialDetailRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetNasTrialDetailRequest request =
GetNasTrialDetailRequest.newBuilder()
.setName(
NasTrialDetailName.of(
"[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]")
.toString())
.build();
NasTrialDetail response = jobServiceClient.getNasTrialDetail(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNasTrialDetailRequest,NasTrialDetail> getNasTrialDetailCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetNasTrialDetailRequest request =
GetNasTrialDetailRequest.newBuilder()
.setName(
NasTrialDetailName.of(
"[PROJECT]", "[LOCATION]", "[NAS_JOB]", "[NAS_TRIAL_DETAIL]")
.toString())
.build();
ApiFuture<NasTrialDetail> future =
jobServiceClient.getNasTrialDetailCallable().futureCall(request);
// Do something.
NasTrialDetail response = future.get();
}
public final JobServiceClient.ListNasTrialDetailsPagedResponse listNasTrialDetails(NasJobName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 parent = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]");
for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the NasJob resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListNasTrialDetailsPagedResponse listNasTrialDetails(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 = NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString();
for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the NasJob resource. Format:
`projects/{project}/locations/{location}/nasJobs/{nas_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListNasTrialDetailsPagedResponse listNasTrialDetails(ListNasTrialDetailsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasTrialDetailsRequest request =
ListNasTrialDetailsRequest.newBuilder()
.setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (NasTrialDetail element : jobServiceClient.listNasTrialDetails(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNasTrialDetailsRequest,JobServiceClient.ListNasTrialDetailsPagedResponse> listNasTrialDetailsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasTrialDetailsRequest request =
ListNasTrialDetailsRequest.newBuilder()
.setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<NasTrialDetail> future =
jobServiceClient.listNasTrialDetailsPagedCallable().futureCall(request);
// Do something.
for (NasTrialDetail element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNasTrialDetailsRequest,ListNasTrialDetailsResponse> listNasTrialDetailsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListNasTrialDetailsRequest request =
ListNasTrialDetailsRequest.newBuilder()
.setParent(NasJobName.of("[PROJECT]", "[LOCATION]", "[NAS_JOB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListNasTrialDetailsResponse response =
jobServiceClient.listNasTrialDetailsCallable().call(request);
for (NasTrialDetail element : response.getNasTrialDetailsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final BatchPredictionJob createBatchPredictionJob(LocationName parent, BatchPredictionJob 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()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
BatchPredictionJob response =
jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
}
parent - Required. The resource name of the Location to create the BatchPredictionJob in.
Format: `projects/{project}/locations/{location}`batchPredictionJob - Required. The BatchPredictionJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final BatchPredictionJob createBatchPredictionJob(String parent, BatchPredictionJob batchPredictionJob)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
parent - Required. The resource name of the Location to create the BatchPredictionJob in.
Format: `projects/{project}/locations/{location}`batchPredictionJob - Required. The BatchPredictionJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final BatchPredictionJob createBatchPredictionJob(CreateBatchPredictionJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateBatchPredictionJobRequest,BatchPredictionJob> createBatchPredictionJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the BatchPredictionJob resource. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final BatchPredictionJob getBatchPredictionJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
name - Required. The name of the BatchPredictionJob resource. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBatchPredictionJobRequest,BatchPredictionJob> getBatchPredictionJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the BatchPredictionJobs from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location to list the BatchPredictionJobs from.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(ListBatchPredictionJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (BatchPredictionJob element :
jobServiceClient.listBatchPredictionJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,JobServiceClient.ListBatchPredictionJobsPagedResponse> listBatchPredictionJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<BatchPredictionJob> future =
jobServiceClient.listBatchPredictionJobsPagedCallable().futureCall(request);
// Do something.
for (BatchPredictionJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListBatchPredictionJobsRequest,ListBatchPredictionJobsResponse> listBatchPredictionJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListBatchPredictionJobsRequest request =
ListBatchPredictionJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListBatchPredictionJobsResponse response =
jobServiceClient.listBatchPredictionJobsCallable().call(request);
for (BatchPredictionJob element : response.getBatchPredictionJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(BatchPredictionJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the BatchPredictionJob resource to be deleted. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The name of the BatchPredictionJob resource to be deleted. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobAsync(DeleteBatchPredictionJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteBatchPredictionJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteBatchPredictionJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteBatchPredictionJobRequest,com.google.longrunning.Operation> deleteBatchPredictionJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void cancelBatchPredictionJob(BatchPredictionJobName name)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.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);
}
name - Required. The name of the BatchPredictionJob to cancel. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelBatchPredictionJob(String name)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.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);
}
name - Required. The name of the BatchPredictionJob to cancel. Format:
`projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest request)
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelBatchPredictionJobRequest,com.google.protobuf.Empty> cancelBatchPredictionJobCallable()
Starts asynchronous cancellation on the BatchPredictionJob. The server makes the best effort to cancel the job, but success is not guaranteed. Clients can use [JobService.GetBatchPredictionJob][google.cloud.aiplatform.v1beta1.JobService.GetBatchPredictionJob] or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On a successful cancellation, the BatchPredictionJob is not deleted;instead its [BatchPredictionJob.state][google.cloud.aiplatform.v1beta1.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();
}
public final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(LocationName parent, ModelDeploymentMonitoringJob 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()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ModelDeploymentMonitoringJob modelDeploymentMonitoringJob =
ModelDeploymentMonitoringJob.newBuilder().build();
ModelDeploymentMonitoringJob response =
jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob);
}
parent - Required. The parent of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}`modelDeploymentMonitoringJob - Required. The ModelDeploymentMonitoringJob to createcom.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(String parent, ModelDeploymentMonitoringJob 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 parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
ModelDeploymentMonitoringJob modelDeploymentMonitoringJob =
ModelDeploymentMonitoringJob.newBuilder().build();
ModelDeploymentMonitoringJob response =
jobServiceClient.createModelDeploymentMonitoringJob(parent, modelDeploymentMonitoringJob);
}
parent - Required. The parent of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}`modelDeploymentMonitoringJob - Required. The ModelDeploymentMonitoringJob to createcom.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelDeploymentMonitoringJob createModelDeploymentMonitoringJob(CreateModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob> createModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies(ModelDeploymentMonitoringJobName modelDeploymentMonitoringJob, String deployedModelId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 modelDeploymentMonitoringJob =
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]");
String deployedModelId = "deployedModelId-1817547906";
for (ModelMonitoringStatsAnomalies element :
jobServiceClient
.searchModelDeploymentMonitoringStatsAnomalies(
modelDeploymentMonitoringJob, deployedModelId)
.iterateAll()) {
// doThingsWith(element);
}
}
modelDeploymentMonitoringJob - Required. ModelDeploymentMonitoring Job resource name.
Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`deployedModelId - Required. The DeployedModel ID of the
[ModelDeploymentMonitoringObjectiveConfig.deployed_model_id].com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies(String modelDeploymentMonitoringJob, String deployedModelId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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 modelDeploymentMonitoringJob =
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString();
String deployedModelId = "deployedModelId-1817547906";
for (ModelMonitoringStatsAnomalies element :
jobServiceClient
.searchModelDeploymentMonitoringStatsAnomalies(
modelDeploymentMonitoringJob, deployedModelId)
.iterateAll()) {
// doThingsWith(element);
}
}
modelDeploymentMonitoringJob - Required. ModelDeploymentMonitoring Job resource name.
Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`deployedModelId - Required. The DeployedModel ID of the
[ModelDeploymentMonitoringObjectiveConfig.deployed_model_id].com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse searchModelDeploymentMonitoringStatsAnomalies(SearchModelDeploymentMonitoringStatsAnomaliesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SearchModelDeploymentMonitoringStatsAnomaliesRequest request =
SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder()
.setModelDeploymentMonitoringJob(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.setDeployedModelId("deployedModelId-1817547906")
.setFeatureDisplayName("featureDisplayName-1741181545")
.addAllObjectives(
new ArrayList<
SearchModelDeploymentMonitoringStatsAnomaliesRequest
.StatsAnomaliesObjective>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setStartTime(Timestamp.newBuilder().build())
.setEndTime(Timestamp.newBuilder().build())
.build();
for (ModelMonitoringStatsAnomalies element :
jobServiceClient.searchModelDeploymentMonitoringStatsAnomalies(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchModelDeploymentMonitoringStatsAnomaliesRequest,JobServiceClient.SearchModelDeploymentMonitoringStatsAnomaliesPagedResponse> searchModelDeploymentMonitoringStatsAnomaliesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SearchModelDeploymentMonitoringStatsAnomaliesRequest request =
SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder()
.setModelDeploymentMonitoringJob(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.setDeployedModelId("deployedModelId-1817547906")
.setFeatureDisplayName("featureDisplayName-1741181545")
.addAllObjectives(
new ArrayList<
SearchModelDeploymentMonitoringStatsAnomaliesRequest
.StatsAnomaliesObjective>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setStartTime(Timestamp.newBuilder().build())
.setEndTime(Timestamp.newBuilder().build())
.build();
ApiFuture<ModelMonitoringStatsAnomalies> future =
jobServiceClient
.searchModelDeploymentMonitoringStatsAnomaliesPagedCallable()
.futureCall(request);
// Do something.
for (ModelMonitoringStatsAnomalies element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<SearchModelDeploymentMonitoringStatsAnomaliesRequest,SearchModelDeploymentMonitoringStatsAnomaliesResponse> searchModelDeploymentMonitoringStatsAnomaliesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SearchModelDeploymentMonitoringStatsAnomaliesRequest request =
SearchModelDeploymentMonitoringStatsAnomaliesRequest.newBuilder()
.setModelDeploymentMonitoringJob(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.setDeployedModelId("deployedModelId-1817547906")
.setFeatureDisplayName("featureDisplayName-1741181545")
.addAllObjectives(
new ArrayList<
SearchModelDeploymentMonitoringStatsAnomaliesRequest
.StatsAnomaliesObjective>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setStartTime(Timestamp.newBuilder().build())
.setEndTime(Timestamp.newBuilder().build())
.build();
while (true) {
SearchModelDeploymentMonitoringStatsAnomaliesResponse response =
jobServiceClient.searchModelDeploymentMonitoringStatsAnomaliesCallable().call(request);
for (ModelMonitoringStatsAnomalies element : response.getMonitoringStatsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
ModelDeploymentMonitoringJob response =
jobServiceClient.getModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
ModelDeploymentMonitoringJob response =
jobServiceClient.getModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final ModelDeploymentMonitoringJob getModelDeploymentMonitoringJob(GetModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetModelDeploymentMonitoringJobRequest request =
GetModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
ModelDeploymentMonitoringJob response =
jobServiceClient.getModelDeploymentMonitoringJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob> getModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetModelDeploymentMonitoringJobRequest request =
GetModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
ApiFuture<ModelDeploymentMonitoringJob> future =
jobServiceClient.getModelDeploymentMonitoringJobCallable().futureCall(request);
// Do something.
ModelDeploymentMonitoringJob response = future.get();
}
public final JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]");
for (ModelDeploymentMonitoringJob element :
jobServiceClient.listModelDeploymentMonitoringJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
for (ModelDeploymentMonitoringJob element :
jobServiceClient.listModelDeploymentMonitoringJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the ModelDeploymentMonitoringJob. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse listModelDeploymentMonitoringJobs(ListModelDeploymentMonitoringJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListModelDeploymentMonitoringJobsRequest request =
ListModelDeploymentMonitoringJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
for (ModelDeploymentMonitoringJob element :
jobServiceClient.listModelDeploymentMonitoringJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListModelDeploymentMonitoringJobsRequest,JobServiceClient.ListModelDeploymentMonitoringJobsPagedResponse> listModelDeploymentMonitoringJobsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListModelDeploymentMonitoringJobsRequest request =
ListModelDeploymentMonitoringJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ModelDeploymentMonitoringJob> future =
jobServiceClient.listModelDeploymentMonitoringJobsPagedCallable().futureCall(request);
// Do something.
for (ModelDeploymentMonitoringJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListModelDeploymentMonitoringJobsRequest,ListModelDeploymentMonitoringJobsResponse> listModelDeploymentMonitoringJobsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListModelDeploymentMonitoringJobsRequest request =
ListModelDeploymentMonitoringJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setReadMask(FieldMask.newBuilder().build())
.build();
while (true) {
ListModelDeploymentMonitoringJobsResponse response =
jobServiceClient.listModelDeploymentMonitoringJobsCallable().call(request);
for (ModelDeploymentMonitoringJob element :
response.getModelDeploymentMonitoringJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJob modelDeploymentMonitoringJob, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ModelDeploymentMonitoringJob modelDeploymentMonitoringJob =
ModelDeploymentMonitoringJob.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ModelDeploymentMonitoringJob response =
jobServiceClient
.updateModelDeploymentMonitoringJobAsync(modelDeploymentMonitoringJob, updateMask)
.get();
}
modelDeploymentMonitoringJob - Required. The model monitoring configuration which replaces
the resource on the server.updateMask - Required. The update mask is used to specify the fields to be overwritten in
the ModelDeploymentMonitoringJob resource by the update. The fields specified in the
update_mask are relative to the resource, not the full request. A field will be overwritten
if it is in the mask. If the user does not provide a mask then only the non-empty fields
present in the request will be overwritten. Set the update_mask to `*` to override all
fields. For the objective config, the user can either provide the update mask for
model_deployment_monitoring_objective_configs or any combination of its nested fields, such
as: model_deployment_monitoring_objective_configs.objective_config.training_dataset.
Updatable fields:
* `display_name` * `model_deployment_monitoring_schedule_config` * `model_monitoring_alert_config` * `logging_sampling_strategy` * `labels` * `log_ttl` * `enable_monitoring_pipeline_logs` . and * `model_deployment_monitoring_objective_configs` . or * `model_deployment_monitoring_objective_configs.objective_config.training_dataset` * `model_deployment_monitoring_objective_configs.objective_config.training_prediction_skew_detection_config` * `model_deployment_monitoring_objective_configs.objective_config.prediction_drift_detection_config`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobAsync(UpdateModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpdateModelDeploymentMonitoringJobRequest request =
UpdateModelDeploymentMonitoringJobRequest.newBuilder()
.setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ModelDeploymentMonitoringJob response =
jobServiceClient.updateModelDeploymentMonitoringJobAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateModelDeploymentMonitoringJobRequest,ModelDeploymentMonitoringJob,UpdateModelDeploymentMonitoringJobOperationMetadata> updateModelDeploymentMonitoringJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpdateModelDeploymentMonitoringJobRequest request =
UpdateModelDeploymentMonitoringJobRequest.newBuilder()
.setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OperationFuture<
ModelDeploymentMonitoringJob, UpdateModelDeploymentMonitoringJobOperationMetadata>
future =
jobServiceClient
.updateModelDeploymentMonitoringJobOperationCallable()
.futureCall(request);
// Do something.
ModelDeploymentMonitoringJob response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateModelDeploymentMonitoringJobRequest,com.google.longrunning.Operation> updateModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
UpdateModelDeploymentMonitoringJobRequest request =
UpdateModelDeploymentMonitoringJobRequest.newBuilder()
.setModelDeploymentMonitoringJob(ModelDeploymentMonitoringJob.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Operation> future =
jobServiceClient.updateModelDeploymentMonitoringJobCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(ModelDeploymentMonitoringJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The resource name of the model monitoring job to delete. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
name - Required. The resource name of the model monitoring job to delete. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobAsync(DeleteModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteModelDeploymentMonitoringJobOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteModelDeploymentMonitoringJobRequest,com.google.longrunning.Operation> deleteModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
public final void pauseModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.pauseModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob to pause. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void pauseModelDeploymentMonitoringJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.pauseModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob to pause. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void pauseModelDeploymentMonitoringJob(PauseModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
PauseModelDeploymentMonitoringJobRequest request =
PauseModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
jobServiceClient.pauseModelDeploymentMonitoringJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<PauseModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty> pauseModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
PauseModelDeploymentMonitoringJobRequest request =
PauseModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
jobServiceClient.pauseModelDeploymentMonitoringJobCallable().futureCall(request);
// Do something.
future.get();
}
public final void resumeModelDeploymentMonitoringJob(ModelDeploymentMonitoringJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.resumeModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob to resume. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void resumeModelDeploymentMonitoringJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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.resumeModelDeploymentMonitoringJob(name);
}
name - Required. The resource name of the ModelDeploymentMonitoringJob to resume. Format:
`projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void resumeModelDeploymentMonitoringJob(ResumeModelDeploymentMonitoringJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ResumeModelDeploymentMonitoringJobRequest request =
ResumeModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
jobServiceClient.resumeModelDeploymentMonitoringJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ResumeModelDeploymentMonitoringJobRequest,com.google.protobuf.Empty> resumeModelDeploymentMonitoringJobCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ResumeModelDeploymentMonitoringJobRequest request =
ResumeModelDeploymentMonitoringJobRequest.newBuilder()
.setName(
ModelDeploymentMonitoringJobName.of(
"[PROJECT]", "[LOCATION]", "[MODEL_DEPLOYMENT_MONITORING_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
jobServiceClient.resumeModelDeploymentMonitoringJobCallable().futureCall(request);
// Do something.
future.get();
}
public final JobServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : jobServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,JobServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
jobServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = jobServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = jobServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = jobServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = jobServiceClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = jobServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = jobServiceClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = jobServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = jobServiceClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
jobServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.