Package org.onosproject.cli.net
Class DevicesListCommand
- java.lang.Object
-
- org.onosproject.cli.AbstractShellCommand
-
- org.onosproject.cli.net.DevicesListCommand
-
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
,CodecContext
- Direct Known Subclasses:
DeviceInterfacesListCommand
,DevicePortsListCommand
public class DevicesListCommand extends AbstractShellCommand
Lists all infrastructure devices.
-
-
Field Summary
-
Fields inherited from class org.onosproject.cli.AbstractShellCommand
log
-
-
Constructor Summary
Constructors Constructor Description DevicesListCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
Body of the shell command.static List<Device>
getSortedDevices(DeviceService service)
Returns the list of devices sorted using the device ID URIs.protected void
printDevice(DeviceService deviceService, Device device)
Prints information about the specified device.-
Methods inherited from class org.onosproject.cli.AbstractShellCommand
annotations, annotations, annotations, appId, codec, error, execute, get, getService, jsonForEntity, mapper, outputJson, print
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Method Detail
-
doExecute
protected void doExecute()
Description copied from class:AbstractShellCommand
Body of the shell command.- Specified by:
doExecute
in classAbstractShellCommand
-
getSortedDevices
public static List<Device> getSortedDevices(DeviceService service)
Returns the list of devices sorted using the device ID URIs.- Parameters:
service
- device service- Returns:
- sorted device list
-
printDevice
protected void printDevice(DeviceService deviceService, Device device)
Prints information about the specified device.- Parameters:
deviceService
- device servicedevice
- infrastructure device
-
-