aodh/doc/source/contributor/webapi/v2.rst
Mehdi Abaakouk b53d862bb5 Remove ceilometer-api alarm type
This change removes the deprecated 'threshold' alarm type from Aodh.

This also removes the useless ceilometerclient dependency.

Depends-On: Id89130fd8a782dea863c85b37a919fbf0f0897dd
Change-Id: I7ccf930f2ad0316dbda0675a2ec0344e61986022
2018-01-12 21:03:25 +01:00

3.3 KiB

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.

aodh.api.controllers.v2.capabilities:CapabilitiesController

aodh.api.controllers.v2.capabilities.Capabilities

Alarms

aodh.api.controllers.v2.alarms:AlarmsController

aodh.api.controllers.v2.alarms:AlarmController

aodh.api.controllers.v2.alarms.Alarm

aodh.api.controllers.v2.alarm_rules.gnocchi.MetricOfResourceRule

aodh.api.controllers.v2.alarm_rules.gnocchi.AggregationMetricByResourcesLookupRule

aodh.api.controllers.v2.alarm_rules.gnocchi.AggregationMetricsByIdLookupRule

aodh.api.controllers.v2.alarms.AlarmTimeConstraint

aodh.api.controllers.v2.alarms.AlarmChange

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.

aodh.api.controllers.v2.query:QueryAlarmsController

aodh.api.controllers.v2.query:QueryAlarmHistoryController

aodh.api.controllers.v2.query.ComplexQuery

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"
}