From 6191d41c8d8ee20f0388172faf57e2bf8bbf8862 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Mon, 16 Sep 2024 15:42:30 +0100 Subject: Policy Executor API: Add Prefix in Yaml - Remove servers from yaml. - Add prefix to path in yaml. - Remove basepath prefix from Controller Impl. - Added policy server port to 8093. - Exposed docker env. vars for policy services. Issue-ID: CPS-2291 Change-Id: Idcc9e23f9d63bad2480537dc8d39523fe82b4b83 Signed-off-by: ToineSiebelink Signed-off-by: sourabh_sourabh --- .../onap/cps/ncmp/impl/data/policyexecutor/PolicyExecutor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cps-ncmp-service/src') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/PolicyExecutor.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/PolicyExecutor.java index b3aa848394..96771e30f1 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/PolicyExecutor.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/data/policyexecutor/PolicyExecutor.java @@ -121,7 +121,6 @@ public class PolicyExecutor { "Invalid Json: " + changeRequestAsJson); } } - final Map request = new HashMap<>(2); request.put("schema", getAssociatedPolicyDataSchemaName(operationType)); request.put("data", data); @@ -144,7 +143,7 @@ public class PolicyExecutor { final String authorization, final String resourceIdentifier, final String changeRequestAsJson) { - final String serviceBaseUrl = serverAddress + ":" + serverPort; + final Map requestAsMap = getSingleRequestAsMap(yangModelCmHandle, operationType, @@ -154,8 +153,9 @@ public class PolicyExecutor { final Object bodyAsObject = createBodyAsObject(Collections.singletonList(requestAsMap)); final UrlTemplateParameters urlTemplateParameters = RestServiceUrlTemplateBuilder.newInstance() - .fixedPathSegment("execute") - .createUrlTemplateParameters(serviceBaseUrl, ""); + .fixedPathSegment("execute") + .createUrlTemplateParameters(String.format("%s:%s", serverAddress, serverPort), + "policy-executor/api"); return policyExecutorWebClient.post() .uri(urlTemplateParameters.urlTemplate(), urlTemplateParameters.urlVariables()) -- cgit 1.2.3-korg