diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy index a3accf3dea..324a248622 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy @@ -70,7 +70,10 @@ class OpsmxAutopilotController { @GetMapping(value = "/canaries/debugLogsData", produces = "application/zip") @ResponseBody Object downloadDebugData(@RequestParam(value = "id", required = false) Integer canaryId){ log.info("*************** Download debug data API invoked ***********************************") - return opsmxAutopilotService.downloadDebugData(canaryId) + Response response = opsmxAutopilotService.downloadDebugData(canaryId) + log.info("Response received status : {} and reason : {}", response.getStatus(), response.getReason()) + byte [] zipFile = IOUtils.toByteArray(body.getBody().in()) + return zipFile //return response.asType(Byte[].class) //return IOUtils.toByteArray(body.getBody().in()) } diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy index 0f948e16f4..ccd5d1e985 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/services/internal/OpsmxAutopilotService.groovy @@ -23,12 +23,13 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RequestParam import retrofit.Callback +import retrofit.client.Response import retrofit.http.* interface OpsmxAutopilotService { @GET("/autopilot/canaries/debugLogsData") - byte[] downloadDebugData(@Query("id") Integer canaryId) + Response downloadDebugData(@Query("id") Integer canaryId) @GET("/autopilot/{type}/{source}") Object getAutoResponse(@Path('type') String type,