summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>2022-10-10 15:12:40 +0100
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>2022-10-10 15:12:40 +0100
commitf4a8123b59f3914aae65eb81d64a15dd9d31cbed (patch)
treecb618d24d575b2cb233f16ed47883b7bd2057a20
parent9e7b5161c1fad7c8d3bd7b150a70e1e4b1e0213b (diff)
Make the ACM REST endpoint preamble configurable via spring
ACM REST endpoint preamble "/onap/policy/clamp/acm/" needs to be configurable by the user via spring boot properties file. Issue-ID: POLICY-4381 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I1a82b22bb7b06f856d09089204d79dcfccb528a8
-rw-r--r--packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml2
-rw-r--r--runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/web/AbstractRestController.java2
-rw-r--r--runtime-acm/src/main/resources/application.yaml2
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/rest/CommonRestController.java5
-rw-r--r--runtime-acm/src/test/resources/application-test.yaml4
5 files changed, 12 insertions, 3 deletions
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml
index d3d9ed0c2..8efca9713 100644
--- a/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml
+++ b/packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml
@@ -31,6 +31,8 @@ security:
enable-csrf: false
server:
+ servlet:
+ context-path: /onap/policy/clamp/acm
port: 6969
error:
path: /error
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/web/AbstractRestController.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/web/AbstractRestController.java
index 107de58c9..575111612 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/web/AbstractRestController.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/main/web/AbstractRestController.java
@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
* Common superclass to provide REST endpoints for the participant simulator.
*/
// @formatter:off
-@RequestMapping(value = "/onap/policy/clamp/acm/v2",
+@RequestMapping(value = "/v2",
produces = {MediaType.APPLICATION_JSON, AbstractRestController.APPLICATION_YAML})
@Api(value = "Automation Composition Commissioning API")
@SwaggerDefinition(
diff --git a/runtime-acm/src/main/resources/application.yaml b/runtime-acm/src/main/resources/application.yaml
index 21c754c1a..6dbaa3a11 100644
--- a/runtime-acm/src/main/resources/application.yaml
+++ b/runtime-acm/src/main/resources/application.yaml
@@ -32,6 +32,8 @@ security:
server:
port: 6969
+ servlet:
+ context-path: /onap/policy/clamp/acm
error:
path: /error
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/rest/CommonRestController.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/rest/CommonRestController.java
index 89d956aea..eb2abd06d 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/rest/CommonRestController.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/util/rest/CommonRestController.java
@@ -44,6 +44,7 @@ public class CommonRestController {
public static final String SELF = NetworkUtil.getHostname();
public static final String CONTEXT_PATH = "onap/policy/clamp/acm";
public static final String ENDPOINT_PREFIX = CONTEXT_PATH + "/v2/";
+ public static final String ACTUATOR_ENDPOINT = CONTEXT_PATH + "/";
private static String httpPrefix;
@@ -76,7 +77,7 @@ public class CommonRestController {
* @return a request builder
*/
protected Invocation.Builder sendActRequest(final String endpoint) {
- return sendFqeRequest(httpPrefix + endpoint, true);
+ return sendFqeRequest(httpPrefix + ACTUATOR_ENDPOINT + endpoint, true);
}
/**
@@ -96,7 +97,7 @@ public class CommonRestController {
* @return a request builder
*/
protected Invocation.Builder sendNoAuthActRequest(final String endpoint) {
- return sendFqeRequest(httpPrefix + endpoint, false);
+ return sendFqeRequest(httpPrefix + ACTUATOR_ENDPOINT + endpoint, false);
}
/**
diff --git a/runtime-acm/src/test/resources/application-test.yaml b/runtime-acm/src/test/resources/application-test.yaml
index 9d0754a29..2179cdf5e 100644
--- a/runtime-acm/src/test/resources/application-test.yaml
+++ b/runtime-acm/src/test/resources/application-test.yaml
@@ -12,6 +12,10 @@ spring:
hibernate:
dialect: org.hibernate.dialect.HSQLDialect
+server:
+ servlet:
+ context-path: /onap/policy/clamp/acm
+
runtime:
participantParameters:
updateParameters: