summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>2020-02-20 19:33:15 +0000
committerKevin Smokowski <kevin.smokowski@att.com>2020-02-20 19:34:35 +0000
commita0c94fb457d418da3d49ce003fcecd3f5aaee9b7 (patch)
treef58efc6d0c7db1e68757cd0a4a4e00d7f9815cd4
parentab87c55476acf4e64015086e9cb200d0af181c17 (diff)
rest api call node target entity
rest api call node target entity Issue-ID: CCSDK-2109 Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> Change-Id: Ib754a02cc64862de6518eac2a1c28b9f637616bc
-rwxr-xr-xrestapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java1
-rwxr-xr-xrestapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java10
2 files changed, 8 insertions, 3 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
index 8b9cdc39c..8950df4ce 100755
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java
@@ -54,4 +54,5 @@ public class Parameters {
public String accept;
public boolean multipartFormData;
public String multipartFile;
+ public String targetEntity;
}
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
index b4d7e1ba8..165eefde4 100755
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
@@ -73,8 +73,10 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
import org.onap.logging.filter.base.MetricLogClientFilter;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
public class RestapiCallNode implements SvcLogicJavaPlugin {
@@ -223,6 +225,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
p.accept = parseParam(paramMap, "accept", false, null);
p.multipartFormData = valueOf(parseParam(paramMap, "multipartFormData", false, "false"));
p.multipartFile = parseParam(paramMap, "multipartFile", false, null);
+ p.targetEntity = parseParam(paramMap, "targetEntity", false, null);
return p;
}
@@ -463,10 +466,13 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
protected void sendRequest(Map<String, String> paramMap, SvcLogicContext ctx, RetryPolicy retryPolicy)
throws SvcLogicException {
- HttpResponse r = new HttpResponse();
+ HttpResponse r = new HttpResponse();
try {
handlePartner(paramMap);
Parameters p = getParameters(paramMap, new Parameters());
+ if(p.targetEntity != null && !p.targetEntity.isEmpty()) {
+ MDC.put(ONAPLogConstants.MDCs.TARGET_ENTITY, p.targetEntity);
+ }
if (p.restapiUrl.contains(",") && retryPolicy == null) {
String[] urls = p.restapiUrl.split(",");
retryPolicy = new RetryPolicy(urls, urls.length * 2);
@@ -874,8 +880,6 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
}
}
- invocationBuilder.header("X-ECOMP-RequestID", org.slf4j.MDC.get("X-ECOMP-RequestID"));
-
Response response;
try {