New Device type for commodity servers

This device type is now advertized by the server
device driver. Also, the ONOS UI maps this new device
type to a glyph.

Change-Id: Ib4147676474b43202bbdff595a0fa0520b70fe91
Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
This commit is contained in:
Georgios Katsikas 2018-07-03 11:17:44 +02:00 committed by Thomas Vachuska
parent 0354b45579
commit 40ecef3be0
3 changed files with 3 additions and 7 deletions

View File

@ -27,7 +27,7 @@ public interface Device extends Element {
*/ */
enum Type { enum Type {
SWITCH, ROUTER, ROADM, OTN, ROADM_OTN, FIREWALL, BALANCER, IPS, IDS, CONTROLLER, SWITCH, ROUTER, ROADM, OTN, ROADM_OTN, FIREWALL, BALANCER, IPS, IDS, CONTROLLER,
VIRTUAL, FIBER_SWITCH, MICROWAVE, OLT, ONU, OPTICAL_AMPLIFIER, OTHER VIRTUAL, FIBER_SWITCH, MICROWAVE, OLT, ONU, OPTICAL_AMPLIFIER, OTHER, SERVER
} }
/** /**

View File

@ -358,14 +358,9 @@ public class ServerDevicesDiscovery extends BasicServerDriver
getController().removeDevice(deviceId); getController().removeDevice(deviceId);
getController().addDevice((RestSBDevice) dev); getController().addDevice((RestSBDevice) dev);
/**
* TODO: Create a new Device type
* Device.Type.COMMODITY_SERVER
* and add a new icon in the GUI.
*/
try { try {
desc = new DefaultServerDeviceDescription( desc = new DefaultServerDeviceDescription(
new URI(id), Device.Type.OTHER, vendor, new URI(id), Device.Type.SERVER, vendor,
hw, sw, serial, new ChassisId(), hw, sw, serial, new ChassisId(),
cpuSet, nicSet, DefaultAnnotations.EMPTY cpuSet, nicSet, DefaultAnnotations.EMPTY
); );

View File

@ -158,6 +158,7 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
DEVICE_GLYPHS.put(Device.Type.ONU, "m_onu"); DEVICE_GLYPHS.put(Device.Type.ONU, "m_onu");
DEVICE_GLYPHS.put(Device.Type.OPTICAL_AMPLIFIER, "unknown"); // TODO glyph needed DEVICE_GLYPHS.put(Device.Type.OPTICAL_AMPLIFIER, "unknown"); // TODO glyph needed
DEVICE_GLYPHS.put(Device.Type.OTHER, "m_other"); DEVICE_GLYPHS.put(Device.Type.OTHER, "m_other");
DEVICE_GLYPHS.put(Device.Type.SERVER, "m_endpoint");
} }
private static final String DEFAULT_HOST_GLYPH = "m_endstation"; private static final String DEFAULT_HOST_GLYPH = "m_endstation";