Understanding how Hyperglance chooses icons

Hyperglance chooses icons based on the 'type' and 'datasource' of nodes. 

Here is an example of a node with type 'Load Balancer' belonging to a datasource called 'Admin':

The relationship between types+datasource and icons is defined in a configuration file:  /opt/wildfly/standalone/deployments/hyperglance.war/assets/topology_icon_mapping.json

This file has the icon bindings for all datasources. For example here are the icon bindings for the 'Admin' datasource:

"Admin": {
   "Access Point": "access-point",
   "Cloud": "cloud",
   "Datacenter": "datacenter",
   "Firewall": "firewall",
   "Laptop": "laptop",
   "Load Balancer": "load_balancer",
   "Network": "network",
   "PC": "pc",
   "Phone": "phone",
   "Pod": "pod",
   "Printer": "printer",
   "Router": "router",
   "Server" : "server",
   "Storage": "storage",
   "Subnet": "subnet",
   "Switch": "switch",
   "Virtual Machine": "virtual-machine"

Here we can see that any node created by the "Admin" datasource and given a type of "Load Balancer" will use the "load_balancer" icon.

Any node which does not match to an icon binding is given a question mark icon:

How to set icons for topology created by the REST API (HGAPI)

  1. Remind yourself what the datasource name is for your topology - you registered the datasource name when you created your API key - see:  https://<IP_Address>/#/admin/hgapi
  2. You need to edit the topology_icon_mapping.json file (described above) to add a section for your datasource.
    • The easiest way to get started is to copy and paste the section for the "Admin" datasource (shown above) and rename "Admin" to the name of your datasource.
    • The file must be a valid JSON format otherwise the Hyperglance client will not function correctly. You can paste it into https://jsonlint.com/  to validate it.
  3. When making the PUT /topology call, simply set the "type" field of each node to match with an entry in the file and Hyperglance will automatically use the corresponding icon.