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 93f7e92 commit 5292b95
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/uci/inbound/health/ServiceStatusController.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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 {
Expand Down

0 comments on commit 5292b95

Please sign in to comment.