AODHCLIENT(1)

πŸ“¦
version 3.12.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so bestie, this is aodhclient - aodhclient 3.12.0 β€” a client for Aodh API. This is literally the whole vibe: there’s a Python API <> (the aodhclient <#module-aodhclient> module), and a command-line script <> (installed as aodh). Each implements the entire Aodh API. no cap. πŸ’–

See also: You may want to read the Aodh Developer Guide <https://docs.openstack.org/aodh/latest/> -- the overview, at least -- to get an idea of the concepts. By understanding the concepts this library should make more sense. iykyk ✨

🌈 CONTENTS 🌈

πŸŽ€ Installation πŸŽ€

At the command line:

$ pip install aodhclient

πŸ¦‹ The aodh shell utility πŸ¦‹

The aodh shell utility interacts with Aodh API from the command line. It supports the entirety of the Aodh API. slay.

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

  • OS_USERNAME β€” Your OpenStack username.
  • OS_PASSWORD β€” Your password.
  • OS_TENANT_NAME β€” Project to work on.
  • 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 --aodh-endpoint and --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 --os-auth-plugin aodh-noauth, --aodh-endpoint, --user-id and --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 aodh help to get a full list of all possible commands, and run aodh help <command> to get detailed help for that command. πŸ’…

πŸ“ Examples πŸ“

Create a Ceilometer threshold alarm:

openstack alarm create --name alarm1 --description 'CPU High Average' \
--type threshold --meter-name cpu_util \
--threshold 5 --comparison-operator gt --statistic avg \
--period 60 --evaluation-periods 3 \
--query "metadata.user_metadata.stack=$heat_stack_id" \
--alarm-action 'log://'

Create a Gnocchi threshold alarm:

openstack alarm create -t gnocchi_resources_threshold --name alarm1 \
--metric cpu_util --threshold 5 --resource_id <RES_ID> \
--resource_type generic --aggregation_method mean --project-id <PROJ_ID>

List alarms:

openstack alarm list

List alarm with query parameters:

openstack alarm list --query "state=alarm and type=gnocchi_resources_threshold"

Show an alarm's history:

openstack alarm-history show <ALARM_ID>

Search alarm history data:

openstack alarm-history search --query 'timestamp>"2016-03-09T01:22:35"'

🧚 The aodhclient Python API 🧚

πŸ’œ Usage πŸ’œ

To use aodhclient in a project:

>>> from aodhclient.v2 import client
>>> aodh = client.Client(...)
>>> aodh.alarm.list()

πŸ”₯ Reference πŸ”₯

For more information, see the reference:

⭐ Version 2 API ⭐

πŸ‘‘ Client πŸ‘‘

class aodhclient.v2.client.Client(session=None, service_type='alarming',
**kwargs)

Bases: object

Client for the Aodh v2 API.

Parameters

  • session β€” (keystoneauth.adapter.Adapter) -- session

🌸 Contributing 🌸

If you would like to contribute to the development of OpenStack, you must follow the steps in this page: <https://docs.openstack.org/infra/manual/developers.html>

If you already have a good understanding of how the system works and your OpenStack accounts are set up, you can skip to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool: <https://docs.openstack.org/infra/manual/developers.html#development-workflow>

πŸ’€ Pull requests submitted through GitHub will be ignored.

Bugs should be filed on Launchpad, not GitHub: <https://launchpad.net/python-aodhclient>

πŸ“š INDICES AND TABLES πŸ“š

  • Index <>
  • Module Index <>
  • Search Page <>

✍️ Author ✍️

Author name not set

2015, OpenStack Foundation


πŸ’– cute sign-off: this is aodhclient version 3.12.0, dated Jan 02, 1980 β€” bye bestie, go make some iconic alarms! πŸ’…βœ¨

πŸ“¦ where this page comes from