Search in sources :

Example 6 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1beta1.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.");
    }
}
Also used : Empty(com.google.protobuf.Empty) ModelName(com.google.cloud.aiplatform.v1.ModelName) DeleteOperationMetadata(com.google.cloud.aiplatform.v1.DeleteOperationMetadata) ModelServiceSettings(com.google.cloud.aiplatform.v1.ModelServiceSettings) ModelServiceClient(com.google.cloud.aiplatform.v1.ModelServiceClient)

Example 7 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1beta1.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.");
    }
}
Also used : TrainingPipelineName(com.google.cloud.aiplatform.v1.TrainingPipelineName) Empty(com.google.protobuf.Empty) DeleteOperationMetadata(com.google.cloud.aiplatform.v1.DeleteOperationMetadata) PipelineServiceSettings(com.google.cloud.aiplatform.v1.PipelineServiceSettings) PipelineServiceClient(com.google.cloud.aiplatform.v1.PipelineServiceClient)

Example 8 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1beta1.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);
}
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 9 with DeleteOperationMetadata

use of com.google.cloud.aiplatform.v1beta1.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.");
    }
}
Also used : JobServiceSettings(com.google.cloud.aiplatform.v1.JobServiceSettings) Empty(com.google.protobuf.Empty) DeleteOperationMetadata(com.google.cloud.aiplatform.v1.DeleteOperationMetadata) JobServiceClient(com.google.cloud.aiplatform.v1.JobServiceClient) DataLabelingJobName(com.google.cloud.aiplatform.v1.DataLabelingJobName)

Example 10 with DeleteOperationMetadata

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

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