use of org.onosproject.net.driver.DriverService in project onos by opennetworkinglab.
the class DeviceDriversCommand method doExecute.
@Override
protected void doExecute() {
DriverService service = get(DriverService.class);
if (uri == null) {
Map<DeviceId, String> deviceDriverNameMap = service.getDeviceDrivers();
if (outputJson()) {
json(deviceDriverNameMap);
} else {
deviceDriverNameMap.forEach((k, v) -> print("%s : %s", k.toString(), v));
}
} else {
DeviceId deviceId = DeviceId.deviceId(uri);
String driverName = service.getDriver(deviceId).name();
if (outputJson()) {
json(deviceId, driverName);
} else {
print("%s : %s", deviceId.toString(), driverName);
}
}
}
use of org.onosproject.net.driver.DriverService in project onos by opennetworkinglab.
the class DeviceInterfacesListCommand method doExecute.
@Override
protected void doExecute() {
DeviceService deviceService = get(DeviceService.class);
DriverService driverService = get(DriverService.class);
if (uri == null) {
// No specific device, so all devices will be examined.
for (Device device : getSortedDevices(deviceService)) {
printDevice(deviceService, driverService, device);
}
} else {
Device device = deviceService.getDevice(deviceId(uri));
printDevice(deviceService, driverService, device);
}
}
Aggregations