Search in sources :

Example 1 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1.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);
}
Also used : Empty(com.google.protobuf.Empty) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) DatasetName(com.google.cloud.aiplatform.v1beta1.DatasetName) DeleteOperationMetadata(com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) After(org.junit.After)

Example 2 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1.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);
}
Also used : Empty(com.google.protobuf.Empty) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) DatasetName(com.google.cloud.aiplatform.v1beta1.DatasetName) DeleteOperationMetadata(com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) After(org.junit.After)

Example 3 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1.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);
}
Also used : Empty(com.google.protobuf.Empty) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) DatasetName(com.google.cloud.aiplatform.v1beta1.DatasetName) DeleteOperationMetadata(com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) After(org.junit.After)

Example 4 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1.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);
}
Also used : Empty(com.google.protobuf.Empty) DatasetServiceSettings(com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings) DatasetName(com.google.cloud.aiplatform.v1beta1.DatasetName) DeleteOperationMetadata(com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata) DatasetServiceClient(com.google.cloud.aiplatform.v1beta1.DatasetServiceClient) After(org.junit.After)

Example 5 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1.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);
    }
}
Also used : Empty(com.google.protobuf.Empty) EndpointName(com.google.cloud.aiplatform.v1.EndpointName) EndpointServiceClient(com.google.cloud.aiplatform.v1.EndpointServiceClient) DeleteOperationMetadata(com.google.cloud.aiplatform.v1.DeleteOperationMetadata) EndpointServiceSettings(com.google.cloud.aiplatform.v1.EndpointServiceSettings)

Aggregations

Empty (com.google.protobuf.Empty)11 DeleteOperationMetadata (com.google.cloud.aiplatform.v1.DeleteOperationMetadata)6 DatasetName (com.google.cloud.aiplatform.v1beta1.DatasetName)5 DatasetServiceClient (com.google.cloud.aiplatform.v1beta1.DatasetServiceClient)5 DatasetServiceSettings (com.google.cloud.aiplatform.v1beta1.DatasetServiceSettings)5 DeleteOperationMetadata (com.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata)5 After (org.junit.After)5 JobServiceClient (com.google.cloud.aiplatform.v1.JobServiceClient)2 JobServiceSettings (com.google.cloud.aiplatform.v1.JobServiceSettings)2 BatchPredictionJobName (com.google.cloud.aiplatform.v1.BatchPredictionJobName)1 DataLabelingJobName (com.google.cloud.aiplatform.v1.DataLabelingJobName)1 DatasetName (com.google.cloud.aiplatform.v1.DatasetName)1 DatasetServiceClient (com.google.cloud.aiplatform.v1.DatasetServiceClient)1 DatasetServiceSettings (com.google.cloud.aiplatform.v1.DatasetServiceSettings)1 EndpointName (com.google.cloud.aiplatform.v1.EndpointName)1 EndpointServiceClient (com.google.cloud.aiplatform.v1.EndpointServiceClient)1 EndpointServiceSettings (com.google.cloud.aiplatform.v1.EndpointServiceSettings)1 ModelName (com.google.cloud.aiplatform.v1.ModelName)1 ModelServiceClient (com.google.cloud.aiplatform.v1.ModelServiceClient)1 ModelServiceSettings (com.google.cloud.aiplatform.v1.ModelServiceSettings)1