Added subscriber S/C tags
diff --git a/views/ngXosViews/diagnostic/src/index.html b/views/ngXosViews/diagnostic/src/index.html
index eacbfe1..34deef6 100644
--- a/views/ngXosViews/diagnostic/src/index.html
+++ b/views/ngXosViews/diagnostic/src/index.html
@@ -33,6 +33,7 @@
 <script src="/api/ng-xos.js"></script>
 <script src="/api/ng-hpcapi.js"></script>
 <script src="/.tmp/main.js"></script>
+<script src="/.tmp/subscriber_service.js"></script>
 <script src="/.tmp/subscriber-modal.js"></script>
 <script src="/.tmp/serviceTopologyHelper.js"></script>
 <script src="/.tmp/serviceTopology.js"></script>
diff --git a/views/ngXosViews/diagnostic/src/js/diagnostic.js b/views/ngXosViews/diagnostic/src/js/diagnostic.js
index c9787ba..d65194c 100644
--- a/views/ngXosViews/diagnostic/src/js/diagnostic.js
+++ b/views/ngXosViews/diagnostic/src/js/diagnostic.js
@@ -30,6 +30,10 @@
           ServiceRelation.getBySubscriber(subscriber)
           .then((serviceChain) => {
             this.serviceChain = serviceChain;
+            return Subscribers.getWithDevices({id: subscriber.id}).$promise;
+          })
+          .then((subscriber) => {
+            this.selectedSubscriber = subscriber;
           });
         });
       }
diff --git a/views/ngXosViews/diagnostic/src/js/logicTopology.js b/views/ngXosViews/diagnostic/src/js/logicTopology.js
index a3501dd..5ca0b30 100644
--- a/views/ngXosViews/diagnostic/src/js/logicTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/logicTopology.js
@@ -11,7 +11,7 @@
       bindToController: true,
       controllerAs: 'vm',
       templateUrl: 'templates/logicTopology.tpl.html',
-      controller: function($element, $log, $scope, $rootScope, $timeout, d3, LogicTopologyHelper, Node, Tenant, Ceilometer){
+      controller: function($element, $log, $scope, $rootScope, $timeout, d3, LogicTopologyHelper, Node, Tenant, Ceilometer, serviceTopologyConfig){
         $log.info('Logic Plane');
 
         var svg;
@@ -29,8 +29,6 @@
         $scope.$watch(() => this.subscribers, (subscribers) => {
           if(subscribers){
 
-            // LogicTopologyHelper.addSubscribers(angular.copy(subscribers));
-
             Node.queryWithInstances().$promise
             .then((computeNodes) => {
               LogicTopologyHelper.addComputeNodes(computeNodes);
@@ -43,6 +41,17 @@
         $scope.$watch(() => this.selected, (selected) => {
           if(selected){
             $log.info(`Update logic layer for subscriber ${selected.humanReadableName}`);
+            
+            // append the device with to config settings
+            serviceTopologyConfig.elWidths.push(160);
+
+            LogicTopologyHelper.addSubscriber(angular.copy(selected));
+
+            Tenant.getSubscriberTag({subscriber_root: selected.id}).$promise
+            .then((tags) => {
+              LogicTopologyHelper.addSubscriberTag(tags);
+              LogicTopologyHelper.updateTree(svg);
+            })
           }
         });
 
@@ -57,6 +66,10 @@
 
         $rootScope.$on('instance.detail', (evt, service) => {
 
+          // NOTE consider if subscriber is selected or not,
+          // if not select instances
+          // else select containers (and follow subscriber chain to find the correct instance)
+
           let param = {
             'service_vsg': {kind: 'vCPE'},
             'service_vbng': {kind: 'vBNG'},
@@ -69,6 +82,7 @@
             return Ceilometer.getInstancesStats(instances);
           })
           .then((instances) => {
+            console.log(instances);
             this.hideInstanceStats = false;
             // HACK if array is empty wait for animation
             if(instances.length === 0){
@@ -97,7 +111,6 @@
           $scope.$apply();
         };
 
-
         // listen for subscriber modal event
         $rootScope.$on('subscriber.modal.open', () => {
           this.openSubscriberModal();
diff --git a/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js b/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
index f860d9e..f17b103 100644
--- a/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/logicTopologyHelper.js
@@ -136,6 +136,7 @@
         });
 
       // TODO handle node remove
+      var nodeExit = node.exit().remove();
     };
 
     /**
@@ -164,6 +165,8 @@
       link.transition()
         .duration(serviceTopologyConfig.duration)
         .attr('d', diagonal);
+
+      link.exit().remove();
     };
 
     /**
@@ -190,6 +193,7 @@
       // Compute the new tree layout.
       [nodes, links] = computeLayout(baseData);
 
+      // console.log(baseData);
       drawNodes(svg, nodes);
       drawLinks(svg, links);
     }
@@ -197,19 +201,28 @@
     /**
     * Add Subscribers to the tree
     */
-    this.addSubscribers = (subscribers) => {
+    this.addSubscriber = (subscriber) => {
 
-      subscribers.map((subscriber) => {
-        subscriber.children = subscriber.devices;
-      });
+
+      subscriber.children = subscriber.devices;
 
       // add subscriber to data tree
-      baseData.children[0].children[0].children[0].children = subscribers;
-      
+      baseData.children[0].children[0].children[0].children = [subscriber];
       return baseData;
     };
 
     /**
+    * Add Subscriber tag to LAN Network
+    */
+   
+    this.addSubscriberTag = (tags) => {
+      baseData.children[0].children[0].children[0].subscriberTag = {
+        cTag: tags.c_tag,
+        sTag: tags.s_tag
+      }
+    };
+
+    /**
     * Add compute nodes to the rack element
     */
    
diff --git a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
index 62e2cdf..94ff406 100644
--- a/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
+++ b/views/ngXosViews/diagnostic/src/js/nodeDrawer.js
@@ -26,6 +26,26 @@
         'text-anchor': 'middle'
       })
       .text(d => d.name)
+
+      nodes.each(function(n){
+        let currentNode = d3.select(this);
+        // cicle trouch node to add Tags and Public IP
+        if(n.name === 'LAN' && angular.isDefined(n.subscriberTag)){
+          currentNode.append('text')
+          .attr({
+            'text-anchor': 'middle',
+            y: 40
+          })
+          .text(() => `C-Tag: ${n.subscriberTag.cTag}`);
+
+          currentNode.append('text')
+          .attr({
+            'text-anchor': 'middle',
+            y: 60
+          })
+          .text(() => `S-Tag: ${n.subscriberTag.sTag}`);
+        }
+      });
     }
 
     this.addRack = (nodes) => {
diff --git a/views/ngXosViews/diagnostic/src/js/rest_services.js b/views/ngXosViews/diagnostic/src/js/rest_services.js
index 885b3de..877b485 100644
--- a/views/ngXosViews/diagnostic/src/js/rest_services.js
+++ b/views/ngXosViews/diagnostic/src/js/rest_services.js
@@ -28,6 +28,16 @@
             return instances;
           }
         }
+      },
+      getSubscriberTag: {
+        method: 'GET',
+        isArray: true,
+        interceptor: {
+          response: (res) => {
+            // NOTE we should receive only one vOLT tenant here
+            return JSON.parse(res.data[0].service_specific_attribute);
+          }
+        }
       }
     });
   })
@@ -127,7 +137,7 @@
     });
   })
   .service('Subscribers', function($resource, $q, SubscriberDevice){
-    return $resource('/xos/subscribers', {id: '@id'}, {
+    return $resource('/xos/subscribers/:id', {id: '@id'}, {
       queryWithDevices: {
         method: 'GET',
         isArray: true,
@@ -138,7 +148,7 @@
             * For each subscriber retrieve devices and append them
             */
 
-            const deferred = $q.defer();
+            let deferred = $q.defer();
 
             let requests = [];
 
@@ -169,6 +179,29 @@
             return deferred.promise;
           }
         }
+      },
+      getWithDevices: {
+        method: 'GET',
+        isArray: false,
+        interceptor: {
+          response: (res) => {
+            let d = $q.defer();
+
+            SubscriberDevice.query({id: res.data.id}).$promise
+            .then(devices => {
+              devices.map(d => d.type = 'device');
+              res.data.devices = devices;
+              res.data.type = 'subscriber';
+              console.log(res.data);
+              d.resolve(res.data);
+            })
+            .catch(err => {
+              d.reject(err);
+            });
+
+            return d.promise;
+          }
+        }
       }
     });
   })
@@ -289,13 +322,20 @@
 
       // TODO refactor
       const buildChild = (services, tenants, currentService) => {
+
+        const response = {
+          type: 'service',
+          name: currentService.humanReadableName,
+          service: currentService
+        };
+
         let tenant = lodash.find(tenants, {subscriber_service: currentService.id});
         if(tenant){
           let next = lodash.find(services, {id: tenant.provider_service});
-          currentService.children = [buildChild(services, tenants, next)];
+          response.children = [buildChild(services, tenants, next)];
         }
         else {
-          currentService.children = [
+          response.children = [
             {
               name: 'Router',
               type: 'router',
@@ -303,9 +343,8 @@
             }
           ]
         }
-        currentService.type = 'service';
         delete currentService.id; // conflict with d3
-        return currentService;
+        return response;
       }
       let baseService = lodash.find(services, {id: 3});
 
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopology.js b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
index 3d602fe..b358abf 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopology.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopology.js
@@ -32,8 +32,6 @@
           const width = el.clientWidth - (serviceTopologyConfig.widthMargin * 2);
           const height = el.clientHeight - (serviceTopologyConfig.heightMargin * 2);
 
-          console.log(el.clientWidth, el.clientHeight);
-
           const treeLayout = d3.layout.tree()
             .size([height, width]);
 
diff --git a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
index 817e79e..47fc5eb 100644
--- a/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
+++ b/views/ngXosViews/diagnostic/src/js/serviceTopologyHelper.js
@@ -225,8 +225,8 @@
         $rootScope.$emit('instance.detail.hide', {});
         return updateTree(_svg, _layout, _source);
       }
-
-      $rootScope.$emit('instance.detail', {name: d.humanReadableName});
+      
+      $rootScope.$emit('instance.detail', {name: d.name});
 
       // unselect all
       _svg.selectAll('circle')