Skip to content

Commit

Permalink
feat(canary): Adds new canary exec endpoint sans canary config id pat…
Browse files Browse the repository at this point in the history
…h param. (#924)

The old endpoint for getting a canary execution requires a
canary config path param, but doesn't use it in the downstream
Kayenta calls. This change adds a new endpoint without the
canary config path param. We will need to change the callers
to use the new endpoint.
  • Loading branch information
jtk54 authored and Matt Duftler committed Oct 21, 2019
1 parent dd70cd3 commit 581fc3b
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
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.RestController
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping('/v2/canaries')
Expand Down Expand Up @@ -87,14 +82,23 @@ class V2CanaryController {
storageAccountName)
}

@ApiOperation(value = 'Retrieve a canary result')
// TODO: Change callers to the new endpoint sans canary config id in Spinnaker 1.17.x.
@ApiOperation(value = '(DEPRECATED) Retrieve a canary result')
@RequestMapping(value = '/canary/{canaryConfigId}/{canaryExecutionId}', method = RequestMethod.GET)
Map getCanaryResult(@PathVariable String canaryConfigId,
@Deprecated
Map getCanaryResult(@PathVariable String canaryConfigId /* unused */,
@PathVariable String canaryExecutionId,
@RequestParam(value='storageAccountName', required = false) String storageAccountName) {
v2CanaryService.getCanaryResults(canaryExecutionId, storageAccountName)
}

@ApiOperation(value = 'Retrieve a canary result')
@RequestMapping(value = '/canary/{canaryExecutionId}', method = RequestMethod.GET)
Map getCanaryResult(@PathVariable String canaryExecutionId,
@RequestParam(value='storageAccountName', required = false) String storageAccountName) {
v2CanaryService.getCanaryResults(canaryExecutionId, storageAccountName)
}

@ApiOperation(value = 'Retrieve a list of an application\'s canary results')
@RequestMapping(value = '/{application}/executions', method = RequestMethod.GET)
List getCanaryResultsByApplication(@PathVariable String application,
Expand Down

0 comments on commit 581fc3b

Please sign in to comment.