Search in sources :

Example 1 with ExecutionLogRestRep

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

Example 2 with ExecutionLogRestRep

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;
}
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)

Example 3 with ExecutionLogRestRep

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));
}
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 ExecutionLogRestRep

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

Example 5 with ExecutionLogRestRep

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

Aggregations

ExecutionLogRestRep (com.emc.vipr.model.catalog.ExecutionLogRestRep)5 OrderLogRestRep (com.emc.vipr.model.catalog.OrderLogRestRep)2 ExecutionTaskLog (com.emc.storageos.db.client.model.uimodels.ExecutionTaskLog)1 ViPRCatalogClient2 (com.emc.vipr.client.ViPRCatalogClient2)1 ExecutionInfo (com.emc.vipr.model.catalog.ExecutionInfo)1 ExecutionLogInfo (com.emc.vipr.model.catalog.ExecutionLogInfo)1 ExecutionLogList (com.emc.vipr.model.catalog.ExecutionLogList)1 ExecutionStateRestRep (com.emc.vipr.model.catalog.ExecutionStateRestRep)1 ExecutionTaskInfo (com.emc.vipr.model.catalog.ExecutionTaskInfo)1