Search in sources :

Example 1 with OrderLogRestRep

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;
}
Also used : OrderLogRestRep(com.emc.vipr.model.catalog.OrderLogRestRep)

Example 2 with OrderLogRestRep

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;
}
Also used : ExecutionLog(com.emc.storageos.db.client.model.uimodels.ExecutionLog) OrderLogList(com.emc.vipr.model.catalog.OrderLogList) OrderLogRestRep(com.emc.vipr.model.catalog.OrderLogRestRep)

Example 3 with OrderLogRestRep

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));
}
Also used : ExecutionStateRestRep(com.emc.vipr.model.catalog.ExecutionStateRestRep) OrderLogRestRep(com.emc.vipr.model.catalog.OrderLogRestRep) ViPRCatalogClient2(com.emc.vipr.client.ViPRCatalogClient2) ExecutionLogRestRep(com.emc.vipr.model.catalog.ExecutionLogRestRep)

Example 4 with OrderLogRestRep

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;
}
Also used : ExecutionTaskInfo(com.emc.vipr.model.catalog.ExecutionTaskInfo) OrderLogRestRep(com.emc.vipr.model.catalog.OrderLogRestRep) ExecutionInfo(com.emc.vipr.model.catalog.ExecutionInfo) ExecutionLogInfo(com.emc.vipr.model.catalog.ExecutionLogInfo) ExecutionLogRestRep(com.emc.vipr.model.catalog.ExecutionLogRestRep)

Aggregations

OrderLogRestRep (com.emc.vipr.model.catalog.OrderLogRestRep)4 ExecutionLogRestRep (com.emc.vipr.model.catalog.ExecutionLogRestRep)2 ExecutionLog (com.emc.storageos.db.client.model.uimodels.ExecutionLog)1 ViPRCatalogClient2 (com.emc.vipr.client.ViPRCatalogClient2)1 ExecutionInfo (com.emc.vipr.model.catalog.ExecutionInfo)1 ExecutionLogInfo (com.emc.vipr.model.catalog.ExecutionLogInfo)1 ExecutionStateRestRep (com.emc.vipr.model.catalog.ExecutionStateRestRep)1 ExecutionTaskInfo (com.emc.vipr.model.catalog.ExecutionTaskInfo)1 OrderLogList (com.emc.vipr.model.catalog.OrderLogList)1