Skip to content

Commit

Permalink
Merge pull request #79 from spinnaker/delete-stuff
Browse files Browse the repository at this point in the history
expose endpoints for deleting tasks/pipelines
  • Loading branch information
anotherchrisberry committed Apr 2, 2015
2 parents bf7a177 + 5b34889 commit db1074f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class PipelineController {
pipelineService.cancelPipeline(id)
}

@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
Map deletePipeline(@PathVariable("id") String id) {
pipelineService.deletePipeline(id);
}

@RequestMapping(value = "/{applicationName}/{pipelineName:.+}", method = RequestMethod.POST)
HttpEntity invokePipelineConfig(@PathVariable("applicationName") String application,
@PathVariable("pipelineName") String pipelineName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class TaskController {
taskService.getTask(id)
}

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
Map deleteTask(@PathVariable("id") String id) {
taskService.deleteTask(id)
}

@RequestMapping(method = RequestMethod.POST)
Map task(@RequestBody Map map) {
taskService.createAppTask(map)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class PipelineService {
orcaService.cancelPipeline(id)
}

Map deletePipeline(String id) {
orcaService.deletePipeline(id)
}

@InheritConstructors
@ResponseStatus(value = HttpStatus.NOT_FOUND, reason = "pipeline config not found!")
static class PipelineConfigNotFoundException extends RuntimeException {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class TaskService {
} execute()
}

Map deleteTask(String id) {
HystrixFactory.newMapCommand(GROUP, "deleteTask", true) {
orcaService.deleteTask(id)
} execute()
}

Map getTaskDetails(String taskDetailsId) {
HystrixFactory.newMapCommand(GROUP, "getTaskDetails", true) {
katoService.getTaskDetails(taskDetailsId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ interface OrcaService {
@GET("/tasks/{id}")
Map getTask(@Path("id") String id)

@Headers("Accept: application/json")
@DELETE("/tasks/{id}")
Map deleteTask(@Path("id") String id)

@Headers("Accept: application/json")
@GET("/tasks")
Map all()
Expand All @@ -48,7 +52,11 @@ interface OrcaService {
@PUT("/pipelines/{id}/cancel")
Map cancelPipeline(@Path("id") String id)

@Headers("Accept: application/json")
@DELETE("/pipelines/{id}")
Map deletePipeline(@Path("id") String id)

@Headers("Accept: application/json")
@POST("/orchestrate")
Map startPipeline(@Body Map pipelineConfig, @Query("user") String user)
}
}

0 comments on commit db1074f

Please sign in to comment.