Skip to content

Commit

Permalink
Merge pull request #93 from spinnaker/end-canary-feature
Browse files Browse the repository at this point in the history
End canary feature
  • Loading branch information
sthadeshwar committed May 19, 2015
2 parents bf7ed11 + 79f40f3 commit 8c48a87
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ class CanaryController {
canaryService.showCanary(id)
}

@RequestMapping(value = "/canaries/{id:.+}/overrideCanaryResult/{result}", method = RequestMethod.PUT)
Map overrideCanaryResult(
@PathVariable String id, @PathVariable String result, @RequestBody OverrideResultCommand command) {
canaryService.overrideCanaryResult(id, result, command.reason)
@RequestMapping(value = "/canaries/{id:.+}/end", method = RequestMethod.DELETE)
Map endCanary(@PathVariable String id, @RequestBody OverrideResultCommand command) {
canaryService.endCanary(id, command.result, command.reason)
}

static class GenerateResultCommand {
Expand All @@ -69,5 +68,6 @@ class CanaryController {

static class OverrideResultCommand {
String reason
String result
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class CanaryService {
mineService ? mineService.getCanaryAnalysisHistory(canaryDeploymentId) : []
}

Map overrideCanaryResult(String canaryId, String result, String reason) {
mineService ? mineService.overrideCanaryResult(canaryId, result, reason) : [:]
Map endCanary(String canaryId, String result, String reason) {
mineService ? mineService.endCanary(canaryId, result, reason) : [:]
}

Map showCanary(String canaryId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.netflix.spinnaker.gate.services.internal
import retrofit.client.Response
import retrofit.http.DELETE
import retrofit.http.GET
import retrofit.http.POST
import retrofit.http.PUT
Expand All @@ -40,6 +41,11 @@ public interface MineService {
@Path("result") String result,
@Query("reason") String reason)

@DELETE("/canaries/{id}/end")
Map endCanary(@Path("id") String canaryId,
@Query("result") String result,
@Query("reason") String reason)

@GET("/canaryDeployments/{id}/canaryAnalysisHistory")
List<Map> getCanaryAnalysisHistory(@Path("id") String canaryDeploymentId)

Expand Down

0 comments on commit 8c48a87

Please sign in to comment.