summaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src
diff options
context:
space:
mode:
authorramu.n <ramu.n@huawei.com>2017-10-17 21:08:02 +0530
committerramu.n <ramu.n@huawei.com>2017-10-17 21:08:02 +0530
commitba4ef5baf9a3661aa4c55d06a38b62b8bb0a00b4 (patch)
tree4667e2a5f2fd7aceccec4cdfb8ee8b390c60dc02 /restapi-call-node/provider/src
parent85e0df60352d2ffa7e63a5a5e570f12cb0b081f4 (diff)
Add JSON template for VoLTE use case
*For ipwan controller first need to get authentication token and add to customHttpHeaders Change-Id: I7be6e75f9712bc2214ee4a1804189162675c8a25 Issue-Id: SDNC-131 Signed-off-by: Ramu N <ramu.n@huawei.com>
Diffstat (limited to 'restapi-call-node/provider/src')
-rw-r--r--restapi-call-node/provider/src/main/resources/actokentemplate.json25
-rw-r--r--restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java24
-rw-r--r--restapi-call-node/provider/src/test/resources/actokentemplate.json25
3 files changed, 72 insertions, 2 deletions
diff --git a/restapi-call-node/provider/src/main/resources/actokentemplate.json b/restapi-call-node/provider/src/main/resources/actokentemplate.json
new file mode 100644
index 000000000..31bf0ee2b
--- /dev/null
+++ b/restapi-call-node/provider/src/main/resources/actokentemplate.json
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+{
+ "userName": ${prop.sdncRestApi.thirdpartySdnc.user},
+ "password": ${prop.sdncRestApi.thirdpartySdnc.password}
+}
diff --git a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
index a84d1509e..2da5b2c83 100644
--- a/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
+++ b/restapi-call-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/restapicall/TestRestapiCallNode.java
@@ -230,6 +230,7 @@ public class TestRestapiCallNode {
ctx.setAttribute("prop.l3vpn.ac1_id", "a8098c1a-f86e-11da-bd1a-00112444be1b");
ctx.setAttribute("prop.l3vpn.ac1-peer-ip", "192.168.1.1");
ctx.setAttribute("prop.l3vpn.ac1-ip", "192.168.1.2");
+ ctx.setAttribute("prop.l3vpn.sna1_svlan", "100");
ctx.setAttribute("prop.l3vpn.ac1_protocol", "static");
ctx.setAttribute("prop.l3vpn.sna1-route.ip-prefix", "192.168.1.1/24");
ctx.setAttribute("prop.l3vpn.sna1-route.next-hop", "192.168.1.4");
@@ -240,10 +241,11 @@ public class TestRestapiCallNode {
ctx.setAttribute("prop.l3vpn.sna2_name", "10000000-0000-0000-0000-000000000007");
ctx.setAttribute("prop.l3vpn.pe2_id", "a8098c1a-f86e-11da-bd1a-00112444be1a");
ctx.setAttribute("prop.l3vpn.ac2_id", "a8098c1a-f86e-11da-bd1a-00112444be1c");
- ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.5");
+ ctx.setAttribute("prop.l3vpn.ac2-peer-ip", "192.168.1.6");
ctx.setAttribute("prop.l3vpn.ac2-ip", "192.168.1.5");
+ ctx.setAttribute("prop.l3vpn.sna2_svlan", "200");
ctx.setAttribute("prop.l3vpn.ac2_protocol", "bgp");
- ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.5");
+ ctx.setAttribute("prop.l3vpn.peer2-ip", "192.168.1.7");
ctx.setAttribute("prop.l3vpn.ac2_protocol_bgp_as", "200");
Map<String, String> p = new HashMap<String, String>();
@@ -360,4 +362,22 @@ public class TestRestapiCallNode {
rcn.sendRequest(p, ctx);
}
+
+ @Test
+ public void testControllerTokenTemplate() throws SvcLogicException {
+ SvcLogicContext ctx = new SvcLogicContext();
+ ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.user", "admin");
+ ctx.setAttribute("prop.sdncRestApi.thirdpartySdnc.password", "admin123");
+
+ Map<String, String> p = new HashMap<String, String>();
+ p.put("templateFileName", "src/test/resources/actokentemplate.json");
+ p.put("restapiUrl", "https://ipwan:18002/controller/v2/tokens");
+ p.put("format", "json");
+ p.put("httpMethod", "post");
+ p.put("responsePrefix", "restapi-result");
+ p.put("skipSending", "true");
+
+ RestapiCallNode rcn = new RestapiCallNode();
+ rcn.sendRequest(p, ctx);
+ }
}
diff --git a/restapi-call-node/provider/src/test/resources/actokentemplate.json b/restapi-call-node/provider/src/test/resources/actokentemplate.json
new file mode 100644
index 000000000..31bf0ee2b
--- /dev/null
+++ b/restapi-call-node/provider/src/test/resources/actokentemplate.json
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : SDN-C
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+{
+ "userName": ${prop.sdncRestApi.thirdpartySdnc.user},
+ "password": ${prop.sdncRestApi.thirdpartySdnc.password}
+}