File: shell.rst

package info (click to toggle)
python-aodhclient 0.3.0-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 364 kB
  • sloc: python: 1,718; sh: 140; makefile: 45
file content (78 lines) | stat: -rw-r--r-- 2,342 bytes parent folder | download
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
The :program:`aodh` shell utility
=========================================

.. program:: aodh
.. highlight:: bash

The :program:`aodh` shell utility interacts with Aodh API
from the command line. It supports the entirety of the Aodh API excluding
deprecated combination alarms.

You'll need to provide :program:`aodh` with your OpenStack credentials.
You can do this with the :option:`--os-username`, :option:`--os-password`,
:option:`--os-tenant-id` and :option:`--os-auth-url` options, but it's easier to
just set them as environment variables:

.. envvar:: OS_USERNAME

    Your OpenStack username.

.. envvar:: OS_PASSWORD

    Your password.

.. envvar:: OS_TENANT_NAME

    Project to work on.

.. envvar:: OS_AUTH_URL

    The OpenStack auth server URL (keystone).

For example, in Bash you would use::

    export OS_USERNAME=user
    export OS_PASSWORD=pass
    export OS_TENANT_NAME=myproject
    export OS_AUTH_URL=http://auth.example.com:5000/v2.0

The command line tool will attempt to reauthenticate using your provided credentials
for every request. You can override this behavior by manually supplying an auth
token using :option:`--aodh-endpoint` and :option:`--os-auth-token`. You can alternatively
set these environment variables::

    export AODH_ENDPOINT=http://aodh.example.org:8041
    export OS_AUTH_PLUGIN=token
    export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155

Also, if the server doesn't support authentication, you can provide
:option:`--os-auth-plugon` aodh-noauth, :option:`--aodh-endpoint`, :option:`--user-id` 
and :option:`--project-id`. You can alternatively set these environment variables::

    export OS_AUTH_PLUGIN=aodh-noauth
    export AODH_ENDPOINT=http://aodh.example.org:8041
    export AODH_USER_ID=99aae-4dc2-4fbc-b5b8-9688c470d9cc
    export AODH_PROJECT_ID=c8d27445-48af-457c-8e0d-1de7103eae1f

From there, all shell commands take the form::

    aodh <command> [arguments...]

Run :program:`aodh help` to get a full list of all possible commands,
and run :program:`aodh help <command>` to get detailed help for that
command.

Examples
--------

Create an alarm::

    aodh alarm create --name alarm1 -m cpu_util --threshold 5

List alarms::

    aodh alarm list

Search for alarms::

    aodh alarm search --query "project_id=5a301761-f78b-46e2-8900-8b4f6fe6675a and type=instance"