@Override public void delete() throws Exception { artifactClient.delete(artifactId); } }
@Override public void perform(Arguments arguments, PrintStream output) throws Exception { String artifactName = arguments.get(ArgumentName.ARTIFACT_NAME.toString()); String artifactVersion = arguments.get(ArgumentName.ARTIFACT_VERSION.toString()); ArtifactId artifactId = cliConfig.getCurrentNamespace().artifact(artifactName, artifactVersion); artifactClient.delete(artifactId); output.printf("Successfully deleted artifact\n"); }
@Override public void perform(Arguments arguments, PrintStream output) throws Exception { String artifactName = arguments.get(ArgumentName.ARTIFACT_NAME.toString()); String artifactVersion = arguments.get(ArgumentName.ARTIFACT_VERSION.toString()); ArtifactId artifactId = cliConfig.getCurrentNamespace().artifact(artifactName, artifactVersion); artifactClient.delete(artifactId); output.printf("Successfully deleted artifact\n"); }
private void doClear(NamespaceId namespace, boolean deleteNamespace) throws Exception { // stop all programs in the namespace getProgramClient().stopAll(namespace); if (deleteNamespace) { getNamespaceClient().delete(namespace); return; } // delete all apps in the namespace for (ApplicationRecord app : getApplicationClient().list(namespace)) { getApplicationClient().delete(namespace.app(app.getName(), app.getAppVersion())); } // delete all dataset instances for (DatasetSpecificationSummary datasetSpecSummary : getDatasetClient().list(namespace)) { getDatasetClient().delete(namespace.dataset(datasetSpecSummary.getName())); } ArtifactClient artifactClient = new ArtifactClient(getClientConfig(), getRestClient()); for (ArtifactSummary artifactSummary : artifactClient.list(namespace, ArtifactScope.USER)) { artifactClient.delete(namespace.artifact(artifactSummary.getName(), artifactSummary.getVersion())); } assertIsClear(namespace); }