source: trunk/packages/invirt-remote-server/files/usr/sbin/invirt-remctl-help @ 1811

Last change on this file since 1811 was 1724, checked in by broder, 16 years ago

Update remctl help with new reboot mechanism

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/usr/bin/python
2"""
3Help on using the Invirt remctl functions.
4"""
5import sys
6from invirt.config import structs as config
7
8help = [
9    ('list',      'show your VM\'s state (with xm list)'),
10    ('list-host',  'show on what host, if any, your VM is running'),
11    ('list-long', 'show your VM\'s state as an sexp (with xm list --long)'),
12    ('vcpu-list', 'show your VM\'s state (with xm vcpu-list)'),
13    ('uptime',    'show your VM\'s state (with xm uptime)'),
14    ('destroy',   'shut down your VM, hard (with xm destroy)'),
15    ('shutdown',  'shut down your VM, softly if paravm (with xm shutdown)'),
16    ('create',    'start up your VM (with xm create)'),
17    ('reboot',    'reboot your VM (with xm reboot)'),
18    ('install',   'autoinstall your VM (takes a series of key=value pairs; \n\t\tvalid arguments include mirror, dist, arch, imagesize,\n\t\tand noinstall)'),
19    #also CD images on create/reboot
20]
21helpdict = dict(help)
22
23
24def print_help(name, text):
25    print %-9s : %s' % (name, text)
26
27def main(args):
28    args = [n for n in args if n in helpdict]
29    print 'remctl %s control <machine> <command>' % config.remote.hostname
30    if args:
31        for name in args:
32            print_help(name, helpdict[name])
33    else:
34        for name, text in help:
35            print_help(name, text)
36       
37    return 0
38
39if __name__ == '__main__':
40    sys.exit(main(sys.argv[1:]))
41
42# vim:et:sw=4:ts=4
Note: See TracBrowser for help on using the repository browser.