2017-06-26 20:13:22 +08:00
|
|
|
===============================================
|
2015-06-04 14:59:34 +02:00
|
|
|
:program:`watcher` Command-Line Interface (CLI)
|
2017-06-26 20:13:22 +08:00
|
|
|
===============================================
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
.. program:: watcher
|
|
|
|
.. highlight:: bash
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
========
|
|
|
|
|
|
|
|
:program:`watcher` [options] <command> [command-options]
|
|
|
|
|
|
|
|
:program:`watcher help`
|
|
|
|
|
|
|
|
:program:`watcher help` <command>
|
|
|
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
===========
|
|
|
|
|
|
|
|
The :program:`watcher` command-line interface (CLI) interacts with the
|
2016-05-24 15:19:31 +02:00
|
|
|
OpenStack infra-optim Service (Watcher).
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
In order to use the CLI, you must provide your OpenStack username, password,
|
|
|
|
project (historically called tenant), and auth endpoint. You can use
|
2017-06-26 20:13:22 +08:00
|
|
|
configuration options :option:``--os-username``, :option:``--os-password``,
|
|
|
|
:option:``--os-tenant-id`` (or :option:``--os-tenant-name``),
|
|
|
|
and :option:``--os-auth-url``, or set the corresponding
|
2015-06-04 14:59:34 +02:00
|
|
|
environment variables::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ 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
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
The command-line tool will attempt to reauthenticate using the provided
|
|
|
|
credentials for every request. You can override this behavior by manually
|
2017-06-26 20:13:22 +08:00
|
|
|
supplying an auth token using :option:``--watcher-url`` and
|
|
|
|
:option:``--os-auth-token``, or by setting the corresponding environment variables::
|
2015-06-04 14:59:34 +02:00
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ export WATCHER_URL=http://watcher.example.org:9322/
|
|
|
|
$ export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
Since Keystone can return multiple regions in the Service Catalog, you can
|
2017-06-26 20:13:22 +08:00
|
|
|
specify the one you want with :option:``--os-region-name`` or set the following
|
2015-06-04 14:59:34 +02:00
|
|
|
environment variable. (It defaults to the first in the list returned.)
|
|
|
|
::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ export OS_REGION_NAME=region
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
Watcher CLI supports bash completion. The command-line tool can automatically
|
|
|
|
fill partially typed commands. To use this feature, source the below file
|
|
|
|
(available at
|
|
|
|
https://git.openstack.org/cgit/openstack/python-watcherclient/tree/tools/watcher.bash_completion)
|
|
|
|
to your terminal and then bash completion should work::
|
|
|
|
|
2017-08-29 02:42:07 +08:00
|
|
|
$ . watcher.bash_completion
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
To avoid doing this every time, add this to your ``.bashrc`` or copy the
|
|
|
|
watcher.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::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ watcher help
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
To get usage and options of a command, run::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ watcher help <command>
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
========
|
|
|
|
|
|
|
|
Get information about the audit-create command::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ watcher help audit create
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
Get a list of available goal::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ watcher goal list
|
2015-06-04 14:59:34 +02:00
|
|
|
|
|
|
|
Get a list of audits::
|
|
|
|
|
2016-05-24 15:19:31 +02:00
|
|
|
$ watcher audit list
|