Added some CLI commands and fixed pom.xml and features.xml to use commons-lang 2.6 (bundle)
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
new file mode 100644
index 0000000..f09e39a
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
@@ -0,0 +1,33 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Port;
+import org.onlab.onos.net.device.DeviceService;
+
+import static org.onlab.onos.net.DeviceId.deviceId;
+
+/**
+ * Lists all infrastructure links.
+ */
+@Command(scope = "onos", name = "ports",
+ description = "Lists all ports of a device")
+public class DevicePortsListCommand extends AbstractShellCommand {
+
+ private static final String FMT = "port=%s, state=%s";
+
+ @Argument(index = 0, name = "deviceId", description = "Device ID",
+ required = true, multiValued = false)
+ String deviceId = null;
+
+ @Override
+ protected Object doExecute() throws Exception {
+ DeviceService service = getService(DeviceService.class);
+ Iterable<Port> ports = service.getPorts(deviceId(deviceId));
+ for (Port port : ports) {
+ print(FMT, port.number(), port.isEnabled() ? "enabled" : "disabled");
+ }
+ return null;
+ }
+}