use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class RestartRunningTaskCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean result = scheduler.restartTask(currentContext.getSessionId(), jobId, taskId);
handleResult(currentContext, result);
} catch (Exception e) {
handleError(String.format("An error occurred while attempting to restart %s:", task()), e, currentContext);
}
}
use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class RestartTaskCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean result = scheduler.restartTask(currentContext.getSessionId(), jobId, taskId);
handleResult(currentContext, result);
} catch (Exception e) {
handleError(String.format("An error occurred while attempting to restart %s:", task()), e, currentContext);
}
}
use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class ResumeAllPausedTasksCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean result = scheduler.resumeJob(currentContext.getSessionId(), jobId);
handleResult(currentContext, result);
} catch (Exception e) {
handleError(String.format("An error occurred while attempting to resume all paused tasks for %s:", job()), e, currentContext);
}
}
use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class ResumeJobCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
writeDeprecation(currentContext, CommandSet.JOB_RESUME_ALL_PAUSED_TASKS);
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean success = scheduler.resumeJob(currentContext.getSessionId(), jobId);
resultStack(currentContext).push(success);
if (success) {
writeLine(currentContext, "%s resumed successfully.", job());
} else {
writeLine(currentContext, "Cannot resume %s.", job());
}
} catch (Exception e) {
handleError(String.format("An error occurred while attempting to resume: %s", job()), e, currentContext);
}
}
use of org.ow2.proactive_grid_cloud_portal.common.SchedulerRestInterface in project scheduling by ow2-proactive.
the class StartCommand method execute.
@Override
public void execute(ApplicationContext currentContext) throws CLIException {
SchedulerRestInterface scheduler = currentContext.getRestClient().getScheduler();
try {
boolean success = scheduler.startScheduler(currentContext.getSessionId());
resultStack(currentContext).push(success);
if (success) {
writeLine(currentContext, "Scheduler successfully started.");
} else {
writeLine(currentContext, "Cannot start scheduler.");
}
} catch (Exception e) {
handleError("An error occurred while attempting to start scheduler:", e, currentContext);
}
}
Aggregations