use of com.emc.vipr.model.catalog.OrderLogRestRep in project coprhd-controller by CoprHD.
the class OrderTextCreator method map.
public static OrderLogRestRep map(ExecutionLog from) {
if (from == null) {
return null;
}
OrderLogRestRep to = new OrderLogRestRep();
to.setDate(from.getDate());
to.setLevel(from.getLevel());
to.setMessage(from.getMessage());
to.setPhase(from.getPhase());
to.setStackTrace(from.getStackTrace());
return to;
}
use of com.emc.vipr.model.catalog.OrderLogRestRep in project coprhd-controller by CoprHD.
the class OrderMapper method toOrderLogList.
public static OrderLogList toOrderLogList(List<ExecutionLog> executionLogs) {
OrderLogList list = new OrderLogList();
for (ExecutionLog executionLog : executionLogs) {
OrderLogRestRep orderLogRestRep = map(executionLog);
list.getOrderLogs().add(orderLogRestRep);
}
return list;
}
use of com.emc.vipr.model.catalog.OrderLogRestRep 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.OrderLogRestRep 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;
}
Aggregations