use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class ResumeCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean success = scheduler.resumeScheduler(currentContext.getSessionId());
resultStack(currentContext).push(success);
if (success) {
writeLine(currentContext, "Scheduler successfully resumed.");
} else {
writeLine(currentContext, "Cannot resume scheduler.");
}
} catch (Exception e) {
handleError("An error occurred while attempting to resume scheduler:", e, currentContext);
}
}
use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class SchedStatsCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
Map<String, String> stats = scheduler.getStatistics(currentContext.getSessionId());
resultStack(currentContext).push(stats);
if (!currentContext.isSilent()) {
writeLine(currentContext, "%s", StringUtility.statsAsString(stats));
}
} catch (Exception e) {
handleError("An error occurred while retrieving stats:", e, currentContext);
}
}
Aggregations