我使用这段代码,直接来自Javadocs,删除了VertexAI训练管道
try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
TrainingPipelineName name =
TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
}
我得到了这个错误。据我所知,这意味着这个API,尽管官方记录在案,但只是未实现。我们如何使用Java删除培训管道?
Error in deleting //aiplatform.googleapis.com/projects/746859988231/locations/us-central1/trainingPipelines/186468439399187392:
java.util.concurrent.ExecutionException:
com.google.api.gax.rpc.UnimplementedException: io.grpc.StatusRuntimeException:
UNIMPLEMENTED: HTTP status code 404
...
<!DOCTYPE html>
<html lang=en>
....
<p>The requested URL <code>/google.cloud.aiplatform.v1.PipelineService
/DeleteTrainingPipeline</code> was not found on this server.
<ins>That’s all we know.</ins>
根据官方留档https://cloud.google.com/vertex-ai/docs/reference/rest,该服务支持的服务URL有:
https://us-central1-aiplatform.googleapis.com
https://us-east1-aiplatform.googleapis.com
https://us-east4-aiplatform.googleapis.com
https://us-west1-aiplatform.googleapis.com
https://northamerica-northeast1-aiplatform.googleapis.com
https://europe-west1-aiplatform.googleapis.com
https://europe-west2-aiplatform.googleapis.com
https://europe-west4-aiplatform.googleapis.com
https://asia-east1-aiplatform.googleapis.com
https://asia-northeast1-aiplatform.googleapis.com
https://asia-northeast3-aiplatform.googleapis.com
https://asia-southeast1-aiplatform.googleapis.com
https://australia-southeast1-aiplatform.googleapis.com
PipelineServiceSettings pipelineServiceSettings =
PipelineServiceSettings.newBuilder()
.setEndpoint("us-central1-aiplatform.googleapis.com:443")
.build();
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.");
}