use of com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class ImportDataVideoObjectTrackingSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException {
// delete the temp dataset
if (datasetId != null) {
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.v1beta1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class ImportDataImageObjectDetectionSampleTest method tearDown.
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException, TimeoutException {
// 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.v1beta1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class ImportDataVideoActionRecognitionSampleTest 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.v1beta1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class ImportDataVideoClassificationSampleTest 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.v1beta1.DeleteOperationMetadata in project java-aiplatform by googleapis.
the class DeleteEndpointSample method deleteEndpointSample.
static void deleteEndpointSample(String project, String endpointId) throws IOException, InterruptedException, ExecutionException, TimeoutException {
EndpointServiceSettings endpointServiceSettings = EndpointServiceSettings.newBuilder().setEndpoint("us-central1-aiplatform.googleapis.com:443").build();
// the "close" method on the client to safely clean up any remaining background resources.
try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create(endpointServiceSettings)) {
String location = "us-central1";
EndpointName endpointName = EndpointName.of(project, location, endpointId);
OperationFuture<Empty, DeleteOperationMetadata> operationFuture = endpointServiceClient.deleteEndpointAsync(endpointName);
System.out.format("Operation name: %s\n", operationFuture.getInitialFuture().get().getName());
System.out.println("Waiting for operation to finish...");
Empty deleteResponse = operationFuture.get(300, TimeUnit.SECONDS);
System.out.format("Delete Endpoint Response: %s\n", deleteResponse);
}
}
Aggregations