use of com.google.cloud.aiplatform.v1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class DeleteModelSample method deleteModel.
static void deleteModel(String project, String modelId) throws IOException, ExecutionException, InterruptedException, TimeoutException {
ModelServiceSettings modelServiceSettings = ModelServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
String location = "us-central1";
ModelName modelName = ModelName.of(project, location, modelId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = modelServiceClient.deleteModelAsync(modelName);
System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
operationFuture.get(300, TimeUnit.SECONDS);
System.out.format("Deleted Model.");
}
}
use of com.google.cloud.aiplatform.v1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class DeleteTrainingPipelineSample method deleteTrainingPipelineSample.
static void deleteTrainingPipelineSample(String project, String trainingPipelineId) throws IOException, InterruptedException, ExecutionException, TimeoutException {
PipelineServiceSettings pipelineServiceSettings = PipelineServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create(pipelineServiceSettings)) {
String location = "us-central1";
TrainingPipelineName trainingPipelineName = TrainingPipelineName.of(project, location, trainingPipelineId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = pipelineServiceClient.deleteTrainingPipelineAsync(trainingPipelineName);
System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
operationFuture.get(300, TimeUnit.SECONDS);
System.out.format("Deleted Training Pipeline.");
}
}
use of com.google.cloud.aiplatform.v1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class ImportDataImageClassificationSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException {
// delete the temp dataset
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
}
System.out.flush();
System.setOut(originalPrintStream);
}
use of com.google.cloud.aiplatform.v1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class DeleteDataLabelingJobSample method deleteDataLabelingJob.
static void deleteDataLabelingJob(String project, String dataLabelingJobId) throws IOException, InterruptedException, ExecutionException, TimeoutException {
JobServiceSettings jobServiceSettings = JobServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (JobServiceClient jobServiceClient = JobServiceClient.create(jobServiceSettings)) {
String location = "us-central1";
DataLabelingJobName dataLabelingJobName = DataLabelingJobName.of(project, location, dataLabelingJobId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = jobServiceClient.deleteDataLabelingJobAsync(dataLabelingJobName);
System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
operationFuture.get(300, TimeUnit.SECONDS);
System.out.format("Deleted Data Labeling Job.");
}
}
use of com.google.cloud.aiplatform.v1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class DeleteDatasetSample method deleteDatasetSample.
static void deleteDatasetSample(String project, String datasetId) throws IOException, InterruptedException, ExecutionException, TimeoutException {
DatasetServiceSettings datasetServiceSettings = DatasetServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings)) {
String location = "us-central1";
DatasetName datasetName = DatasetName.of(project, location, datasetId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = datasetServiceClient.deleteDatasetAsync(datasetName);
System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
operationFuture.get(300, TimeUnit.SECONDS);
System.out.format("Deleted Dataset.");
}
}
Aggregations