[Openstack-docs] ceilometer CLI docs

Tim Bell Tim.Bell at cern.ch
Wed Jan 22 19:21:28 UTC 2014


I'm trying to find the ceilometer CLI docs which would explain the various options for the options on the statistics subcommand. The help on the CLI is not very verbose.

The key[op]value parameters for the -query do not seem to be documented anywhere I could find.

Reverse engineering shows that you can have -q project=<projecteid> and -q resource=<resourceid> along with lots of other start/stop etc. parameters.

Is there a place where this is documented ? If not, which guide should have this in ? I also think the code should report better than key[op]value, at minimum giving some of the keys and the format of the value.

OK to start raising bugs/patches/reviews but I want to check I've not missed something.

Tim
-------

$ ceilometer help statistics
usage: ceilometer statistics [-q <QUERY>] -m <NAME> [-p <PERIOD>]

List the statistics for this meter.

Optional arguments:
  -q <QUERY>, --query <QUERY>
                        key[op]value; list.
  -m <NAME>, --meter <NAME>
                        Name of meter to show samples for. Required.
  -p <PERIOD>, --period <PERIOD>
                        Period in seconds over which to group samples.

ceilometer --debug statistics -m cpu_util -q marvin=android
INFO (connectionpool:535) Starting new HTTPS connection (1): openstack.cern.ch
DEBUG (connectionpool:295) "POST /v2.0/tokens HTTP/1.1" 200 2546
DEBUG (iso8601:166) Parsed 2014-01-23T19:19:18Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'19', 'tz_hour': None, 'month': u'01', 'timezone': u'Z', 'second': u'18', 'tz_minute': None, 'year': u'2014', 'separator': u'T', 'day': u'23', 'minute': u'19'} with default timezone <iso8601.iso8601.Utc object at 0x1a3b750>
DEBUG (iso8601:124) Got u'2014' for 'year' with default None
DEBUG (iso8601:124) Got u'01' for 'month' with default None
DEBUG (iso8601:124) Got u'23' for 'day' with default None
DEBUG (iso8601:124) Got u'19' for 'hour' with default None
DEBUG (iso8601:124) Got u'19' for 'minute' with default None
DEBUG (iso8601:124) Got u'18' for 'second' with default None
DEBUG (http:111) curl -i -X GET -H 'X-Auth-Token: 990c37d74d2244f79b95104682766bdf' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'User-Agent: python-ceilometerclient' http://openstack.cern.ch:8777/v2/meters/cpu_util/statistics?q.field=marvin&q.op=eq&q.value=android
DEBUG (http:121)
HTTP/1.0 400 Bad Request
date: Wed, 22 Jan 2014 19:19:18 GMT
content-length: 318
content-type: application/json
connection: keep-alive
server: WSGIServer/0.1 Python/2.6.6

{"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "Unknown argument: \"marvin\": unrecognized field in query: [<Query u'marvin' eq u'android' Unset>], valid keys: set(['end', 'start', 'metaquery', 'meter', 'project', 'source', 'user', 'start_timestamp_op', 'resource', 'end_timestamp_op'])"}}

WARNING (http:172) Request returned failure status.
HTTPBadRequest (HTTP 400)

>From this, the eventual syntax needed seems to be

ceilometer statistics -m cpu_util -q resource=0e171bd4-d006-4411-b152-a45161190e47

Tim
--
[cid:image001.png at 01CF17AD.C0BD5B90]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20140122/f24f082b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 12650 bytes
Desc: image001.png
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20140122/f24f082b/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tim Bell.vcf
Type: text/x-vcard
Size: 4902 bytes
Desc: Tim Bell.vcf
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20140122/f24f082b/attachment-0001.vcf>


More information about the Openstack-docs mailing list