@DELETE @Path("/unrecoverable/namespaces/{namespace-id}/datasets") public void deleteDatasets(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespace) throws Exception { if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) { responder.sendString(HttpResponseStatus.FORBIDDEN, String.format("All datasets in namespace %s cannot be deleted because '%s' is not enabled." + " Please enable it and restart CDAP Master.", namespace, Constants.Dangerous.UNRECOVERABLE_RESET)); return; } NamespaceId namespaceId = new NamespaceId(namespace); namespaceAdmin.deleteDatasets(namespaceId); responder.sendStatus(HttpResponseStatus.OK); }
@DELETE @Path("/unrecoverable/namespaces/{namespace-id}/datasets") public void deleteDatasets(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespace) throws Exception { if (!cConf.getBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, Constants.Dangerous.DEFAULT_UNRECOVERABLE_RESET)) { responder.sendString(HttpResponseStatus.FORBIDDEN, String.format("All datasets in namespace %s cannot be deleted because '%s' is not enabled." + " Please enable it and restart CDAP Master.", namespace, Constants.Dangerous.UNRECOVERABLE_RESET)); return; } NamespaceId namespaceId = new NamespaceId(namespace); namespaceAdmin.deleteDatasets(namespaceId); responder.sendStatus(HttpResponseStatus.OK); }