Revision 9a033156
b/lib/cli.py | ||
---|---|---|
251 | 251 |
"\n%(bin)s <command> --help to see details, or" |
252 | 252 |
" man %(bin)s\n" % {"bin": binary}) |
253 | 253 |
# compute the max line length for cmd + usage |
254 |
mlen = max([len(" %s" % cmd) for cmd in commands])
|
|
254 |
mlen = max([len(" %s %s" % (cmd, commands[cmd][3])) for cmd in commands])
|
|
255 | 255 |
mlen = min(60, mlen) # should not get here... |
256 | 256 |
# and format a nice command list |
257 | 257 |
print "Commands:" |
258 | 258 |
for cmd in sortedcmds: |
259 |
cmdstr = " %s" % (cmd,)
|
|
260 |
help_text = commands[cmd][3]
|
|
259 |
cmdstr = " %s %s" % (cmd, commands[cmd][3])
|
|
260 |
help_text = commands[cmd][4]
|
|
261 | 261 |
help_lines = textwrap.wrap(help_text, 79-3-mlen) |
262 |
print "%-*s - %s" % (mlen, cmdstr, help_lines.pop(0)) |
|
262 |
print "%-*s - %s" % (mlen, cmdstr, |
|
263 |
help_lines.pop(0)) |
|
263 | 264 |
for line in help_lines: |
264 | 265 |
print "%-*s %s" % (mlen, "", line) |
265 | 266 |
|
b/scripts/gnt-backup | ||
---|---|---|
177 | 177 |
help="List only backups stored on this node" |
178 | 178 |
" (can be used multiple times)"), |
179 | 179 |
], |
180 |
"Lists instance exports available in the ganeti cluster"), |
|
180 |
"", "Lists instance exports available in the ganeti cluster"),
|
|
181 | 181 |
'export': (ExportInstance, ARGS_ONE, |
182 | 182 |
[DEBUG_OPT, FORCE_OPT, |
183 | 183 |
make_option("-n", "--node", dest="node", help="Target node", |
... | ... | |
185 | 185 |
make_option("","--noshutdown", dest="shutdown", |
186 | 186 |
action="store_false", default=True, |
187 | 187 |
help="Don't shutdown the instance (unsafe)"), ], |
188 |
"-n <target_node> [opts...] <name>", |
|
188 | 189 |
"Exports an instance to an image"), |
189 |
'import': (ImportInstance, ARGS_ONE, import_opts, |
|
190 |
'import': (ImportInstance, ARGS_ONE, import_opts, "[opts...] <name>",
|
|
190 | 191 |
"Imports an instance from an exported image"), |
191 | 192 |
'remove': (RemoveExport, ARGS_ONE, |
192 | 193 |
[DEBUG_OPT], |
194 |
"<name>", |
|
193 | 195 |
"Remove exports of named instance from the filesystem."), |
194 | 196 |
} |
195 | 197 |
|
b/scripts/gnt-cluster | ||
---|---|---|
359 | 359 |
" (cluster-wide)", |
360 | 360 |
action="store_false", default=True,), |
361 | 361 |
], |
362 |
"[opts...] <cluster_name>", |
|
362 | 363 |
"Initialises a new cluster configuration"), |
363 | 364 |
'destroy': (DestroyCluster, ARGS_NONE, |
364 | 365 |
[DEBUG_OPT, |
... | ... | |
366 | 367 |
help="Destroy cluster", |
367 | 368 |
action="store_true"), |
368 | 369 |
], |
369 |
"Destroy cluster"), |
|
370 |
"", "Destroy cluster"),
|
|
370 | 371 |
'rename': (RenameCluster, ARGS_ONE, [DEBUG_OPT, FORCE_OPT], |
372 |
"<new_name>", |
|
371 | 373 |
"Renames the cluster"), |
372 | 374 |
'verify': (VerifyCluster, ARGS_NONE, [DEBUG_OPT, |
373 | 375 |
make_option("--no-nplus1-mem", dest="skip_nplusone_mem", |
... | ... | |
375 | 377 |
action="store_true", |
376 | 378 |
default=False,), |
377 | 379 |
], |
378 |
"Does a check on the cluster configuration"), |
|
380 |
"", "Does a check on the cluster configuration"),
|
|
379 | 381 |
'verify-disks': (VerifyDisks, ARGS_NONE, [DEBUG_OPT], |
380 |
"Does a check on the cluster disk status"), |
|
382 |
"", "Does a check on the cluster disk status"),
|
|
381 | 383 |
'masterfailover': (MasterFailover, ARGS_NONE, [DEBUG_OPT], |
382 |
"Makes the current node the master"), |
|
384 |
"", "Makes the current node the master"),
|
|
383 | 385 |
'version': (ShowClusterVersion, ARGS_NONE, [DEBUG_OPT], |
384 |
"Shows the cluster version"), |
|
386 |
"", "Shows the cluster version"),
|
|
385 | 387 |
'getmaster': (ShowClusterMaster, ARGS_NONE, [DEBUG_OPT], |
386 |
"Shows the cluster master"), |
|
388 |
"", "Shows the cluster master"),
|
|
387 | 389 |
'copyfile': (ClusterCopyFile, ARGS_ONE, [DEBUG_OPT, node_option], |
390 |
"[-n node...] <filename>", |
|
388 | 391 |
"Copies a file to all (or only some) nodes"), |
389 | 392 |
'command': (RunClusterCommand, ARGS_ATLEAST(1), [DEBUG_OPT, node_option], |
393 |
"[-n node...] <command>", |
|
390 | 394 |
"Runs a command on all (or only some) nodes"), |
391 | 395 |
'info': (ShowClusterConfig, ARGS_NONE, [DEBUG_OPT], |
392 |
"Show cluster configuration"), |
|
396 |
"", "Show cluster configuration"),
|
|
393 | 397 |
'list-tags': (ListTags, ARGS_NONE, |
394 |
[DEBUG_OPT], "List the tags of the cluster"), |
|
398 |
[DEBUG_OPT], "", "List the tags of the cluster"),
|
|
395 | 399 |
'add-tags': (AddTags, ARGS_ANY, [DEBUG_OPT, TAG_SRC_OPT], |
396 |
"Add tags to the cluster"), |
|
400 |
"tag...", "Add tags to the cluster"),
|
|
397 | 401 |
'remove-tags': (RemoveTags, ARGS_ANY, [DEBUG_OPT, TAG_SRC_OPT], |
398 |
"Remove tags from the cluster"), |
|
402 |
"tag...", "Remove tags from the cluster"),
|
|
399 | 403 |
'search-tags': (SearchTags, ARGS_ONE, |
400 |
[DEBUG_OPT], "Searches the tags on all objects on" |
|
404 |
[DEBUG_OPT], "", "Searches the tags on all objects on"
|
|
401 | 405 |
" the cluster for a given pattern (regex)"), |
402 | 406 |
'modify': (SetClusterParams, ARGS_NONE, |
403 | 407 |
[DEBUG_OPT, |
b/scripts/gnt-debug | ||
---|---|---|
148 | 148 |
action="append", |
149 | 149 |
help="Select nodes to sleep on"), |
150 | 150 |
], |
151 |
"Executes a TestDelay OpCode"), |
|
151 |
"[opts...] <duration>", "Executes a TestDelay OpCode"),
|
|
152 | 152 |
'submit-job': (GenericOpCodes, ARGS_ONE, |
153 | 153 |
[DEBUG_OPT, |
154 | 154 |
], |
155 |
"Submits a job built from a json-file" |
|
155 |
"<op_list_file>", "Submits a job built from a json-file"
|
|
156 | 156 |
" with a list of serialized opcodes"), |
157 | 157 |
'allocator': (TestAllocator, ARGS_ONE, |
158 | 158 |
[DEBUG_OPT, |
... | ... | |
184 | 184 |
make_option("--tags", default=None, |
185 | 185 |
help="Comma separated list of tags"), |
186 | 186 |
], |
187 |
"Executes a TestAllocator OpCode"), |
|
187 |
"{opts...} <instance>", "Executes a TestAllocator OpCode"),
|
|
188 | 188 |
} |
189 | 189 |
|
190 | 190 |
|
b/scripts/gnt-instance | ||
---|---|---|
795 | 795 |
|
796 | 796 |
commands = { |
797 | 797 |
'add': (AddInstance, ARGS_ONE, add_opts, |
798 |
"[opts...] <name>", |
|
798 | 799 |
"Creates and adds a new instance to the cluster"), |
799 | 800 |
'console': (ConnectToInstanceConsole, ARGS_ONE, |
800 | 801 |
[DEBUG_OPT, |
801 | 802 |
make_option("--show-cmd", dest="show_command", |
802 | 803 |
action="store_true", default=False, |
803 | 804 |
help=("Show command instead of executing it"))], |
805 |
"[--show-cmd] <instance>", |
|
804 | 806 |
"Opens a console on the specified instance"), |
805 | 807 |
'failover': (FailoverInstance, ARGS_ONE, |
806 | 808 |
[DEBUG_OPT, FORCE_OPT, |
... | ... | |
809 | 811 |
help="Ignore the consistency of the disks on" |
810 | 812 |
" the secondary"), |
811 | 813 |
], |
814 |
"[-f] <instance>", |
|
812 | 815 |
"Stops the instance and starts it on the backup node, using" |
813 | 816 |
" the remote mirror (only for instances of type drbd)"), |
814 |
'info': (ShowInstanceConfig, ARGS_ANY, [DEBUG_OPT], |
|
817 |
'info': (ShowInstanceConfig, ARGS_ANY, [DEBUG_OPT], "[<instance>...]",
|
|
815 | 818 |
"Show information on the specified instance"), |
816 | 819 |
'list': (ListInstances, ARGS_NONE, |
817 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
|
820 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], "",
|
|
818 | 821 |
"Lists the instances and their status. The available fields are" |
819 | 822 |
" (see the man page for details): status, oper_state, oper_ram," |
820 | 823 |
" name, os, pnode, snodes, admin_state, admin_ram, disk_template," |
... | ... | |
822 | 825 |
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS), |
823 | 826 |
), |
824 | 827 |
'reinstall': (ReinstallInstance, ARGS_ONE, [DEBUG_OPT, FORCE_OPT, os_opt], |
825 |
"Reinstall a stopped instance"), |
|
828 |
"[-f] <instance>", "Reinstall a stopped instance"),
|
|
826 | 829 |
'remove': (RemoveInstance, ARGS_ONE, |
827 | 830 |
[DEBUG_OPT, FORCE_OPT, |
828 | 831 |
make_option("--ignore-failures", dest="ignore_failures", |
... | ... | |
831 | 834 |
" if there are failures during the removal" |
832 | 835 |
" process (shutdown, disk removal, etc.)")), |
833 | 836 |
], |
834 |
"Shuts down the instance and removes it"), |
|
837 |
"[-f] <instance>", "Shuts down the instance and removes it"),
|
|
835 | 838 |
'rename': (RenameInstance, ARGS_FIXED(2), |
836 | 839 |
[DEBUG_OPT, |
837 | 840 |
make_option("--no-ip-check", dest="ignore_ip", |
... | ... | |
839 | 842 |
" is alive", |
840 | 843 |
default=False, action="store_true"), |
841 | 844 |
], |
842 |
"Rename the instance"), |
|
845 |
"<instance> <new_name>", "Rename the instance"),
|
|
843 | 846 |
'replace-disks': (ReplaceDisks, ARGS_ONE, |
844 | 847 |
[DEBUG_OPT, |
845 | 848 |
make_option("-n", "--new-secondary", dest="new_secondary", |
... | ... | |
864 | 867 |
" secondary node replacement)", |
865 | 868 |
default=None, type="string"), |
866 | 869 |
], |
870 |
"[-s|-p|-n NODE] <instance>", |
|
867 | 871 |
"Replaces all disks for the instance"), |
868 | 872 |
'modify': (SetInstanceParams, ARGS_ONE, |
869 | 873 |
[DEBUG_OPT, FORCE_OPT, |
... | ... | |
895 | 899 |
"(either one or more of [acdn] or 'default')", |
896 | 900 |
default=None, type="string", metavar="<BOOTORDER>"), |
897 | 901 |
], |
898 |
"Alters the parameters of an instance"), |
|
902 |
"<instance>", "Alters the parameters of an instance"),
|
|
899 | 903 |
'shutdown': (ShutdownInstance, ARGS_ANY, |
900 | 904 |
[DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt, |
901 | 905 |
m_clust_opt, m_inst_opt, m_force_multi], |
902 |
"Stops an instance"), |
|
906 |
"<instance>", "Stops an instance"),
|
|
903 | 907 |
'startup': (StartupInstance, ARGS_ANY, |
904 | 908 |
[DEBUG_OPT, FORCE_OPT, m_force_multi, |
905 | 909 |
make_option("-e", "--extra", dest="extra_args", |
... | ... | |
908 | 912 |
m_node_opt, m_pri_node_opt, m_sec_node_opt, |
909 | 913 |
m_clust_opt, m_inst_opt, |
910 | 914 |
], |
911 |
"Starts an instance"),
|
|
915 |
"<instance>", "Starts an instance"),
|
|
912 | 916 |
|
913 | 917 |
'reboot': (RebootInstance, ARGS_ANY, |
914 | 918 |
[DEBUG_OPT, m_force_multi, |
... | ... | |
925 | 929 |
m_node_opt, m_pri_node_opt, m_sec_node_opt, |
926 | 930 |
m_clust_opt, m_inst_opt, |
927 | 931 |
], |
928 |
"Reboots an instance"), |
|
932 |
"<instance>", "Reboots an instance"),
|
|
929 | 933 |
'activate-disks': (ActivateDisks, ARGS_ONE, [DEBUG_OPT], |
934 |
"<instance>", |
|
930 | 935 |
"Activate an instance's disks"), |
931 | 936 |
'deactivate-disks': (DeactivateDisks, ARGS_ONE, [DEBUG_OPT], |
937 |
"<instance>", |
|
932 | 938 |
"Deactivate an instance's disks"), |
933 | 939 |
'list-tags': (ListTags, ARGS_ONE, [DEBUG_OPT], |
934 |
"List the tags of the given instance"), |
|
940 |
"<node_name>", "List the tags of the given instance"),
|
|
935 | 941 |
'add-tags': (AddTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT], |
936 |
"Add tags to the given instance"), |
|
942 |
"<node_name> tag...", "Add tags to the given instance"),
|
|
937 | 943 |
'remove-tags': (RemoveTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT], |
938 |
"Remove tags from given instance"), |
|
944 |
"<node_name> tag...", "Remove tags from given instance"),
|
|
939 | 945 |
} |
940 | 946 |
|
941 | 947 |
aliases = { |
b/scripts/gnt-job | ||
---|---|---|
95 | 95 |
|
96 | 96 |
commands = { |
97 | 97 |
'list': (ListJobs, ARGS_NONE, |
98 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
|
99 |
"List the jobs and their status. The available fields are" |
|
98 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
|
|
99 |
"", "List the jobs and their status. The available fields are"
|
|
100 | 100 |
" (see the man page for details): id, status, op_list," |
101 | 101 |
" op_status, op_result." |
102 | 102 |
" The default field" |
b/scripts/gnt-node | ||
---|---|---|
295 | 295 |
default=False, action="store_true", |
296 | 296 |
help="Readd old node after replacing it"), |
297 | 297 |
], |
298 |
"Add a node to the cluster"), |
|
298 |
"[-s ip] <node_name>", "Add a node to the cluster"),
|
|
299 | 299 |
'evacuate': (EvacuateNode, ARGS_FIXED(2), |
300 | 300 |
[DEBUG_OPT, FORCE_OPT], |
301 |
"[-f] <src> <dst>", |
|
301 | 302 |
"Relocate the secondary instances from the first node" |
302 | 303 |
" to the second one (only for instances of type remote_raid1" |
303 | 304 |
" drbd)"), |
... | ... | |
308 | 309 |
help="Ignore the consistency of the disks on" |
309 | 310 |
" the secondary"), |
310 | 311 |
], |
312 |
"[-f] <node>", |
|
311 | 313 |
"Stops the primary instances on a node and start them on their" |
312 | 314 |
" secondary node (only for instances of type remote_raid1)"), |
313 | 315 |
'info': (ShowNodeConfig, ARGS_ANY, [DEBUG_OPT], |
314 |
"Show information about the node(s)"), |
|
316 |
"[<node_name>...]", "Show information about the node(s)"),
|
|
315 | 317 |
'list': (ListNodes, ARGS_NONE, |
316 | 318 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
317 |
"Lists the nodes in the cluster. The available fields" |
|
319 |
"", "Lists the nodes in the cluster. The available fields"
|
|
318 | 320 |
" are (see the man page for details): name, pinst_cnt, pinst_list," |
319 | 321 |
" sinst_cnt, sinst_list, pip, sip, dtotal, dfree, mtotal, mnode," |
320 | 322 |
" mfree, bootid, cpu_count. The default field list is" |
321 | 323 |
" (in order): %s." % ", ".join(_LIST_DEF_FIELDS), |
322 | 324 |
), |
323 | 325 |
'remove': (RemoveNode, ARGS_ONE, [DEBUG_OPT], |
324 |
"Removes a node from the cluster"), |
|
326 |
"<node_name>", "Removes a node from the cluster"),
|
|
325 | 327 |
'volumes': (ListVolumes, ARGS_ANY, |
326 | 328 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
327 |
"List logical volumes on node(s)"), |
|
329 |
"[<node_name>...]", "List logical volumes on node(s)"),
|
|
328 | 330 |
'list-tags': (ListTags, ARGS_ONE, [DEBUG_OPT], |
329 |
"List the tags of the given node"), |
|
331 |
"<node_name>", "List the tags of the given node"),
|
|
330 | 332 |
'add-tags': (AddTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT], |
331 |
"Add tags to the given node"), |
|
333 |
"<node_name> tag...", "Add tags to the given node"),
|
|
332 | 334 |
'remove-tags': (RemoveTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT], |
333 |
"Remove tags from the given node"), |
|
335 |
"<node_name> tag...", "Remove tags from the given node"),
|
|
334 | 336 |
} |
335 | 337 |
|
336 | 338 |
|
b/scripts/gnt-os | ||
---|---|---|
116 | 116 |
|
117 | 117 |
|
118 | 118 |
commands = { |
119 |
'list': (ListOS, ARGS_NONE, [DEBUG_OPT, NOHDR_OPT], |
|
119 |
'list': (ListOS, ARGS_NONE, [DEBUG_OPT, NOHDR_OPT], "",
|
|
120 | 120 |
"Lists all valid OSes on the master"), |
121 |
'diagnose': (DiagnoseOS, ARGS_NONE, [DEBUG_OPT], |
|
121 |
'diagnose': (DiagnoseOS, ARGS_NONE, [DEBUG_OPT], "",
|
|
122 | 122 |
"Diagnose all OSes"), |
123 | 123 |
} |
124 | 124 |
|
Also available in: Unified diff