Skip to content

Commit

Permalink
Added some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav-b-7 committed Jan 6, 2021
1 parent 1c54df7 commit 0d9ab71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0d9ab71

Please sign in to comment.