added containermanager shell feature
[controller.git] / opendaylight / containermanager / shell / src / main / java / org / opendaylight / controller / containermanager / shell / ContainermgrGetUserResources.java
diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java
new file mode 100644 (file)
index 0000000..6a281bd
--- /dev/null
@@ -0,0 +1,26 @@
+package org.opendaylight.controller.containermanager.shell;
+
+import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.controller.containermanager.IContainerManagerShell;
+
+@Command(scope = "containermanager", name = "containermgrGetUserResources", description="Get user resources")
+public class ContainermgrGetUserResources extends OsgiCommandSupport{
+    private IContainerManagerShell containerManager;
+
+    @Argument(index=0, name="userName", description="user name", required=true, multiValued=false)
+    String userName = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for(String p : containerManager.containermgrGetUserResources(userName)) {
+            System.out.println(p);
+        }
+        return null;
+    }
+
+    public void setContainerManager(IContainerManagerShell containerManager){
+        this.containerManager = containerManager;
+    }
+}
\ No newline at end of file