File: v2.rst

package info (click to toggle)
aodh 20.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,936 kB
  • sloc: python: 11,347; sh: 316; makefile: 206
file content (105 lines) | stat: -rw-r--r-- 3,390 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
==========
V2 Web API
==========

Capabilities
============

The Capabilities API allows you to directly discover which functions from the
V2 API functionality, including the selectable aggregate functions, are
supported by the currently configured storage driver. A capabilities query
returns a flattened dictionary of properties with associated boolean values -
a 'False' or absent value means that the corresponding feature is not
available in the backend.

.. rest-controller:: aodh.api.controllers.v2.capabilities:CapabilitiesController
   :webprefix: /v2/capabilities

.. autotype:: aodh.api.controllers.v2.capabilities.Capabilities
   :members:

.. _alarms-api:

Alarms
======

.. rest-controller:: aodh.api.controllers.v2.alarms:AlarmsController
   :webprefix: /v2/alarms

.. rest-controller:: aodh.api.controllers.v2.alarms:AlarmController
   :webprefix: /v2/alarms

.. autotype:: aodh.api.controllers.v2.alarms.Alarm
   :members:

.. autotype:: aodh.api.controllers.v2.alarm_rules.gnocchi.MetricOfResourceRule
   :members:

.. autotype:: aodh.api.controllers.v2.alarm_rules.gnocchi.AggregationMetricByResourcesLookupRule
   :members:

.. autotype:: aodh.api.controllers.v2.alarm_rules.gnocchi.AggregationMetricsByIdLookupRule
   :members:

.. autotype:: aodh.api.controllers.v2.alarms.AlarmTimeConstraint
   :members:

.. autotype:: aodh.api.controllers.v2.alarms.AlarmChange
   :members:

Filtering Queries
=================

The filter expressions of the query feature operate on the fields of *Alarm*
and *AlarmChange*. The following comparison operators are supported: *=*, *!=*,
*<*, *<=*, *>*, *>=* and *in*; and the following logical operators can be used:
*and* *or* and *not*. The field names are validated against the database
models.

Complex Query supports defining the list of orderby expressions in the form
of [{"field_name": "asc"}, {"field_name2": "desc"}, ...].

The number of the returned items can be bounded using the *limit* option.

The *filter*, *orderby* and *limit* are all optional fields in a query.

.. rest-controller:: aodh.api.controllers.v2.query:QueryAlarmsController
   :webprefix: /v2/query/alarms

.. rest-controller:: aodh.api.controllers.v2.query:QueryAlarmHistoryController
   :webprefix: /v2/query/alarms/history

.. autotype:: aodh.api.controllers.v2.query.ComplexQuery
   :members:

Composite rule Alarm
====================

The *composite* type alarm allows users to specify a composite rule to define
an alarm with multiple triggering conditions, using a combination of *and* and
*or* relations. A composite rule is composed of multiple threshold rules or
gnocchi rules. A sample composite alarm request form is as follows::

   {
       "name": "test_composite",
       "type": "composite",
       "composite_rule": {
           "and": [THRESHOLD_RULE1, THRESHOLD_RULE2, {
               'or': [THRESHOLD_RULE3, GNOCCHI_RULE1,
                      GNOCCHI_RULE2, GNOCCHI_RULE3]
           }]
       }
   }

A sub-rule in composite_rule is same as a threshold_rule in threshold alarm
or a gnocchi_rule in gnocchi alarm. Additionally it has a mandatory *type*
field to specify the rule type, like in the following sample::

   {
       "threshold": 0.8,
       "meters": [
           "f6857d3f-bde6-441a-aa1d-e98fa4ea543f",
           "ea1491ca-5309-4b5a-9f05-34409c6e8b6c"
       ],
       "type": "gnocchi_resources_threshold"
   }