Revision 064c21f8
b/autotools/build-bash-completion | ||
---|---|---|
591 | 591 |
for (_, _, optdef, _, _) in commands.itervalues(): |
592 | 592 |
if help_option not in optdef: |
593 | 593 |
optdef.append(help_option) |
594 |
if cli.DEBUG_OPT not in optdef: |
|
595 |
optdef.append(cli.DEBUG_OPT) |
|
594 | 596 |
|
595 | 597 |
# Use aliases |
596 | 598 |
aliases = getattr(module, "aliases", {}) |
b/lib/cli.py | ||
---|---|---|
876 | 876 |
cmd = aliases[cmd] |
877 | 877 |
|
878 | 878 |
func, args_def, parser_opts, usage, description = commands[cmd] |
879 |
parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT], |
|
879 |
parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT, DEBUG_OPT],
|
|
880 | 880 |
description=description, |
881 | 881 |
formatter=TitledHelpFormatter(), |
882 | 882 |
usage="%%prog %s %s" % (cmd, usage)) |
b/scripts/gnt-backup | ||
---|---|---|
210 | 210 |
|
211 | 211 |
# this is defined separately due to readability only |
212 | 212 |
import_opts = [ |
213 |
DEBUG_OPT, |
|
214 | 213 |
NODE_PLACEMENT_OPT, |
215 | 214 |
BACKEND_OPT, |
216 | 215 |
DISK_TEMPLATE_OPT, |
... | ... | |
231 | 230 |
commands = { |
232 | 231 |
'list': ( |
233 | 232 |
PrintExportList, ARGS_NONE, |
234 |
[DEBUG_OPT, NODE_LIST_OPT],
|
|
233 |
[NODE_LIST_OPT], |
|
235 | 234 |
"", "Lists instance exports available in the ganeti cluster"), |
236 | 235 |
'export': ( |
237 | 236 |
ExportInstance, ARGS_ONE_INSTANCE, |
238 |
[DEBUG_OPT, FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT],
|
|
237 |
[FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT], |
|
239 | 238 |
"-n <target_node> [opts...] <name>", |
240 | 239 |
"Exports an instance to an image"), |
241 | 240 |
'import': ( |
... | ... | |
243 | 242 |
"[...] -t disk-type -n node[:secondary-node] <name>", |
244 | 243 |
"Imports an instance from an exported image"), |
245 | 244 |
'remove': ( |
246 |
RemoveExport, [ArgUnknown(min=1, max=1)], |
|
247 |
[DEBUG_OPT], |
|
245 |
RemoveExport, [ArgUnknown(min=1, max=1)], [], |
|
248 | 246 |
"<name>", "Remove exports of named instance from the filesystem."), |
249 | 247 |
} |
250 | 248 |
|
b/scripts/gnt-cluster | ||
---|---|---|
597 | 597 |
commands = { |
598 | 598 |
'init': ( |
599 | 599 |
InitCluster, [ArgHost(min=1, max=1)], |
600 |
[DEBUG_OPT, BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT,
|
|
600 |
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT, |
|
601 | 601 |
HVLIST_OPT, MAC_PREFIX_OPT, MASTER_NETDEV_OPT, NIC_PARAMS_OPT, |
602 | 602 |
NOLVM_STORAGE_OPT, NOMODIFY_ETCHOSTS_OPT, SECONDARY_IP_OPT, VG_NAME_OPT], |
603 | 603 |
"[opts...] <cluster_name>", "Initialises a new cluster configuration"), |
604 | 604 |
'destroy': ( |
605 |
DestroyCluster, ARGS_NONE, |
|
606 |
[DEBUG_OPT, YES_DOIT_OPT], |
|
605 |
DestroyCluster, ARGS_NONE, [YES_DOIT_OPT], |
|
607 | 606 |
"", "Destroy cluster"), |
608 | 607 |
'rename': ( |
609 | 608 |
RenameCluster, [ArgHost(min=1, max=1)], |
610 |
[DEBUG_OPT, FORCE_OPT],
|
|
609 |
[FORCE_OPT], |
|
611 | 610 |
"<new_name>", |
612 | 611 |
"Renames the cluster"), |
613 | 612 |
'redist-conf': ( |
614 |
RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT],
|
|
613 |
RedistributeConfig, ARGS_NONE, [SUBMIT_OPT], |
|
615 | 614 |
"", "Forces a push of the configuration file and ssconf files" |
616 | 615 |
" to the nodes in the cluster"), |
617 | 616 |
'verify': ( |
618 | 617 |
VerifyCluster, ARGS_NONE, |
619 |
[DEBUG_OPT, VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT],
|
|
618 |
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT], |
|
620 | 619 |
"", "Does a check on the cluster configuration"), |
621 | 620 |
'verify-disks': ( |
622 |
VerifyDisks, ARGS_NONE, [DEBUG_OPT],
|
|
621 |
VerifyDisks, ARGS_NONE, [], |
|
623 | 622 |
"", "Does a check on the cluster disk status"), |
624 | 623 |
'repair-disk-sizes': ( |
625 |
RepairDiskSizes, ARGS_MANY_INSTANCES, [DEBUG_OPT],
|
|
624 |
RepairDiskSizes, ARGS_MANY_INSTANCES, [], |
|
626 | 625 |
"", "Updates mismatches in recorded disk sizes"), |
627 | 626 |
'masterfailover': ( |
628 |
MasterFailover, ARGS_NONE, [DEBUG_OPT, NOVOTING_OPT],
|
|
627 |
MasterFailover, ARGS_NONE, [NOVOTING_OPT], |
|
629 | 628 |
"", "Makes the current node the master"), |
630 | 629 |
'version': ( |
631 |
ShowClusterVersion, ARGS_NONE, [DEBUG_OPT],
|
|
630 |
ShowClusterVersion, ARGS_NONE, [], |
|
632 | 631 |
"", "Shows the cluster version"), |
633 | 632 |
'getmaster': ( |
634 |
ShowClusterMaster, ARGS_NONE, [DEBUG_OPT],
|
|
633 |
ShowClusterMaster, ARGS_NONE, [], |
|
635 | 634 |
"", "Shows the cluster master"), |
636 | 635 |
'copyfile': ( |
637 | 636 |
ClusterCopyFile, [ArgFile(min=1, max=1)], |
638 |
[DEBUG_OPT, NODE_LIST_OPT],
|
|
637 |
[NODE_LIST_OPT], |
|
639 | 638 |
"[-n node...] <filename>", "Copies a file to all (or only some) nodes"), |
640 | 639 |
'command': ( |
641 | 640 |
RunClusterCommand, [ArgCommand(min=1)], |
642 |
[DEBUG_OPT, NODE_LIST_OPT],
|
|
641 |
[NODE_LIST_OPT], |
|
643 | 642 |
"[-n node...] <command>", "Runs a command on all (or only some) nodes"), |
644 | 643 |
'info': ( |
645 |
ShowClusterConfig, ARGS_NONE, [DEBUG_OPT],
|
|
644 |
ShowClusterConfig, ARGS_NONE, [], |
|
646 | 645 |
"", "Show cluster configuration"), |
647 | 646 |
'list-tags': ( |
648 |
ListTags, ARGS_NONE, |
|
649 |
[DEBUG_OPT], "", "List the tags of the cluster"), |
|
647 |
ListTags, ARGS_NONE, [], "", "List the tags of the cluster"), |
|
650 | 648 |
'add-tags': ( |
651 |
AddTags, [ArgUnknown()], [DEBUG_OPT, TAG_SRC_OPT],
|
|
649 |
AddTags, [ArgUnknown()], [TAG_SRC_OPT], |
|
652 | 650 |
"tag...", "Add tags to the cluster"), |
653 | 651 |
'remove-tags': ( |
654 |
RemoveTags, [ArgUnknown()], [DEBUG_OPT, TAG_SRC_OPT],
|
|
652 |
RemoveTags, [ArgUnknown()], [TAG_SRC_OPT], |
|
655 | 653 |
"tag...", "Remove tags from the cluster"), |
656 | 654 |
'search-tags': ( |
657 | 655 |
SearchTags, [ArgUnknown(min=1, max=1)], |
658 |
[DEBUG_OPT], "", "Searches the tags on all objects on"
|
|
656 |
[], "", "Searches the tags on all objects on" |
|
659 | 657 |
" the cluster for a given pattern (regex)"), |
660 | 658 |
'queue': ( |
661 | 659 |
QueueOps, |
662 | 660 |
[ArgChoice(min=1, max=1, choices=["drain", "undrain", "info"])], |
663 |
[DEBUG_OPT], "drain|undrain|info", "Change queue properties"),
|
|
661 |
[], "drain|undrain|info", "Change queue properties"), |
|
664 | 662 |
'watcher': ( |
665 | 663 |
WatcherOps, |
666 | 664 |
[ArgChoice(min=1, max=1, choices=["pause", "continue", "info"]), |
667 | 665 |
ArgSuggest(min=0, max=1, choices=["30m", "1h", "4h"])], |
668 |
[DEBUG_OPT],
|
|
666 |
[], |
|
669 | 667 |
"{pause <timespec>|continue|info}", "Change watcher properties"), |
670 | 668 |
'modify': ( |
671 | 669 |
SetClusterParams, ARGS_NONE, |
672 |
[DEBUG_OPT, BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
|
|
670 |
[BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT, |
|
673 | 671 |
NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT], |
674 | 672 |
"[opts...]", |
675 | 673 |
"Alters the parameters of the cluster"), |
b/scripts/gnt-debug | ||
---|---|---|
156 | 156 |
commands = { |
157 | 157 |
'delay': ( |
158 | 158 |
Delay, [ArgUnknown(min=1, max=1)], |
159 |
[DEBUG_OPT, |
|
160 |
cli_option("--no-master", dest="on_master", default=True, |
|
159 |
[cli_option("--no-master", dest="on_master", default=True, |
|
161 | 160 |
action="store_false", help="Do not sleep in the master code"), |
162 | 161 |
cli_option("-n", dest="on_nodes", default=[], |
163 | 162 |
action="append", help="Select nodes to sleep on"), |
... | ... | |
165 | 164 |
"[opts...] <duration>", "Executes a TestDelay OpCode"), |
166 | 165 |
'submit-job': ( |
167 | 166 |
GenericOpCodes, [ArgFile(min=1)], |
168 |
[DEBUG_OPT, VERBOSE_OPT,
|
|
167 |
[VERBOSE_OPT, |
|
169 | 168 |
cli_option("--op-repeat", type="int", default="1", dest="rep_op", |
170 | 169 |
help="Repeat the opcode sequence this number of times"), |
171 | 170 |
cli_option("--job-repeat", type="int", default="1", dest="rep_job", |
... | ... | |
177 | 176 |
" containing a list of serialized opcodes"), |
178 | 177 |
'allocator': ( |
179 | 178 |
TestAllocator, ARGS_ONE_INSTANCE, |
180 |
[DEBUG_OPT, |
|
181 |
cli_option("--dir", dest="direction", |
|
179 |
[cli_option("--dir", dest="direction", |
|
182 | 180 |
default="in", choices=["in", "out"], |
183 | 181 |
help="Show allocator input (in) or allocator" |
184 | 182 |
" results (out)"), |
b/scripts/gnt-instance | ||
---|---|---|
1357 | 1357 |
|
1358 | 1358 |
# this is defined separately due to readability only |
1359 | 1359 |
add_opts = [ |
1360 |
DEBUG_OPT, |
|
1361 |
NODE_PLACEMENT_OPT, |
|
1362 |
OS_OPT, |
|
1363 | 1360 |
BACKEND_OPT, |
1364 |
DISK_TEMPLATE_OPT, |
|
1365 |
OS_SIZE_OPT, |
|
1366 | 1361 |
DISK_OPT, |
1367 |
NET_OPT, |
|
1368 |
NONICS_OPT, |
|
1369 |
NWSYNC_OPT, |
|
1370 |
NOSTART_OPT, |
|
1371 |
NOIPCHECK_OPT, |
|
1362 |
DISK_TEMPLATE_OPT, |
|
1372 | 1363 |
FILESTORE_DIR_OPT, |
1373 | 1364 |
FILESTORE_DRIVER_OPT, |
1374 |
IALLOCATOR_OPT, |
|
1375 | 1365 |
HYPERVISOR_OPT, |
1366 |
IALLOCATOR_OPT, |
|
1367 |
NET_OPT, |
|
1368 |
NODE_PLACEMENT_OPT, |
|
1369 |
NOIPCHECK_OPT, |
|
1370 |
NONICS_OPT, |
|
1371 |
NOSTART_OPT, |
|
1372 |
NWSYNC_OPT, |
|
1373 |
OS_OPT, |
|
1374 |
OS_SIZE_OPT, |
|
1376 | 1375 |
SUBMIT_OPT, |
1377 | 1376 |
] |
1378 | 1377 |
|
... | ... | |
1382 | 1381 |
"[...] -t disk-type -n node[:secondary-node] -o os-type <name>", |
1383 | 1382 |
"Creates and adds a new instance to the cluster"), |
1384 | 1383 |
'batch-create': ( |
1385 |
BatchCreate, [ArgFile(min=1, max=1)], |
|
1386 |
[DEBUG_OPT], |
|
1384 |
BatchCreate, [ArgFile(min=1, max=1)], [], |
|
1387 | 1385 |
"<instances.json>", |
1388 | 1386 |
"Create a bunch of instances based on specs in the file."), |
1389 | 1387 |
'console': ( |
1390 | 1388 |
ConnectToInstanceConsole, ARGS_ONE_INSTANCE, |
1391 |
[DEBUG_OPT, SHOWCMD_OPT],
|
|
1389 |
[SHOWCMD_OPT], |
|
1392 | 1390 |
"[--show-cmd] <instance>", "Opens a console on the specified instance"), |
1393 | 1391 |
'failover': ( |
1394 | 1392 |
FailoverInstance, ARGS_ONE_INSTANCE, |
1395 |
[DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT],
|
|
1393 |
[FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT], |
|
1396 | 1394 |
"[-f] <instance>", "Stops the instance and starts it on the backup node," |
1397 | 1395 |
" using the remote mirror (only for instances of type drbd)"), |
1398 | 1396 |
'migrate': ( |
1399 | 1397 |
MigrateInstance, ARGS_ONE_INSTANCE, |
1400 |
[DEBUG_OPT, FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT],
|
|
1398 |
[FORCE_OPT, NONLIVE_OPT, CLEANUP_OPT], |
|
1401 | 1399 |
"[-f] <instance>", "Migrate instance to its secondary node" |
1402 | 1400 |
" (only for instances of type drbd)"), |
1403 | 1401 |
'move': ( |
1404 | 1402 |
MoveInstance, ARGS_ONE_INSTANCE, |
1405 |
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT],
|
|
1403 |
[FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT], |
|
1406 | 1404 |
"[-f] <instance>", "Move instance to an arbitrary node" |
1407 | 1405 |
" (only for instances of type file and lv)"), |
1408 | 1406 |
'info': ( |
1409 | 1407 |
ShowInstanceConfig, ARGS_MANY_INSTANCES, |
1410 |
[DEBUG_OPT, STATIC_OPT, ALL_OPT],
|
|
1408 |
[STATIC_OPT, ALL_OPT], |
|
1411 | 1409 |
"[-s] {--all | <instance>...}", |
1412 | 1410 |
"Show information on the specified instance(s)"), |
1413 | 1411 |
'list': ( |
1414 | 1412 |
ListInstances, ARGS_MANY_INSTANCES, |
1415 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
|
|
1413 |
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], |
|
1416 | 1414 |
"[<instance>...]", |
1417 | 1415 |
"Lists the instances and their status. The available fields are" |
1418 | 1416 |
" (see the man page for details): status, oper_state, oper_ram," |
... | ... | |
1424 | 1422 |
), |
1425 | 1423 |
'reinstall': ( |
1426 | 1424 |
ReinstallInstance, [ArgInstance(min=1)], |
1427 |
[DEBUG_OPT, FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt,
|
|
1425 |
[FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt, |
|
1428 | 1426 |
m_sec_node_opt, m_clust_opt, m_inst_opt, SELECT_OS_OPT, SUBMIT_OPT], |
1429 | 1427 |
"[-f] <instance>", "Reinstall a stopped instance"), |
1430 | 1428 |
'remove': ( |
1431 | 1429 |
RemoveInstance, ARGS_ONE_INSTANCE, |
1432 |
[DEBUG_OPT, FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT],
|
|
1430 |
[FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT], |
|
1433 | 1431 |
"[-f] <instance>", "Shuts down the instance and removes it"), |
1434 | 1432 |
'rename': ( |
1435 | 1433 |
RenameInstance, |
1436 | 1434 |
[ArgInstance(min=1, max=1), ArgHost(min=1, max=1)], |
1437 |
[DEBUG_OPT, NOIPCHECK_OPT, SUBMIT_OPT],
|
|
1435 |
[NOIPCHECK_OPT, SUBMIT_OPT], |
|
1438 | 1436 |
"<instance> <new_name>", "Rename the instance"), |
1439 | 1437 |
'replace-disks': ( |
1440 | 1438 |
ReplaceDisks, ARGS_ONE_INSTANCE, |
1441 |
[DEBUG_OPT, AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT,
|
|
1439 |
[AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, |
|
1442 | 1440 |
NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT], |
1443 | 1441 |
"[-s|-p|-n NODE|-I NAME] <instance>", |
1444 | 1442 |
"Replaces all disks for the instance"), |
1445 | 1443 |
'modify': ( |
1446 | 1444 |
SetInstanceParams, ARGS_ONE_INSTANCE, |
1447 |
[BACKEND_OPT, DEBUG_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, |
|
1448 |
NET_OPT, SUBMIT_OPT], |
|
1445 |
[BACKEND_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT], |
|
1449 | 1446 |
"<instance>", "Alters the parameters of an instance"), |
1450 | 1447 |
'shutdown': ( |
1451 | 1448 |
ShutdownInstance, [ArgInstance(min=1)], |
1452 |
[DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt,
|
|
1449 |
[m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, |
|
1453 | 1450 |
m_inst_opt, m_force_multi, SUBMIT_OPT], |
1454 | 1451 |
"<instance>", "Stops an instance"), |
1455 | 1452 |
'startup': ( |
1456 | 1453 |
StartupInstance, [ArgInstance(min=1)], |
1457 |
[DEBUG_OPT, FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt,
|
|
1454 |
[FORCE_OPT, m_force_multi, m_node_opt, m_pri_node_opt, |
|
1458 | 1455 |
m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT, HVOPTS_OPT, |
1459 | 1456 |
BACKEND_OPT], |
1460 | 1457 |
"<instance>", "Starts an instance"), |
1461 | 1458 |
'reboot': ( |
1462 | 1459 |
RebootInstance, [ArgInstance(min=1)], |
1463 |
[DEBUG_OPT, m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, |
|
1464 |
m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, |
|
1465 |
SUBMIT_OPT], |
|
1460 |
[m_force_multi, REBOOT_TYPE_OPT, IGNORE_SECONDARIES_OPT, m_node_opt, |
|
1461 |
m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt, SUBMIT_OPT], |
|
1466 | 1462 |
"<instance>", "Reboots an instance"), |
1467 | 1463 |
'activate-disks': ( |
1468 |
ActivateDisks, ARGS_ONE_INSTANCE, |
|
1469 |
[DEBUG_OPT, SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1464 |
ActivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, IGNORE_SIZE_OPT], |
|
1470 | 1465 |
"<instance>", "Activate an instance's disks"), |
1471 | 1466 |
'deactivate-disks': ( |
1472 |
DeactivateDisks, ARGS_ONE_INSTANCE, |
|
1473 |
[DEBUG_OPT, SUBMIT_OPT], |
|
1467 |
DeactivateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT], |
|
1474 | 1468 |
"<instance>", "Deactivate an instance's disks"), |
1475 | 1469 |
'recreate-disks': ( |
1476 |
RecreateDisks, ARGS_ONE_INSTANCE, |
|
1477 |
[DEBUG_OPT, SUBMIT_OPT, DISKIDX_OPT], |
|
1470 |
RecreateDisks, ARGS_ONE_INSTANCE, [SUBMIT_OPT, DISKIDX_OPT], |
|
1478 | 1471 |
"<instance>", "Recreate an instance's disks"), |
1479 | 1472 |
'grow-disk': ( |
1480 | 1473 |
GrowDisk, |
1481 | 1474 |
[ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), |
1482 | 1475 |
ArgUnknown(min=1, max=1)], |
1483 |
[DEBUG_OPT, SUBMIT_OPT, NWSYNC_OPT],
|
|
1476 |
[SUBMIT_OPT, NWSYNC_OPT], |
|
1484 | 1477 |
"<instance> <disk> <size>", "Grow an instance's disk"), |
1485 | 1478 |
'list-tags': ( |
1486 |
ListTags, ARGS_ONE_INSTANCE, [DEBUG_OPT],
|
|
1479 |
ListTags, ARGS_ONE_INSTANCE, [], |
|
1487 | 1480 |
"<instance_name>", "List the tags of the given instance"), |
1488 | 1481 |
'add-tags': ( |
1489 | 1482 |
AddTags, [ArgInstance(min=1, max=1), ArgUnknown()], |
1490 |
[DEBUG_OPT, TAG_SRC_OPT],
|
|
1483 |
[TAG_SRC_OPT], |
|
1491 | 1484 |
"<instance_name> tag...", "Add tags to the given instance"), |
1492 | 1485 |
'remove-tags': ( |
1493 | 1486 |
RemoveTags, [ArgInstance(min=1, max=1), ArgUnknown()], |
1494 |
[DEBUG_OPT, TAG_SRC_OPT],
|
|
1487 |
[TAG_SRC_OPT], |
|
1495 | 1488 |
"<instance_name> tag...", "Remove tags from given instance"), |
1496 | 1489 |
} |
1497 | 1490 |
|
b/scripts/gnt-job | ||
---|---|---|
345 | 345 |
commands = { |
346 | 346 |
'list': ( |
347 | 347 |
ListJobs, [ArgJobId()], |
348 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, FIELDS_OPT],
|
|
348 |
[NOHDR_OPT, SEP_OPT, FIELDS_OPT], |
|
349 | 349 |
"[job_id ...]", |
350 | 350 |
"List the jobs and their status. The available fields are" |
351 | 351 |
" (see the man page for details): id, status, op_list," |
... | ... | |
353 | 353 |
" The default field" |
354 | 354 |
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS)), |
355 | 355 |
'archive': ( |
356 |
ArchiveJobs, [ArgJobId(min=1)], [DEBUG_OPT],
|
|
356 |
ArchiveJobs, [ArgJobId(min=1)], [], |
|
357 | 357 |
"<job-id> [<job-id> ...]", "Archive specified jobs"), |
358 | 358 |
'autoarchive': ( |
359 | 359 |
AutoArchiveJobs, |
360 | 360 |
[ArgSuggest(min=1, max=1, choices=["1d", "1w", "4w"])], |
361 |
[DEBUG_OPT],
|
|
361 |
[], |
|
362 | 362 |
"<age>", "Auto archive jobs older than the given age"), |
363 | 363 |
'cancel': ( |
364 |
CancelJobs, [ArgJobId(min=1)], [DEBUG_OPT],
|
|
364 |
CancelJobs, [ArgJobId(min=1)], [], |
|
365 | 365 |
"<job-id> [<job-id> ...]", "Cancel specified jobs"), |
366 | 366 |
'info': ( |
367 |
ShowJobs, [ArgJobId(min=1)], [DEBUG_OPT],
|
|
367 |
ShowJobs, [ArgJobId(min=1)], [], |
|
368 | 368 |
"<job-id> [<job-id> ...]", |
369 | 369 |
"Show detailed information about the specified jobs"), |
370 | 370 |
'watch': ( |
371 |
WatchJob, [ArgJobId(min=1, max=1)], [DEBUG_OPT],
|
|
371 |
WatchJob, [ArgJobId(min=1, max=1)], [], |
|
372 | 372 |
"<job-id>", "Follows a job and prints its output as it arrives"), |
373 | 373 |
} |
374 | 374 |
|
b/scripts/gnt-node | ||
---|---|---|
624 | 624 |
commands = { |
625 | 625 |
'add': ( |
626 | 626 |
AddNode, [ArgHost(min=1, max=1)], |
627 |
[DEBUG_OPT, SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT],
|
|
627 |
[SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT], |
|
628 | 628 |
"[-s ip] [--readd] [--no-ssh-key-check] <node_name>", |
629 | 629 |
"Add a node to the cluster"), |
630 | 630 |
'evacuate': ( |
631 | 631 |
EvacuateNode, ARGS_ONE_NODE, |
632 |
[DEBUG_OPT, FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT],
|
|
632 |
[FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT], |
|
633 | 633 |
"[-f] {-I <iallocator> | -n <dst>} <node>", |
634 | 634 |
"Relocate the secondary instances from a node" |
635 | 635 |
" to other nodes (only for instances with drbd disk template)"), |
636 | 636 |
'failover': ( |
637 |
FailoverNode, ARGS_ONE_NODE, |
|
638 |
[DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT], |
|
637 |
FailoverNode, ARGS_ONE_NODE, [FORCE_OPT, IGNORE_CONSIST_OPT], |
|
639 | 638 |
"[-f] <node>", |
640 | 639 |
"Stops the primary instances on a node and start them on their" |
641 | 640 |
" secondary node (only for instances with drbd disk template)"), |
642 | 641 |
'migrate': ( |
643 |
MigrateNode, ARGS_ONE_NODE, |
|
644 |
[DEBUG_OPT, FORCE_OPT, NONLIVE_OPT], |
|
642 |
MigrateNode, ARGS_ONE_NODE, [FORCE_OPT, NONLIVE_OPT], |
|
645 | 643 |
"[-f] <node>", |
646 | 644 |
"Migrate all the primary instance on a node away from it" |
647 | 645 |
" (only for instances of type drbd)"), |
648 | 646 |
'info': ( |
649 |
ShowNodeConfig, ARGS_MANY_NODES, [DEBUG_OPT],
|
|
647 |
ShowNodeConfig, ARGS_MANY_NODES, [], |
|
650 | 648 |
"[<node_name>...]", "Show information about the node(s)"), |
651 | 649 |
'list': ( |
652 | 650 |
ListNodes, ARGS_MANY_NODES, |
653 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
|
|
651 |
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT], |
|
654 | 652 |
"[nodes...]", |
655 | 653 |
"Lists the nodes in the cluster. The available fields are (see the man" |
656 | 654 |
" page for details): %s. The default field list is (in order): %s." % |
657 | 655 |
(", ".join(_LIST_HEADERS), ", ".join(_LIST_DEF_FIELDS))), |
658 | 656 |
'modify': ( |
659 | 657 |
SetNodeParams, ARGS_ONE_NODE, |
660 |
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT],
|
|
658 |
[FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT], |
|
661 | 659 |
"<node_name>", "Alters the parameters of a node"), |
662 | 660 |
'powercycle': ( |
663 | 661 |
PowercycleNode, ARGS_ONE_NODE, |
664 |
[DEBUG_OPT, FORCE_OPT, CONFIRM_OPT],
|
|
662 |
[FORCE_OPT, CONFIRM_OPT], |
|
665 | 663 |
"<node_name>", "Tries to forcefully powercycle a node"), |
666 | 664 |
'remove': ( |
667 |
RemoveNode, ARGS_ONE_NODE, [DEBUG_OPT],
|
|
665 |
RemoveNode, ARGS_ONE_NODE, [], |
|
668 | 666 |
"<node_name>", "Removes a node from the cluster"), |
669 | 667 |
'volumes': ( |
670 | 668 |
ListVolumes, [ArgNode()], |
671 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
|
|
669 |
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
|
672 | 670 |
"[<node_name>...]", "List logical volumes on node(s)"), |
673 | 671 |
'physical-volumes': ( |
674 | 672 |
ListPhysicalVolumes, ARGS_MANY_NODES, |
675 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, |
|
676 |
FIELDS_OPT, _STORAGE_TYPE_OPT], |
|
677 |
"[<node_name>...]", |
|
678 |
"List physical volumes on node(s)"), |
|
673 |
[NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, _STORAGE_TYPE_OPT], |
|
674 |
"[<node_name>...]", "List physical volumes on node(s)"), |
|
679 | 675 |
'modify-volume': ( |
680 | 676 |
ModifyVolume, |
681 | 677 |
[ArgNode(min=1, max=1), |
682 | 678 |
ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES), |
683 | 679 |
ArgFile(min=1, max=1)], |
684 |
[DEBUG_OPT, ALLOCATABLE_OPT], |
|
685 |
"<node_name> <storage_type> <name>", |
|
686 |
"Modify storage volume on a node"), |
|
680 |
[], |
|
681 |
"<node_name> <storage_type> <name>", "Modify storage volume on a node"), |
|
687 | 682 |
'repair-volume': ( |
688 | 683 |
RepairVolume, |
689 | 684 |
[ArgNode(min=1, max=1), |
690 | 685 |
ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES), |
691 | 686 |
ArgFile(min=1, max=1)], |
692 |
[DEBUG_OPT],
|
|
687 |
[], |
|
693 | 688 |
"<node_name> <storage_type> <name>", |
694 | 689 |
"Repairs a storage volume on a node"), |
695 | 690 |
'list-tags': ( |
696 |
ListTags, ARGS_ONE_NODE, [DEBUG_OPT],
|
|
691 |
ListTags, ARGS_ONE_NODE, [], |
|
697 | 692 |
"<node_name>", "List the tags of the given node"), |
698 | 693 |
'add-tags': ( |
699 |
AddTags, [ArgNode(min=1, max=1), ArgUnknown()], |
|
700 |
[DEBUG_OPT, TAG_SRC_OPT], |
|
694 |
AddTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT], |
|
701 | 695 |
"<node_name> tag...", "Add tags to the given node"), |
702 | 696 |
'remove-tags': ( |
703 |
RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()], |
|
704 |
[DEBUG_OPT, TAG_SRC_OPT], |
|
697 |
RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT], |
|
705 | 698 |
"<node_name> tag...", "Remove tags from the given node"), |
706 | 699 |
} |
707 | 700 |
|
b/scripts/gnt-os | ||
---|---|---|
146 | 146 |
|
147 | 147 |
commands = { |
148 | 148 |
'list': ( |
149 |
ListOS, ARGS_NONE, [DEBUG_OPT, NOHDR_OPT], |
|
150 |
"", "Lists all valid OSes on the master"), |
|
149 |
ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid OSes on the master"), |
|
151 | 150 |
'diagnose': ( |
152 |
DiagnoseOS, ARGS_NONE, [DEBUG_OPT], "", "Diagnose all OSes"),
|
|
151 |
DiagnoseOS, ARGS_NONE, [], "", "Diagnose all OSes"), |
|
153 | 152 |
} |
154 | 153 |
|
155 | 154 |
if __name__ == '__main__': |
Also available in: Unified diff