X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Frest%2FHealthCheckRestControllerV1.java;h=09aea85292023d418a671b1d668ecc865c57b836;hb=09191f108632a46862ea7c60023ea5d012a81823;hp=2687a30265e6ff692c952c06c87dd3eab91b06d6;hpb=7c48007486d0d1ee47a5eea81135e49737677155;p=policy%2Fpap.git diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java index 2687a302..09aea852 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019,2021 Nordix Foundation. + * Copyright (C) 2019-2023 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved. * ================================================================================ @@ -22,15 +22,9 @@ package org.onap.policy.pap.main.rest; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Authorization; import lombok.RequiredArgsConstructor; import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** @@ -39,19 +33,12 @@ import org.springframework.web.bind.annotation.RestController; * @author Ram Krishna Verma (ram.krishna.verma@est.tech) */ @RestController -@RequestMapping(path = "/policy/pap/v1") @RequiredArgsConstructor -public class HealthCheckRestControllerV1 extends PapRestControllerV1 { +public class HealthCheckRestControllerV1 extends PapRestControllerV1 implements HealthCheckRestControllerV1Api { private final HealthCheckProvider provider; - @GetMapping("healthcheck") - @ApiOperation(value = "Perform healthcheck", - notes = "Returns healthy status of the Policy Administration component", - response = HealthCheckReport.class, authorizations = @Authorization(value = AUTHORIZATION_TYPE)) - @ApiResponses(value = {@ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE), - @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE), - @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)}) + @Override public ResponseEntity healthcheck() { var report = provider.performHealthCheck(true); return ResponseEntity.status(report.getCode()).body(report);