16 package org.openkilda.northbound.controller;
18 import io.swagger.annotations.Api;
19 import io.swagger.annotations.ApiOperation;
20 import io.swagger.annotations.ApiResponse;
21 import io.swagger.annotations.ApiResponses;
25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory;
27 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.context.annotation.PropertySource;
29 import org.springframework.http.HttpHeaders;
30 import org.springframework.http.HttpStatus;
31 import org.springframework.http.MediaType;
32 import org.springframework.http.ResponseEntity;
33 import org.springframework.web.bind.annotation.RequestMapping;
34 import org.springframework.web.bind.annotation.RequestMethod;
35 import org.springframework.web.bind.annotation.RestController;
41 @PropertySource(
"classpath:northbound.properties")
60 @ApiOperation(
value =
"Gets health-check status", response =
HealthCheck.class)
61 @ApiResponses(
value = {
62 @ApiResponse(code = 200, response =
HealthCheck.class, message =
"Operation is successful"),
63 @ApiResponse(code = 401, response =
MessageError.class, message =
"Unauthorized"),
64 @ApiResponse(code = 403, response =
MessageError.class, message =
"Forbidden"),
65 @ApiResponse(code = 404, response =
MessageError.class, message =
"Not found"),
66 @ApiResponse(code = 503, response =
MessageError.class, message =
"Service unavailable")})
67 @RequestMapping(
value =
"/health-check",
68 method = RequestMethod.GET,
69 produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
71 logger.debug(
"getHealthCheck");
73 HealthCheck healthCheck = healthCheckService.getHealthCheck();
76 return new ResponseEntity<>(healthCheck,
new HttpHeaders(),
status);
ResponseEntity< HealthCheck > getHealthCheck()
boolean hasNonOperational()