Files
python-ironicclient/doc/source/cli.rst
Ramakrishnan G 1155530941 Add bash completion support for ironic cli
This commit adds the 'bash-completion' option to
ironic cli which prints all sub-commands and
options, and bash_completion scripts for bash
auto completion.

Change-Id: Ide5b29e262b4217046f124d86902cd0abfdab1b6
Closes-Bug: 1332408
2014-07-09 22:50:12 +05:30

2.4 KiB

ironic Command-Line Interface (CLI)

ironic

SYNOPSIS

ironic [options] <command> [command-options]

ironic help

ironic help <command>

DESCRIPTION

The ironic command-line interface (CLI) interacts with the OpenStack Bare Metal Service (Ironic).

In order to use the CLI, you must provide your OpenStack username, password, project (historically called tenant), and auth endpoint. You can use configuration options --os-username, --os-password, --os-tenant-id (or --os-tenant-name), and --os-auth-url, or set the corresponding environment variables:

export OS_USERNAME=user
export OS_PASSWORD=password
export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b   # or OS_TENANT_NAME
export OS_TENANT_NAME=project                          # or OS_TENANT_ID
export OS_AUTH_URL=http://auth.example.com:5000/v2.0

The command-line tool will attempt to reauthenticate using the provided credentials for every request. You can override this behavior by manually supplying an auth token using --ironic-url and --os-auth-token, or by setting the corresponding environment variables:

export IRONIC_URL=http://ironic.example.org:6385/
export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155

Ironic cli supports bash completion. The command-line tool can automatically fill partially typed commands. To use this feature, source the below file to your terminal and then bash completion should work:

source tools/ironic.bash_completion

To avoid doing this everytime, add this to your .bashrc or copy the ironic.bash_completion file to the default bash completion scripts directory on your linux distribution.

OPTIONS

To get a list of available (sub)commands and options, run:

ironic help

To get usage and options of a command, run:

ironic help <command>

EXAMPLES

Get information about the node-create command:

ironic help node-create

Get a list of available drivers:

ironic driver-list

Enroll a node with "fake" deploy driver and "ipmitool" power driver:

ironic node-create -d fake_ipmitool -i ipmi_address=1.2.3.4

Get a list of nodes:

ironic node-list