Skip to content

Commit

Permalink
feat(v2-canary): add application query param to config list endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeach committed Oct 27, 2017
1 parent c43ebf5 commit beadc6e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ 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

@RestController
Expand All @@ -36,8 +37,8 @@ class V2CanaryConfigController {

@ApiOperation(value = "Retrieve a list of canary configurations")
@RequestMapping(method = RequestMethod.GET)
List getCanaryConfigs() {
canaryConfigService.getCanaryConfigs()
List getCanaryConfigs(@RequestParam(value = "application", required = false) String application) {
canaryConfigService.getCanaryConfigs(application)
}

@ApiOperation(value = "Retrieve a canary configuration by id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.netflix.spinnaker.gate.services

interface CanaryConfigService {
List getCanaryConfigs()
List getCanaryConfigs(String application)
Map getCanaryConfig(String id)
String createCanaryConfig(Map config)
String updateCanaryConfig(String id, Map config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class KayentaCanaryConfigService implements CanaryConfigService {
@Autowired
KayentaService kayentaService

List getCanaryConfigs() {
List getCanaryConfigs(String application) {
HystrixFactory.newListCommand(GROUP, "getCanaryConfigs") {
kayentaService.getCanaryConfigs()
kayentaService.getCanaryConfigs(application)
} execute()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface KayentaService {
List getCredentials()

@GET("/canaryConfig")
List getCanaryConfigs()
List getCanaryConfigs(@Query("application") String application)

@GET("/canaryConfig/{id}")
Map getCanaryConfig(@Path("id") String id)
Expand Down

0 comments on commit beadc6e

Please sign in to comment.