Search in sources :

Example 1 with LogInfo

use of pipelite.controller.api.info.LogInfo in project pipelite by enasequence.

the class LogController method logs.

@GetMapping("/{pipelineName}/{processId}/{stageName}")
@ResponseStatus(HttpStatus.OK)
@Operation(description = "Process logs")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "500", description = "Internal Server error") })
public LogInfo logs(@PathVariable(value = "pipelineName") String pipelineName, @PathVariable(value = "processId") String processId, @PathVariable(value = "stageName") String stageName) {
    LogInfo logInfo = new LogInfo();
    Optional<StageLogEntity> stageLogEntity = stageService.getSavedStageLog(pipelineName, processId, stageName);
    if (stageLogEntity.isPresent()) {
        logInfo.setLog(stageLogEntity.get().getStageLog());
    }
    return logInfo;
}
Also used : LogInfo(pipelite.controller.api.info.LogInfo) StageLogEntity(pipelite.entity.StageLogEntity) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

Operation (io.swagger.v3.oas.annotations.Operation)1 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)1 LogInfo (pipelite.controller.api.info.LogInfo)1 StageLogEntity (pipelite.entity.StageLogEntity)1