Update help message for 'alarm-gnocchi-resources-threshold-create' command

Bug #1506549 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-ceilometerclient
Triaged
Medium
Rohit Jaiswal

Bug Description

Help message for '--aggregation-method' in alarm-gnocchi-resources-threshold-create command is not precise.
Right now it shows:
...
  --aggregation-method <AGGREATION>
                                Aggregation method to use, one of: ['max', 'min', 'avg', 'sum', 'count'].
...

The problem is that 'avg' is not a valid aggregation method in gnocchi. So when creating alarm with 'avg' aggregation-method leads to error:
...excerpt from debug output...
DEBUG (client) REQ BODY: {"alarm_actions": ["log://"], "user_id": "", "description": "My Test Alarm with Gnocchi backend", "enabled": true, "name": "Cacti1Day-Alarm", "gnocchi_resources_threshold_rule"[872/1861]
tion_periods": 1, "metric": "MyCacti1Day", "resource_id": "2f98e37d-dc5e-5dec-aec2-47e272cb93e7", "aggregation_method": "avg", "granularity": 60, "threshold": 3.0, "comparison_operator": "ge", "resource_type": "
generic"}, "insufficient_data_actions": ["log://"], "repeat_actions": false, "ok_actions": ["log://"], "project_id": "", "type": "gnocchi_resources_threshold", "severity": "low"}

INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.18
DEBUG (connectionpool) "POST /v2/alarms HTTP/1.1" 400 1201
DEBUG (client) RESP: [400] {'date': 'Thu, 15 Oct 2015 13:22:02 GMT', 'content-length': '1201', 'content-type': 'application/json', 'x-openstack-request-id': 'req-15c161da-4f9b-4d7e-bc21-002b45568e78', 'server':
'Werkzeug/0.9.1 Python/2.7.5'}

DEBUG (client) RESP BODY: {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "aggregation_method should be in [u'31pct', u'67pct', u'81pct', u'13pct', u'25pct', u'40pct', u'50pct', u'6pc
t', u'11pct', u'22pct', u'1pct', u'42pct', u'76pct', u'70pct', u'84pct', u'94pct', u'20pct', u'32pct', u'60pct', u'34pct', u'66pct', u'95pct', u'33pct', u'73pct', u'85pct', u'21pct', u'82pct', u'12pct', u'std',
u'72pct', u'47pct', u'10pct', u'23pct', u'35pct', u'43pct', u'17pct', u'37pct', u'88pct', u'61pct', u'63pct', u'79pct', u'87pct', u'15pct', u'count', u'99pct', u'last', u'86pct', u'median', u'64pct', u'69pct', u
'78pct', u'58pct', u'56pct', u'3pct', u'19pct', u'5pct', u'38pct', u'moving-average', u'mean', u'57pct', u'59pct', u'65pct', u'39pct', u'16pct', u'36pct', u'89pct', u'93pct', u'48pct', u'28pct', u'75pct', u'98pc
t', u'18pct', u'52pct', u'7pct', u'9pct', u'min', u'55pct', u'90pct', u'96pct', u'45pct', u'68pct', u'14pct', u'44pct', u'2pct', u'4pct', u'92pct', u'26pct', u'max', u'49pct', u'53pct', u'29pct', u'74pct', u'80p
ct', u'24pct', u'51pct', u'62pct', u'97pct', u'54pct', u'77pct', u'41pct', u'71pct', u'46pct', u'83pct', u'8pct', u'30pct', u'91pct', u'first', u'sum', u'27pct'] not avg"}}

DEBUG (client) Request returned failure status: 400
Traceback (most recent call last):
  File "/usr/bin/ceilometer", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 293, in main
    CeilometerShell().main(args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 242, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 495, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 522, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 581, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 641, in do_alarm_gnocchi_resources_threshold_create
    alarm = cc.alarms.create(**fields)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/alarms.py", line 161, in create
    return self._create(self._path(), new)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/common/base.py", line 63, in _create
    body = self.api.post(url, json=body).json()
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 358, in post
    return self.client_request("POST", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 345, in client_request
    self, method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 261, in client_request
    method, self.concat_url(endpoint, url), **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 201, in request
    raise exceptions.from_response(resp, method, url)
ceilometerclient.openstack.common.apiclient.exceptions.BadRequest: aggregation_method should be in [u'31pct', u'67pct', u'81pct', u'13pct', u'25pct', u'40pct', u'50pct', u'6pct', u'11pct', u'22pct', u'1pct', u'4
2pct', u'76pct', u'70pct', u'84pct', u'94pct', u'20pct', u'32pct', u'60pct', u'34pct', u'66pct', u'95pct', u'33pct', u'73pct', u'85pct', u'21pct', u'82pct', u'12pct', u'std', u'72pct', u'47pct', u'10pct', u'23pc
t', u'35pct', u'43pct', u'17pct', u'37pct', u'88pct', u'61pct', u'63pct', u'79pct', u'87pct', u'15pct', u'count', u'99pct', u'last', u'86pct', u'median', u'64pct', u'69pct', u'78pct', u'58pct', u'56pct', u'3pct'
, u'19pct', u'5pct', u'38pct', u'moving-average', u'mean', u'57pct', u'59pct', u'65pct', u'39pct', u'16pct', u'36pct', u'89pct', u'93pct', u'48pct', u'28pct', u'75pct', u'98pct', u'18pct', u'52pct', u'7pct', u'9
pct', u'min', u'55pct', u'90pct', u'96pct', u'45pct', u'68pct', u'14pct', u'44pct', u'2pct', u'4pct', u'92pct', u'26pct', u'max', u'49pct', u'53pct', u'29pct', u'74pct', u'80pct', u'24pct', u'51pct', u'62pct', u
'97pct', u'54pct', u'77pct', u'41pct', u'71pct', u'46pct', u'83pct', u'8pct', u'30pct', u'91pct', u'first', u'sum', u'27pct'] not avg (HTTP 400) (Request-ID: req-15c161da-4f9b-4d7e-bc21-002b45568e78)
...

Packages:
openstack-ceilometer-compute-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-alarm-5.0.0.0-rc1.el7.centos.noarch
python-ceilometerclient-1.5.1-dev1.el7.centos.noarch
openstack-ceilometer-polling-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-central-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-common-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-notification-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-api-5.0.0.0-rc1.el7.centos.noarch
python-ceilometer-5.0.0.0-rc1.el7.centos.noarch
openstack-ceilometer-collector-5.0.0.0-rc1.el7.centos.noarch

Regards,
Yurii

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
Changed in ceilometer:
assignee: nobody → Rohit Jaiswal (rohit-jaiswal-3)
gordon chung (chungg)
affects: ceilometer → python-ceilometerclient
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.