From 69cfeca3627d74b12f38ca463af0b5ea519f315d Mon Sep 17 00:00:00 2001 From: gord chung Date: Tue, 28 Feb 2017 10:17:22 -0500 Subject: [PATCH] deprecate threshold rule alarms ceilometer's api is deprecated, so threshold rule alarms cannot exist either. Change-Id: I69a5778edb62843acc36b5366947071745fb43b4 --- aodh/api/controllers/v2/alarms.py | 8 ++++++++ .../deprecate-threshold-alarm-d89da351d4f6f50f.yaml | 9 +++++++++ requirements.txt | 1 + 3 files changed, 18 insertions(+) create mode 100644 releasenotes/notes/deprecate-threshold-alarm-d89da351d4f6f50f.yaml 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 1f38f8b67..a21d9296d 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