Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(orca): expose execution log endpoint #383

Merged
merged 1 commit into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down