aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java')
-rw-r--r--main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java19
1 files changed, 3 insertions, 16 deletions
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<HealthCheckReport> healthcheck() {
var report = provider.performHealthCheck(true);
return ResponseEntity.status(report.getCode()).body(report);