This repository was archived by the owner on May 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 6666import org .springframework .web .bind .annotation .ResponseStatus ;
6767import org .springframework .web .bind .annotation .RestController ;
6868
69+ import static org .springframework .hateoas .server .mvc .WebMvcLinkBuilder .linkTo ;
70+ import static org .springframework .hateoas .server .mvc .WebMvcLinkBuilder .methodOn ;
71+
6972/**
7073 * Controller for operations on
7174 * {@link org.springframework.cloud.task.repository.TaskExecution}. This includes
7780 * @author Christian Tzolov
7881 * @author David Turanski
7982 * @author Gunnar Hillert
83+ * @author Corneil du Plessis
8084 */
8185@ RestController
8286@ RequestMapping ("/tasks/executions" )
@@ -339,12 +343,16 @@ public Assembler() {
339343
340344 @ Override
341345 public TaskExecutionResource toModel (TaskJobExecutionRel taskJobExecutionRel ) {
342- return createModelWithId (taskJobExecutionRel .getTaskExecution ().getExecutionId (), taskJobExecutionRel );
346+ TaskExecutionResource resource = createModelWithId (taskJobExecutionRel .getTaskExecution ().getExecutionId (), taskJobExecutionRel );
347+ resource .add (linkTo (methodOn (TaskLogsController .class ).getLog (resource .getExternalExecutionId (), resource .getPlatformName ())).withRel ("tasks/logs" ));
348+ return resource ;
343349 }
344350
345351 @ Override
346352 public TaskExecutionResource instantiateModel (TaskJobExecutionRel taskJobExecutionRel ) {
347- return new TaskExecutionResource (taskJobExecutionRel );
353+ TaskExecutionResource resource = new TaskExecutionResource (taskJobExecutionRel );
354+ resource .add (linkTo (methodOn (TaskLogsController .class ).getLog (resource .getExternalExecutionId (), resource .getPlatformName ())).withRel ("tasks/logs" ));
355+ return resource ;
348356 }
349357 }
350358
You can’t perform that action at this time.
0 commit comments