could not update event alarm query

Bug #1576007 reported by ZhiQiang Fan on 2016-04-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-aodhclient
Undecided
ZhiQiang Fan

Bug Description

Traceback (most recent call last):
  File "/usr/local/bin/aodh", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/aodhclient/shell.py", line 185, in main
    return AodhShell().run(args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 226, in run
    result = self.run_subcommand(remainder)
  File "/usr/local/lib/python2.7/dist-packages/cliff/app.py", line 346, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 79, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/aodhclient/v2/alarm_cli.py", line 401, in take_action
    alarm_id=parsed_args.id, alarm_update=attributes)
  File "/usr/local/lib/python2.7/dist-packages/aodhclient/v2/alarm.py", line 122, in update
    data=jsonutils.dumps(alarm)).json()
  File "/usr/local/lib/python2.7/dist-packages/aodhclient/v2/base.py", line 45, in _put
    return self.client.api.put(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 182, in put
    return self.request(url, 'PUT', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/aodhclient/client.py", line 38, in request
    raise exceptions.from_response(resp, url, method)
aodhclient.exceptions.BadRequest: Invalid input for field/attribute data. Value: '{'alarm_actions': ['log://'], 'event_rule': {'query': 'traits.resource_id=0710189d-96d5-47d7-b52e-94f49a66b681', 'event_type': '*'}, 'ok_actions': ['log://'], 'name': 'test', 'state': 'alarm', 'timestamp': '2016-04-28T09:24:56.534655', 'enabled': True, 'state_timestamp': '2016-04-27T20:29:43.972349', 'severity': 'low', 'alarm_id': 'e513e3d2-bd2d-4f75-8eae-e5dd3a09faab', 'time_constraints': [], 'insufficient_data_actions': [], 'repeat_actions': True, 'user_id': 'af45735daaec4b28b8ef9b740b1a4216', 'project_id': 'f0bc5e67d29d4eb3a3001bf20a0b548c', 'type': 'event', 'description': 'Alarm when * event occurred.'}'. Value not a valid list: traits.resource_id=0710189d-96d5-47d7-b52e-94f49a66b681 (HTTP 400) (Request-ID: req-fee80967-8b0a-45a6-8baa-c607f68f86cc)

zqfan@BJWS:/opt/stack/aodh$ aodh alarm update e513e3d2-bd2d-4f75-8eae-e5dd3a09faab --query '{"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]}'
Invalid input for field/attribute data. Value: '{'alarm_actions': ['log://'], 'event_rule': {'query': '{"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]}', 'event_type': '*'}, 'ok_actions': ['log://'], 'name': 'test', 'state': 'alarm', 'timestamp': '2016-04-28T09:24:56.534655', 'enabled': True, 'state_timestamp': '2016-04-27T20:29:43.972349', 'severity': 'low', 'alarm_id': 'e513e3d2-bd2d-4f75-8eae-e5dd3a09faab', 'time_constraints': [], 'insufficient_data_actions': [], 'repeat_actions': True, 'user_id': 'af45735daaec4b28b8ef9b740b1a4216', 'project_id': 'f0bc5e67d29d4eb3a3001bf20a0b548c', 'type': 'event', 'description': 'Alarm when * event occurred.'}'. Value not a valid list: {"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]} (HTTP 400) (Request-ID: req-ccb77872-f002-43ec-b205-451957fe7dd5)

zqfan@BJWS:/opt/stack/aodh$ aodh alarm update e513e3d2-bd2d-4f75-8eae-e5dd3a09faab --query '[{"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]}]'
Invalid input for field/attribute data. Value: '{'alarm_actions': ['log://'], 'event_rule': {'query': '[{"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]}]', 'event_type': '*'}, 'ok_actions': ['log://'], 'name': 'test', 'state': 'alarm', 'timestamp': '2016-04-28T09:24:56.534655', 'enabled': True, 'state_timestamp': '2016-04-27T20:29:43.972349', 'severity': 'low', 'alarm_id': 'e513e3d2-bd2d-4f75-8eae-e5dd3a09faab', 'time_constraints': [], 'insufficient_data_actions': [], 'repeat_actions': True, 'user_id': 'af45735daaec4b28b8ef9b740b1a4216', 'project_id': 'f0bc5e67d29d4eb3a3001bf20a0b548c', 'type': 'event', 'description': 'Alarm when * event occurred.'}'. Value not a valid list: [{"and":[{"=":{"traits.resource_id": "0710189d-96d5-47d7-b52e-94f49a66b681"}}]}] (HTTP 400) (Request-ID: req-820db580-fed5-4058-b4ac-d04a708fb136)

ZhiQiang Fan (aji-zqfan) on 2016-04-28
Changed in python-aodhclient:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-aodhclient (master)

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

Changed in python-aodhclient:
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers