The CLI has a command that deletes a namespace. However, we don't describe a RESTful API endpoint to do that, nor do we describe exactly what happens when that is done: especially with regard to handling the default namespace.
We do say, on http://docs-staging.cask.co/cdap/3.1.0-SNAPSHOT/en/developers-manual/building-blocks/namespaces.html?highlight=namespace (also in 3.0.0):
This needs to be updated.
I think it was a deliberate decision to keep the delete API undocumented, since it is a dangerous API, quite like the v2 unrecoverable/reset API. However, I agree that the functionality is exposed in CLI as well as in the UI now. any thoughts on whether we should document it now?
My 2 cents: This is not really a "hidden" feature. The CLI, for example, shows it in its suggestions:
I think it should be documented, and it should be made clear that this has to be done with caution.
Here's is what I think should be documented.
We have two REST APIs:
Deletes datasets, apps, metrics, streams, etc and the namespace itself at the end.
For default namespace, the first API only deletes the contents, but retains the namespace.
Both CLI (delete namespace command) and UI (Admin -> Namespace -> Actions -> Delete) expose this functionality.
CLI and UI do not expose this functionality. This is a utility API.
Both need to be executed with caution, so we have an extra check - the unrecoverable reset parameter enable.unrecoverable.reset must be set.
Let me know if you you think we should add any more information.
The requirement for enable.unrecoverable.reset to bet set to True also applies to both the CDAP CLI and the CDAP UI.