aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider
diff options
context:
space:
mode:
authorSmokowski, Kevin (ks6305) <ks6305@att.com>2018-03-13 19:13:19 +0000
committerSmokowski, Kevin (ks6305) <ks6305@att.com>2018-03-13 19:13:19 +0000
commit5146216d32145407e91dee490e5d1f4ccb56e0bb (patch)
tree4749b3ed263a6d727177a424ca52d0bc3c74bd3f /restapi-call-node/provider
parent3fc57645ddea0895cbd0a902c81549f0606161f7 (diff)
add request body param
allow request body to be passed into rest api call node Change-Id: I14a79fccb8dc3e29f2ec487bb6ba2f8021a0e498 Issue-ID: CCSDK-210 Signed-off-by: Smokowski, Kevin (ks6305) <ks6305@att.com>
Diffstat (limited to 'restapi-call-node/provider')
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java1
-rw-r--r--restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java3
2 files changed, 4 insertions, 0 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 1eed09e9..47bb655f 100644
--- 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
@@ -43,4 +43,5 @@ public class Parameters {
public String customHttpHeaders;
public String partner;
public Boolean dumpHeaders;
+ public String requestBody;
}
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 572b2042..e5c18596 100644
--- 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
@@ -131,6 +131,8 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
if (p.templateFileName != null) {
String reqTemplate = readFile(p.templateFileName);
req = buildXmlJsonRequest(ctx, reqTemplate, p.format);
+ } else if (p.requestBody != null) {
+ req = p.requestBody;
}
r = sendHttpRequest(req, p);
setResponseStatus(ctx, p.responsePrefix, r);
@@ -209,6 +211,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
protected Parameters getParameters(Map<String, String> paramMap) throws SvcLogicException {
Parameters p = new Parameters();
p.templateFileName = parseParam(paramMap, "templateFileName", false, null);
+ p.requestBody = parseParam(paramMap, "requestBody", false, null);
p.restapiUrl = parseParam(paramMap, "restapiUrl", true, null);
validateUrl(p.restapiUrl);
p.restapiUser = parseParam(paramMap, "restapiUser", false, null);