@Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException, IOException { final String name = options.getString(nameArg.getDest()); final RemoveDeploymentGroupResponse status = client.removeDeploymentGroup(name).get(); if (status == null) { throw new RuntimeException("The Helios master could not remove the given deployment group."); } final boolean failed = status.getStatus() != RemoveDeploymentGroupResponse.Status.REMOVED; if (json) { out.println(status.toJsonString()); } else { if (failed) { out.println(format("Failed to remove deployment-group %s, status: %s", name, status.getStatus())); } else { out.println(format("Deployment-group %s removed", name)); } } return failed ? 1 : 0; } }
@Override int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException, IOException { final String name = options.getString(nameArg.getDest()); final RemoveDeploymentGroupResponse status = client.removeDeploymentGroup(name).get(); if (status == null) { throw new RuntimeException("The Helios master could not remove the given deployment group."); } final boolean failed = status.getStatus() != RemoveDeploymentGroupResponse.Status.REMOVED; if (json) { out.println(status.toJsonString()); } else { if (failed) { out.println(format("Failed to remove deployment-group %s, status: %s", name, status.getStatus())); } else { out.println(format("Deployment-group %s removed", name)); } } return failed ? 1 : 0; } }