use of com.emc.vipr.model.catalog.ExecutionLogRestRep in project coprhd-controller by CoprHD.
the class OrderTextCreator method writeTaskLogs.
private void writeTaskLogs(ExecutionStateRestRep state) {
List<ExecutionLogRestRep> precheckLogs = getTaskLogs(exeLogs, ExecutionPhase.PRECHECK);
List<ExecutionLogRestRep> executeLogs = getTaskLogs(exeLogs, ExecutionPhase.EXECUTE);
List<ExecutionLogRestRep> rollbackLogs = getTaskLogs(exeLogs, ExecutionPhase.ROLLBACK);
if (!precheckLogs.isEmpty()) {
writeHeader("Precheck Steps");
for (ExecutionLogRestRep log : precheckLogs) {
writeLog(log);
}
}
if (!executeLogs.isEmpty()) {
writeHeader("Execute Steps");
for (ExecutionLogRestRep log : executeLogs) {
writeLog(log);
}
}
if (!rollbackLogs.isEmpty()) {
writeHeader("Rollback Steps");
for (ExecutionLogRestRep log : rollbackLogs) {
writeLog(log);
}
}
}
use of com.emc.vipr.model.catalog.ExecutionLogRestRep in project coprhd-controller by CoprHD.
the class ApiMapperUtils method newExecutionInfo.
public static ExecutionInfo newExecutionInfo(ExecutionStateRestRep state, List<OrderLogRestRep> logs, List<ExecutionLogRestRep> taskLogs) {
ExecutionInfo it = new ExecutionInfo();
it.setStartDate(state.getStartDate());
it.setEndDate(state.getEndDate());
it.setExecutionStatus(state.getExecutionStatus());
it.setCurrentTask(state.getCurrentTask());
it.getAffectedResources().addAll(state.getAffectedResources());
for (OrderLogRestRep log : logs) {
ExecutionLogInfo info = new ExecutionLogInfo();
info.setDate(log.getDate());
info.setLevel(log.getLevel());
info.setMessage(log.getMessage());
info.setPhase(log.getPhase());
info.setStackTrace(log.getStackTrace());
it.getExecutionLogs().add(info);
}
for (ExecutionLogRestRep log : taskLogs) {
ExecutionTaskInfo info = new ExecutionTaskInfo();
info.setDate(log.getDate());
info.setLevel(log.getLevel());
info.setMessage(log.getMessage());
info.setPhase(log.getPhase());
info.setStackTrace(log.getStackTrace());
info.setDetail(log.getDetail());
info.setElapsed(log.getElapsed());
it.getExecutionTasks().add(info);
}
return it;
}
use of com.emc.vipr.model.catalog.ExecutionLogRestRep in project coprhd-controller by CoprHD.
the class OrdersApi method orderExecution.
public static void orderExecution(String orderId) {
ViPRCatalogClient2 catalog = getCatalogClient();
ExecutionStateRestRep executionState = catalog.orders().getExecutionState(uri(orderId));
List<OrderLogRestRep> logs = catalog.orders().getLogs(uri(orderId));
List<ExecutionLogRestRep> taskLogs = catalog.orders().getExecutionLogs(uri(orderId));
renderApi(newExecutionInfo(executionState, logs, taskLogs));
}
use of com.emc.vipr.model.catalog.ExecutionLogRestRep in project coprhd-controller by CoprHD.
the class OrderMapper method toExecutionLogList.
public static ExecutionLogList toExecutionLogList(List<ExecutionTaskLog> executionTaskLogs) {
ExecutionLogList list = new ExecutionLogList();
for (ExecutionTaskLog executionTaskLog : executionTaskLogs) {
ExecutionLogRestRep executionLogRestRep = map(executionTaskLog);
list.getExecutionLogs().add(executionLogRestRep);
}
return list;
}
use of com.emc.vipr.model.catalog.ExecutionLogRestRep in project coprhd-controller by CoprHD.
the class OrderTextCreator method map.
public static ExecutionLogRestRep map(ExecutionTaskLog from) {
if (from == null) {
return null;
}
ExecutionLogRestRep to = new ExecutionLogRestRep();
to.setDate(from.getDate());
to.setLevel(from.getLevel());
to.setMessage(from.getMessage());
to.setPhase(from.getPhase());
to.setStackTrace(from.getStackTrace());
to.setDetail(from.getDetail());
to.setElapsed(from.getElapsed());
to.setLastUpdated(from.getLastUpdated());
return to;
}
Aggregations