diff --git a/aodh/api/controllers/v2/alarms.py b/aodh/api/controllers/v2/alarms.py index e4360738e..4d6938004 100644 --- a/aodh/api/controllers/v2/alarms.py +++ b/aodh/api/controllers/v2/alarms.py @@ -21,8 +21,10 @@ import datetime import itertools import json +import warnings import croniter +import debtcollector from oslo_config import cfg from oslo_log import log from oslo_utils import netutils @@ -265,6 +267,12 @@ class Alarm(base.Base): @staticmethod def validate(alarm): + if alarm.type == 'threshold': + warnings.simplefilter("always") + debtcollector.deprecate( + "Ceilometer's API is deprecated as of Ocata. Therefore, " + " threshold rule alarms are no longer supported.", + version="5.0.0") Alarm.check_rule(alarm) Alarm.check_alarm_actions(alarm) diff --git a/releasenotes/notes/deprecate-threshold-alarm-d89da351d4f6f50f.yaml b/releasenotes/notes/deprecate-threshold-alarm-d89da351d4f6f50f.yaml new file mode 100644 index 000000000..3d4f54658 --- /dev/null +++ b/releasenotes/notes/deprecate-threshold-alarm-d89da351d4f6f50f.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + Ceilometer's API is deprecated in Ocata. Therefore, threshold alarms are + now deprecated as well. Threshold rules will be removed when Ceilometer's + API is also removed. Similar functionality is provided through Gnocchi + alarm rules: ``gnocchi_resources_threshold``, + ``gnocchi_aggregation_by_metrics_threshold``, or + ``gnocchi_aggregation_by_resources_threshold``. diff --git a/requirements.txt b/requirements.txt index 92d2e4587..b73df314c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,3 +34,4 @@ WSME>=0.8 cachetools>=1.1.6 cotyledon keystoneauth1>=2.1 +debtcollector>=1.2.0 # Apache-2.0