aboutsummaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js
diff options
context:
space:
mode:
authorSeshu-Kumar-M <seshu.kumar.m@huawei.com>2016-10-05 19:15:31 +0800
committerSeshu-Kumar-M <seshu.kumar.m@huawei.com>2016-10-05 19:19:49 +0800
commit80d4beebf2e74a07a9b118f9139f713906187819 (patch)
tree9470caaa84e1961d358c06fddd6938ebea958899 /openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js
parent0443c850719d9059906ed8b1c844265f1ac104cb (diff)
Dynamic config for the server IP and port
Change-Id: I49d1f9bbbfb1b69765cf87c1250e9a76cefa5f1d Signed-off-by: Seshu-Kumar-M <seshu.kumar.m@huawei.com>
Diffstat (limited to 'openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js')
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js
index 735ccb8e..6a2a8bf1 100644
--- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js
+++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js
@@ -13,9 +13,15 @@
* limitations under the License.
*/
+var url = {};
+$.getJSON("./conf/dataconfig.json", function (jsonData){
+ url.overlay = jsonData.url +":"+ jsonData.port + "/org.openo.sdno.overlayvpnservice";
+ url.underlay = jsonData.url +":"+ jsonData.port + "/org.openo.sdno.l3vpnservice";
+ console.log("URL = " + JSON.stringify(url));
+});
function loadUnderlayData() {
- var requestUrl = "http://localhost:8080/org.openo.sdno.l3vpnservice/openoapi/sdnol3vpn/v1/l3vpns";
+ var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns";
$
.ajax({
type: "GET",
@@ -26,12 +32,12 @@ function loadUnderlayData() {
//TODO: Update the table
},
error: function (xhr, ajaxOptions, thrownError) {
- alert("Error on getting underlay data : " + xhr.responseText);
+ //alert("Error on getting underlay data : " + xhr.responseText);
}
});
}
function deleteUnderlayData(objectId) {
- var requestUrl = "http://localhost:8080/org.openo.sdno.l3vpnservice/openoapi/sdnol3vpn/v1/l3vpns/" + objectId;
+ var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns/" + objectId;
$
.ajax({
type: "DELETE",
@@ -47,7 +53,7 @@ function deleteUnderlayData(objectId) {
});
}
function loadOverlayData() {
- var requestUrl = "http://localhost:8080/org.openo.sdno.overlayvpnservice/openoapi/sdnooverlayvpn/v1/site2dc-vpn";
+ var requestUrl = url.overlay + "/openoapi/sdnooverlayvpn/v1/site2dc-vpn";
$
.ajax({
type: "GET",
@@ -58,7 +64,7 @@ function loadOverlayData() {
//TODO: Update the table
},
error: function (xhr, ajaxOptions, thrownError) {
- alert("Error on getting Overlayvpn data : " + xhr.responseText);
+ //alert("Error on getting Overlayvpn data : " + xhr.responseText);
}
});
}
@@ -85,7 +91,7 @@ $(function () {
var formData = JSON.stringify($("#underlayForm").serializeObject());
alert(formData);
var jsonobj = JSON.parse(formData);
- var requestUrl = "http://localhost:8080/org.openo.sdno.l3vpnservice/openoapi/sdnol3vpn/v1/l3vpns";
+ var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns";
$
.ajax({
type: "POST",