OSS 3.12.1-01
Is there a way to programatically delete repositories?
e.g.:
{
"name": "create_some-repo",
"content": "
import org.sonatype.nexus.repository.storage.WritePolicy;
repository.createPyPiHosted('some-repo', 'default', false, WritePolicy.ALLOW_ONCE);
",
"type": "groovy"
}
The documentation for the RepositoryApi only has Create methods:
public interface RepositoryApi
extends org.sonatype.nexus.common.script.ScriptApi
The UI itself does a POST to /service/extdirect with some sort of faux-JSON-RPC payload:
'{"action":"coreui_Repository","method":"remove","data":["some-repo"],"type":"rpc","tid":18}'
I could do something like that myself but the "tid" parameter isn't returned as part of /beta/repositories. It is, however, obtainable through the same (undocumented?) /service/extdirect API. This would be dodgy at best, so I'd rather not do it this way.
Is there another spot that I haven't looked or another approach that will allow me to delete repositories?
Many thanks
Thiago.