use of pipelite.controller.api.info.StageInfo in project pipelite by enasequence.
the class StageController method stages.
@GetMapping("/{pipelineName}/{processId}")
@ResponseStatus(HttpStatus.OK)
@Operation(description = "Process stages")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "500", description = "Internal Server error") })
public List<StageInfo> stages(@PathVariable(value = "pipelineName") String pipelineName, @PathVariable(value = "processId") String processId) {
List<StageInfo> list = new ArrayList<>();
AtomicReference<Process> process = new AtomicReference<>();
try {
RegisteredPipeline registeredPipeline = registeredPipelineService.getRegisteredPipeline(pipelineName);
ProcessBuilder processBuilder = new ProcessBuilder(processId);
registeredPipeline.configureProcess(processBuilder);
process.set(processBuilder.build());
} catch (Exception ex) {
log.atSevere().withCause(ex).log(ex.getMessage());
}
stageService.getSavedStages(pipelineName, processId).forEach(stageEntity -> list.add(getStage(stageEntity, process.get())));
return list;
}
Aggregations