File: watcher.rst

package info (click to toggle)
python-watcherclient 4.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 852 kB
  • sloc: python: 8,569; makefile: 29; sh: 2
file content (89 lines) | stat: -rw-r--r-- 2,707 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
===============================================
:program:`watcher` Command-Line Interface (CLI)
===============================================

.. 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
OpenStack infra-optim Service (Watcher).

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 :option:``--os-username``, :option:``--os-password``,
:option:``--os-tenant-id`` (or :option:``--os-tenant-name``),
and :option:``--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/v3/

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 :option:``--watcher-url`` and
:option:``--os-auth-token``, or by setting the corresponding environment variables::

    $ export WATCHER_URL=http://watcher.example.org:9322/
    $ export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155

Since Keystone can return multiple regions in the Service Catalog, you can
specify the one you want with :option:``--os-region-name`` or set the following
environment variable. (It defaults to the first in the list returned.)
::

    $ export OS_REGION_NAME=region

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://opendev.org/openstack/python-watcherclient/src/branch/master/tools/watcher.bash_completion)
to your terminal and then bash completion should work::

    $ . watcher.bash_completion

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::

    $ watcher help

To get usage and options of a command, run::

    $ watcher help <command>


EXAMPLES
========

Get information about the audit-create command::

    $ watcher help audit create

Get a list of available goal::

    $ watcher goal list

Get a list of audits::

    $ watcher audit list