How to delete a catalog

How to delete a catalog

When you delete a catalog, the catalog's metadata and all layers are deleted.
Before deleting a catalog, consider reviewing the usage information for the
catalog to make sure no processes, such as pipelines, depend on the catalog. If
you delete a catalog that is used by a process like a pipeline, you will break
the process. For information on viewing usage information, see the
Logs, Monitoring and Alerts User Guide.

To delete a catalog, use the AdminApi provided by the data-client module.
The only required parameter is the HRN of the catalog:

adminApi.deleteCatalog(catalogHrn).flatMap { _ =>
  log.info(s"deleted $catalogHrn")
  Future.successful(catalogHrn)
}
CompletionStage<CompletionStage<HRN>> deletionStage =
    adminApi
        .deleteCatalog(catalogHrn)
        .thenApply(
            done -> {
              log.info("deleted `" + catalogHrn + "`");
              CompletableFuture<HRN> retval = new CompletableFuture<HRN>();
              retval.complete(catalogHrn);
              return retval;
            });

Warning

Data loss
Once a catalog is deleted, all the associated data and metadata is also
deleted. There is no mechanism to undo the operation. Therefore, this should
be done with caution.


Did this page help you?