feature(orca): expose execution log endpoint
MODIFY
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PipelineController.groovy
gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/PipelineController.groovy
@@ -28,13 +28,7 @@ import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
-import org.springframework.web.bind.annotation.PathVariable
-import org.springframework.web.bind.annotation.RequestBody
-import org.springframework.web.bind.annotation.RequestMapping
-import org.springframework.web.bind.annotation.RequestMethod
-import org.springframework.web.bind.annotation.RequestParam
-import org.springframework.web.bind.annotation.ResponseStatus
-import org.springframework.web.bind.annotation.RestController
+import org.springframework.web.bind.annotation.*
import retrofit.RetrofitError
@Slf4j
@@ -76,6 +70,17 @@ class PipelineController {
pipelineService.update(id, pipeline)
}
+ @RequestMapping(value = "{id}/logs", method = RequestMethod.GET)
+ List<Map> getPipelineLogs(@PathVariable("id") String id) {
+ try {
+ pipelineService.getPipelineLogs(id)
+ } catch (RetrofitError e) {
+ if (e.response?.status == 404) {
+ throw new PipelineNotFoundException()
+ }
+ }
+ }
+
@RequestMapping(value = "{id}/cancel", method = RequestMethod.PUT)
Map cancelPipeline(@PathVariable("id") String id,
@RequestParam(required = false) String reason,

MODIFY
gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/PipelineService.groovy
gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/PipelineService.groovy
@@ -91,6 +91,10 @@ class PipelineService {
orcaService.getPipeline(id)
}
+ List<Map> getPipelineLogs(String id) {
+ orcaService.getPipelineLogs(id)
+ }
+
Map cancelPipeline(String id, String reason, boolean force) {
orcaService.cancelPipeline(id, reason, force, "")
}

MODIFY
gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OrcaService.groovy
gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OrcaService.groovy
@@ -68,6 +68,10 @@ interface OrcaService {
@GET("/pipelines/{id}")
Map getPipeline(@Path("id") String id)
+ @Headers("Accept: application/json")
+ @GET("/pipelines/{id}/logs")
+ List<Map> getPipelineLogs(@Path("id") String id)
+
@Headers("Accept: application/json")
@PUT("/pipelines/{id}/cancel")
Map cancelPipeline(@Path("id") String id, @Query("reason") reason, @Query("force") force, @Body String ignored)

feature(orca): expose execution log endpoint