Skip to content

Commit

Permalink
service - health
Browse files Browse the repository at this point in the history
  • Loading branch information
surabhi-mahawar committed Aug 8, 2022
1 parent 0275cb1 commit e8a625e
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ public class ServiceStatusController {
@Autowired
private HealthService healthService;

/**
* In use by sunbird team - to check service liveliness & readliness
* @return
* @throws JsonProcessingException
*/
@RequestMapping(value = "/health", method = RequestMethod.GET, produces = { "application/json", "text/json" })
public ResponseEntity<ApiResponse> statusCheck() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
JsonNode resultNode = mapper.readTree("{\"healthy\":true}");

ApiResponse response = ApiResponse.builder()
.id("api.service.health.cassandra")
.params(ApiResponseParams.builder().build())
.responseCode(HttpStatus.OK.name())
.result(resultNode)
.build();

return ResponseEntity.ok(response);
}

@RequestMapping(value = "/health/cassandra", method = RequestMethod.GET, produces = { "application/json", "text/json" })
public ResponseEntity<ApiResponse> cassandraStatusCheck() throws IOException, JsonProcessingException {
ApiResponse response = ApiResponse.builder()
Expand Down

0 comments on commit e8a625e

Please sign in to comment.