cli_option("--no-wait-for-sync", dest="wait_for_sync", default=True,
action="store_false", help="Don't wait for sync (DANGEROUS!)"),
cli_option("--src-node", dest="src_node", help="Source node",
- metavar="<node>"),
+ metavar="<node>",
+ completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("--src-dir", dest="src_dir", help="Source directory",
metavar="<dir>"),
cli_option("--no-ip-check", dest="ip_check", default=True,
" is alive"),
cli_option("-I", "--iallocator", metavar="<NAME>",
help="Select nodes for the instance automatically using the"
- " <NAME> iallocator plugin", default=None, type="string"),
+ " <NAME> iallocator plugin", default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
cli_option("--file-storage-dir", dest="file_storage_dir",
help="Relative path under default cluster-wide file storage dir"
" to store file-based disks", default=None,
[DEBUG_OPT,
cli_option("--node", dest="nodes", default=[], action="append",
help="List only backups stored on this node"
- " (can be used multiple times)"),
+ " (can be used multiple times)",
+ completion_suggest=OPT_COMPL_ONE_NODE),
],
"", "Lists instance exports available in the ganeti cluster"),
'export': (ExportInstance, ARGS_ONE_INSTANCE,
[DEBUG_OPT, FORCE_OPT,
cli_option("-n", "--node", dest="node", help="Target node",
- metavar="<node>"),
+ metavar="<node>",
+ completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("","--noshutdown", dest="shutdown",
action="store_false", default=True,
help="Don't shutdown the instance (unsafe)"), ],
" results (out)"),
cli_option("--algorithm", dest="allocator",
default=None,
- help="Allocator algorithm name"),
+ help="Allocator algorithm name",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
cli_option("-m", "--mode", default="relocate",
choices=["relocate", "allocate"],
help="Request mode, either allocate or"
" definition is of form mac/ip/bridge, if"
" missing values are replace by None"),
cli_option("-o", "--os-type", default=None,
- help="Select os for the instance"),
+ help="Select os for the instance",
+ completion_suggest=OPT_COMPL_ONE_OS),
cli_option("-p", "--vcpus", default=1, type="int",
help="Select number of VCPUs for the instance"),
cli_option("--tags", default=None,
# options used in more than one cmd
node_opt = cli_option("-n", "--node", dest="node", help="Target node",
- metavar="<node>")
+ metavar="<node>",
+ completion_suggest=OPT_COMPL_ONE_NODE)
os_opt = cli_option("-o", "--os-type", dest="os", help="What OS to run",
- metavar="<os>")
+ metavar="<os>",
+ completion_suggest=OPT_COMPL_ONE_OS)
# multi-instance selection options
m_force_multi = cli_option("--force-multiple", dest="force_multi",
choices=list(constants.FILE_DRIVER)),
cli_option("-I", "--iallocator", metavar="<NAME>",
help="Select nodes for the instance automatically using the"
- " <NAME> iallocator plugin", default=None, type="string"),
+ " <NAME> iallocator plugin", default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
cli_option("-H", "--hypervisor", dest="hypervisor",
help="Hypervisor and hypervisor options, in the format"
" hypervisor:option=value,option=value,...", default=None,
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT,
cli_option("-n", "--new-node", dest="target_node",
help="Destinattion node", metavar="NODE",
- default=None),
+ default=None,
+ completion_suggest=OPT_COMPL_ONE_NODE),
],
"[-f] <instance>",
"Move instance to an arbitrary node"
cli_option("-n", "--new-secondary", dest="new_secondary",
help=("New secondary node (for secondary"
" node change)"), metavar="NODE",
- default=None),
+ default=None,
+ completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("-p", "--on-primary", dest="on_primary",
default=False, action="store_true",
help=("Replace the disk(s) on the primary"
" automatically using the"
" <NAME> iallocator plugin (enables"
" secondary node replacement)",
- default=None, type="string"),
+ default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
SUBMIT_OPT,
],
"[-s|-p|-n NODE|-I NAME] <instance>",
cli_option("-t", "--type", dest="reboot_type",
help="Type of reboot: soft/hard/full",
default=constants.INSTANCE_REBOOT_HARD,
- type="string", metavar="<REBOOT>"),
+ metavar="<REBOOT>",
+ choices=list(constants.REBOOT_TYPES)),
cli_option("--ignore-secondaries", dest="ignore_secondaries",
default=False, action="store_true",
help="Ignore errors from secondaries"),
[DEBUG_OPT, FORCE_OPT,
cli_option("-n", "--new-secondary", dest="dst_node",
help="New secondary node", metavar="NODE",
- default=None),
+ default=None,
+ completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("-I", "--iallocator", metavar="<NAME>",
help="Select new secondary for the instance"
" automatically using the"
" <NAME> iallocator plugin",
- default=None, type="string"),
+ default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
],
"[-f] {-I <iallocator> | -n <dst>} <node>",
"Relocate the secondary instances from a node"
OPTIONS = [
cli.cli_option("-o", "--os", dest="os", default=None,
help="OS to use during burnin",
- metavar="<OS>"),
+ metavar="<OS>",
+ completion_suggest=cli.OPT_COMPL_ONE_OS),
cli.cli_option("--disk-size", dest="disk_size",
help="Disk size (determines disk count)",
default="128m", type="string", metavar="<size,size,...>",
help="Disk template (diskless, file, plain or drbd) [drbd]"),
cli.cli_option("-n", "--nodes", dest="nodes", default="",
help=("Comma separated list of nodes to perform"
- " the burnin on (defaults to all nodes)")),
+ " the burnin on (defaults to all nodes)"),
+ completion_suggest=cli.OPT_COMPL_MANY_NODES),
cli.cli_option("-I", "--iallocator", dest="iallocator",
default=None, type="string",
help=("Perform the allocation using an iallocator"
" instead of fixed node spread (node restrictions no"
" longer apply, therefore -n/--nodes must not be"
- " used")),
+ " used"),
+ completion_suggest=cli.OPT_COMPL_ONE_IALLOCATOR),
cli.cli_option("-p", "--parallel", default=False, action="store_true",
dest="parallel",
help=("Enable parallelization of some operations in"