From 708fd6615c97756eade415a6295b1fb663e4d3ef Mon Sep 17 00:00:00 2001 From: Ruslan Kashapov Date: Thu, 21 Jan 2021 09:37:05 +0200 Subject: Enable log level management via actuator, /cps/api path to use for REST controllers only only Issue-ID: CPS-158 Change-Id: I1f9ff4429f331ca4204d1acaf73ac896a68994d0 Signed-off-by: Ruslan Kashapov --- .../java/org/onap/cps/rest/controller/AdminRestController.java | 2 ++ .../java/org/onap/cps/rest/controller/DataRestController.java | 2 ++ cps-rest/src/main/resources/application.yml | 10 ++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'cps-rest/src/main') diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java index 08020eca2a..1b6f56a211 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java @@ -33,10 +33,12 @@ import org.onap.cps.spi.model.SchemaSet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @RestController +@RequestMapping("${rest.api.base-path}") public class AdminRestController implements CpsAdminApi { @Autowired diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index fcb8ddc1c1..2ecbd4f544 100644 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -25,10 +25,12 @@ import org.onap.cps.api.CpsAdminService; import org.onap.cps.rest.api.CpsDataApi; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @RestController +@RequestMapping("${rest.api.base-path}") public class DataRestController implements CpsDataApi { @Autowired diff --git a/cps-rest/src/main/resources/application.yml b/cps-rest/src/main/resources/application.yml index e8af0bcfb2..b50a92662b 100644 --- a/cps-rest/src/main/resources/application.yml +++ b/cps-rest/src/main/resources/application.yml @@ -1,7 +1,9 @@ server: port: 8080 - servlet: - context-path: /api/cps + +rest: + api: + base-path: /cps/api spring: main: @@ -27,12 +29,16 @@ management: endpoints: web: base-path: /manage + exposure: + include: health,info,loggers endpoint: health: show-details: always # kubernetes probes: liveness and readiness probes: enabled: true + looging: + enabled: true logging: level: -- cgit 1.2.3-korg