From: Greg Price <price@mit.edu>
Date: Sat, 21 Jun 2008 22:38:48 +0000 (-0400)
Subject: provide help on 'remctl remote help help' etc
X-Git-Tag: sipb-xen-remote-server/0.2~16
X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/10db290b6d7a05239bd3579dbb6f5cc937137ab7

provide help on 'remctl remote help help' etc

svn path=/trunk/packages/sipb-xen-remote-server/; revision=615
---

diff --git a/files/etc/remctl/conf.d/sipb-xen-web b/files/etc/remctl/conf.d/sipb-xen-web
index ee72179..64e1a0f 100644
--- a/files/etc/remctl/conf.d/sipb-xen-web
+++ b/files/etc/remctl/conf.d/sipb-xen-web
@@ -6,3 +6,5 @@ web lvcopy       /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web
 web vmboot       /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web
 web listvms      /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web
 test sleep       /usr/bin/env /etc/remctl/acl/web
+control help	 /usr/sbin/sipb-xen-remctl-help	ANYUSER
+help ALL	 /usr/sbin/sipb-xen-remctl-help	ANYUSER
diff --git a/files/usr/sbin/sipb-xen-remctl-help b/files/usr/sbin/sipb-xen-remctl-help
new file mode 100755
index 0000000..e497d29
--- /dev/null
+++ b/files/usr/sbin/sipb-xen-remctl-help
@@ -0,0 +1,41 @@
+#!/usr/bin/python
+"""
+Help on using the Invirt remctl functions.
+"""
+import sys
+
+
+help = [
+    ('list',      'show your VM\'s state (with xm list)'),
+    ('list-long', 'show your VM\'s state as an sexp (with xm list --long)'),
+    ('vcpu-list', 'show your VM\'s state (with xm vcpu-list)'),
+    ('uptime',    'show your VM\'s state (with xm uptime)'),
+    ('destroy',   'shut down your VM, hard (with xm destroy)'),
+    ('shutdown',  'shut down your VM, softly if paravm (with xm shutdown)'),
+    ('create',    'start up your VM (with xm create)'),
+    ('reboot',    'reboot your VM (with xm destroy and xm create)'),
+    #also install
+    #also CD images on create/reboot
+]
+helpdict = dict(help)
+
+
+def print_help(name, text):
+    print '  %-9s : %s' % (name, text)
+
+def main(args):
+    args = [n for n in args if n in helpdict]
+    print 'remctl remote control <machine> <command>'
+    if args:
+        for name in args:
+            print_help(name, helpdict[name])
+    else:
+        for name, text in help:
+            print_help(name, text)
+        
+    return 0
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))
+
+# vim:et:sw=4:ts=4