diff --git a/webroot/common/ui/js/controller.view.config.js b/webroot/common/ui/js/controller.view.config.js index eaef38f16..c4c888fe2 100644 --- a/webroot/common/ui/js/controller.view.config.js +++ b/webroot/common/ui/js/controller.view.config.js @@ -518,7 +518,7 @@ define([ }; self.getVRouterDetailsPageTabs = function (viewConfig) { - return [ + var tabViewConfig = [ { elementId: 'vrouter_detail_tab_id', title: 'Details', @@ -678,24 +678,6 @@ define([ renderOnActivate: true } },{ - elementId: 'vrouter_virtualmachines', - title: 'Instances', - view: "VRouterVirtualMachinesGridView", - viewPathPrefix: - ctwl.VROUTER_VIEWPATH_PREFIX, - app: cowc.APP_CONTRAIL_CONTROLLER, - viewConfig: viewConfig, - tabConfig: { - activate: function(event, ui) { - if ($('#' + ctwl.VROUTER_INSTANCE_GRID_ID).data('contrailGrid')) { - $('#' + ctwl.VROUTER_INSTANCE_GRID_ID). - data('contrailGrid').refreshView(); - } - }, - renderOnActivate: true - } - }, - { elementId: ctwl.VROUTER_CONSOLE_LOGS_VIEW_ID, title: 'Console', view: "NodeConsoleLogsView", @@ -710,8 +692,7 @@ define([ }, renderOnActivate: true } - }, - { + },{ elementId: ctwl.VROUTER_ALARMS_GRID_VIEW_ID, title: 'Alarms', @@ -730,7 +711,30 @@ define([ renderOnActivate: true } } - ] + ]; + var vRouterType = viewConfig['vRouterType']; + if (vRouterType != null && vRouterType.indexOf('hypervisor') > -1 ) { + var instanceTabViewConfig = { + elementId: 'vrouter_virtualmachines', + title: 'Instances', + view: "VRouterVirtualMachinesGridView", + viewPathPrefix: + ctwl.VROUTER_VIEWPATH_PREFIX, + app: cowc.APP_CONTRAIL_CONTROLLER, + viewConfig: viewConfig, + tabConfig: { + activate: function(event, ui) { + if ($('#' + ctwl.VROUTER_INSTANCE_GRID_ID).data('contrailGrid')) { + $('#' + ctwl.VROUTER_INSTANCE_GRID_ID). + data('contrailGrid').refreshView(); + } + }, + renderOnActivate: true + } + }; + tabViewConfig.splice(7,0,instanceTabViewConfig); + } + return tabViewConfig; }; self.getDetailRowInstanceTemplateConfig = function () { return { diff --git a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils.js b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils.js index 28fb80581..8998e31d6 100644 --- a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils.js +++ b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils.js @@ -2635,7 +2635,14 @@ define([ }; self.getUnderlayVRouterParams = function (nodeDetails) { - return { + var vRouterType = JSON.parse(getValueByJsonPath(nodeDetails, + 'more_attributes;ContrailConfig;elements;virtual_router_type', + [])); + //Default type is hypervisor, so we are inserting hypervisor + if (vRouterType.length == 0) { + vRouterType.push('hypervisor'); + } + return { hostname: nodeDetails['name'], ip: getValueByJsonPath(nodeDetails, 'more_attributes;VrouterAgent;self_ip_list;0', @@ -2643,8 +2650,9 @@ define([ introspectPort: getValueByJsonPath(nodeDetails, 'more_attributes;VrouterAgent;sandesh_http_port', - ctwc.DEFAULT_INTROSPECTPORT) - }; + ctwc.DEFAULT_INTROSPECTPORT), + vRouterType: vRouterType.toString() + }; }; self.getMarkersForUnderlay = function () { diff --git a/webroot/monitor/infrastructure/underlay/api/underlay_overlay.api.js b/webroot/monitor/infrastructure/underlay/api/underlay_overlay.api.js index 3521a2f45..0825043ea 100644 --- a/webroot/monitor/infrastructure/underlay/api/underlay_overlay.api.js +++ b/webroot/monitor/infrastructure/underlay/api/underlay_overlay.api.js @@ -139,7 +139,10 @@ function buildvRouterVMTopology (nodeList, appData, callback) opApiServer, null, appData); url = '/analytics/uves/vrouter'; var vrPostData = {}; - vrPostData['cfilt'] = ['VrouterAgent:self_ip_list','VrouterAgent:sandesh_http_port']; + // cfilts are not working for ContrailConfig object, so whole object is there. + // Once it start working need to pass virtual_router_type + vrPostData['cfilt'] = ['VrouterAgent:self_ip_list', + 'VrouterAgent:sandesh_http_port', 'ContrailConfig:elements']; commonUtils.createReqObj(dataObjArr, url, global.HTTP_REQUEST_POST, vrPostData, opApiServer, null, appData); var vmiUrl = '/analytics/uves/virtual-machine-interface'; @@ -228,7 +231,7 @@ function buildTopology (req, appData, callback) for (var i = 0; i < vrCnt; i++) { try { tmpVRouterObjs[vrData[i]['name']] = - vrData[i]['value']['VrouterAgent']; + vrData[i]['value']; } catch(e) { continue; } @@ -239,7 +242,9 @@ function buildTopology (req, appData, callback) phyTopo['nodes'][i]['node_type']) { if (null != tmpVRouterObjs[phyTopo['nodes'][i]['name']]) { phyTopo['nodes'][i]['more_attributes']['VrouterAgent'] - = tmpVRouterObjs[phyTopo['nodes'][i]['name']]; + = tmpVRouterObjs[phyTopo['nodes'][i]['name']]['VrouterAgent']; + phyTopo['nodes'][i]['more_attributes']['ContrailConfig'] + = tmpVRouterObjs[phyTopo['nodes'][i]['name']]['ContrailConfig']; } } } diff --git a/webroot/monitor/networking/api/network.mon.api.js b/webroot/monitor/networking/api/network.mon.api.js index feddde3ef..c5d01e8e7 100644 --- a/webroot/monitor/networking/api/network.mon.api.js +++ b/webroot/monitor/networking/api/network.mon.api.js @@ -1453,6 +1453,9 @@ function getInstanceDetailsForVRouter (req, res, appData) { return; } ); + } else { + commonUtils.handleJSONResponse(null, res, resultJSON); + return; } }); }