Aodh alarm is not updating and not giving any error, when updating the type from event to composite
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Aodh |
In Progress
|
Undecided
|
Rajat Dhasmana |
Bug Description
Release: Stable Newton
Ubuntu 16.04
Environment for NFV
Aodh alarm is not updating and not giving any error, when updating the type from event to composite.
Created with event type:
root@node-1:~# aodh alarm create --name mack --type event
+------
| Field | Value |
+------
| alarm_actions | [] |
| alarm_id | c1a3594f-
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_
| name | mack |
| ok_actions | [] |
| project_id | 9a036d420925419
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_timestamp | 2017-12-
| time_constraints | [] |
| timestamp | 2017-12-
| type | event |
| user_id | 4f40ae325991476
+------
Updating with composite type:
root@node-1:~# aodh alarm update --name mack --type composite --composite-rule '{"or": [{"threshold": 1, "meter_name": "cpu_util", "type": "threshold"}]}' --alarm-action https:/
+------
| Field | Value |
+------
| alarm_actions | [u'https:/
| alarm_id | c1a3594f-
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_
| name | mack |
| ok_actions | [] |
| project_id | 9a036d420925419
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_timestamp | 2017-12-
| time_constraints | [] |
| timestamp | 2017-12-
| type | event |
| user_id | 4f40ae325991476
+------
[[Showing old data which is of event type. Not giving any error.]]
Changed in aodh: | |
assignee: | nobody → Rajat Dhasmana (whoami-rajat) |
Changed in aodh: | |
assignee: | Rajat Dhasmana (whoami-rajat) → nobody |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
assignee: | nobody → Rajat Dhasmana (whoami-rajat) |
In aodh alarm update command, the following cases are missing in aodhclient code :
1) --type parameter is not parsed from CLI
2) no code for updating the type of an alarm
The server API is working fine that is verified using curl
Initially we have an alarm of type event
+------ ------- ------- ------- +------ ------- ------- ------- ------- ----+ ------- ------- ------- +------ ------- ------- ------- ------- ----+ example. org/notify'] | e032-4b92- 9acc-73a3e6cc84 2a | data_actions | [] | 7b3d0eb23a3216c b8 | 24T06:28: 43.327075 | 24T06:44: 01.708380 | 383467d88c5d473 3c | ------- ------- ------- +------ ------- ------- ------- ------- ----+
| Field | Value |
+------
| alarm_actions | [u'http://
| alarm_id | 91a6eba7-
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_
| name | new_alarm |
| ok_actions | [] |
| project_id | 185f9d1ec3a3422
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_reason | Not evaluated yet |
| state_timestamp | 2018-04-
| time_constraints | [] |
| timestamp | 2018-04-
| type | event |
| user_id | 8919e4c798044b4
+------
after executing curl to update type and rule of alarm
stack@ubuntu- xenial: /usr/local/ lib/python2. 7/dist- packages/ aodhclient/ v2$ curl -g -i -X PUT http:// 127.0.0. 1:8042/ v2/alarms/ 91a6eba7- e032-4b92- 9acc-73a3e6cc84 2a -H "Accept: application/json, */*" -H "Content-Type: application/json" -H "User-Agent: aodh keystoneauth1/3.5.0 python- requests/ 2.18.4 CPython/2.7.12" -H "X-Auth-Token: gAAAAABa3tDpsvI n1kr-13sTCuxMoo YpOY7NfsXARSo2U dq_CTUkSgBR- 1TpVPEuyN4WNfPF vuX-b957pzHRjd1 ywKZQWcf2HdiSPw DCchKgXtniyFwTl 5WAuGBT5_ 02cQ0E3hw- Y8eyxUSqdJ4H7ou eZlB14XXsNZgm6Z 9UiijZwBKGfUkMs bQ" -d '{"alarm_actions": ["http:// example. org/notify"], "project_id": "185f9d1ec3a342 27b3d0eb23a3216 cb8", "ok_actions": [], "name": "new_alarm", "timestamp": "2018-04- 24T06:29: 29.621336" , "description": "Alarm when * event occurred.", "time_constraints": [], "enabled": true, "state_timestamp": "2018-04- 24T06:28: 43.327075" , "state_reason": "Not evaluated yet", "alarm_id": "91a6eba7- e032-4b92- 9acc-73a3e6cc84 2a", "state": "insufficient data", "insufficient_ data_actions" : [], "repeat_actions": false, "user_id": "8919e4c798044b 4383467d88c5d47 33c", "composite_rule": {"type" :"gnocchi_ aggregation_ by_metrics_ threshold" ,"threshold" : 6, "metrics" :["80de2719- d9cc-47aa- adf7-601bd4f572 a5"], "evaluation_ periods" : 3, "granularity": 60, "comparison_ operator" : "ge", "aggregatio...