Alarm API does not validate schema in alarm_actions

Bug #1342673 reported by Rikimaru Honjo
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
Rikimaru Honjo

Bug Description

Currently, alarm API does not validate schema in alarm_actions.
When invalid schema is specified, error occurs later in alarm notifier.
Schema should be validated in advance in API.

Reproduce:
1.For example, an alarm with alarm_actions is set to 'spam://localhost:80/alarm', where the schema 'spam' is invalid, can be defined.

$ curl -v -X POST -H 'X-Auth-Token:bd8659bcc3154eeaa895e4a765de02b0' -H 'Content-type: application/json' -d '{"alarm_actions": ["spam://localhost:80/alarm"], "name": "TestAlarm", "threshold_rule": {"meter_name":"image", "period":10, "comparison_operator":"eq", "threshold":1.0, "statistic": "avg", "evaluation_periods":10}, "type": "threshold"}' http://localhost:8777/v2/alarms

2.When alarm notifier try to notify with the alarm_action defined, following error occurs.

2014-07-14 16:25:30.721 4429 ERROR ceilometer.alarm.service [-] Action spam for alarm 4d4fba29-2703-4b52-acca-589c9c07856c is unknown, cannot notify

Changed in ceilometer:
assignee: nobody → Rikimaru Honjo (honjo-rikimaru-c6)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/107330

Changed in ceilometer:
status: New → In Progress
Eoghan Glynn (eglynn)
Changed in ceilometer:
importance: Undecided → Medium
milestone: none → juno-3
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-3 → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/107330
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=3e8f8e988fde82713461740058ba8e12c7d8820f
Submitter: Jenkins
Branch: master

commit 3e8f8e988fde82713461740058ba8e12c7d8820f
Author: Rikimaru Honjo <email address hidden>
Date: Wed Sep 3 21:28:02 2014 +0900

    Add validate alarm_actions schema in alarm API

    Currently, alarm API does not validate schema in alarm_actions.
    When invalid schema is specified, error occurs later in alarm notifier.
    Schema should be validated in advance in API.

    Change-Id: I3b28cfe36c460daead2945ba3577fbc1274f9d91
    Closes-bug: #1342673

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.