Skip to content

Commit

Permalink
fixes added
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav-b-7 committed Feb 4, 2021
1 parent e3a72db commit b8c7c2c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.netflix.spinnaker.gate.controllers

import com.google.gson.Gson
import com.netflix.spinnaker.gate.config.ServiceConfiguration
import com.netflix.spinnaker.gate.model.ApprovalGateTriggerResponseModel
import com.netflix.spinnaker.gate.services.internal.OpsmxVisibilityService
Expand Down Expand Up @@ -87,7 +88,7 @@ class OpsmxVisibilityController {
@ApiOperation(value = "Endpoint for visibility rest services")
@RequestMapping(value = "/v2/approvalGates/{id}/trigger", method = RequestMethod.POST)
@ResponseBody Object triggerV2ApprovalGate(@PathVariable("id") Integer id,
@RequestBody(required = false) Object data) {
@RequestBody(required = false) Object data) throws Exception {

Response response = opsmxVisibilityService.triggerV2ApprovalGate(id, data)
InputStream inputStream = null
Expand All @@ -107,8 +108,10 @@ class OpsmxVisibilityController {
//ApprovalGateTriggerResponseModel responseBody = response.getBody().asType(ApprovalGateTriggerResponseModel.class)
// return new ResponseEntity<String>(responseBody, headers, HttpStatus.valueOf(response.getStatus()))
//return new ResponseEntity(responseBody, headers, HttpStatus.valueOf(response.getStatus()))
//return ResponseEntity.accepted().headers(headers).body(responseBody)
return responseBody
Gson gson = new Gson()
String responsePayload = gson.toJson(responseBody, String.class)
return ResponseEntity.ok().headers(headers).body(responsePayload)

}catch(Exception e){
log.error("Exception occured while invoking the trigger API ::::::::::::::::::::::::::::: "+ e)
}
Expand Down

0 comments on commit b8c7c2c

Please sign in to comment.