Ask Your Question
3

with one query want to get meter samples OR statistics from ceilometer for more than one resource_id

asked 2013-07-24 14:23:48 -0500

arvinder.anand@ericsson.com gravatar image

updated 2015-11-08 14:46:47 -0500

Moe gravatar image

with one query want to get meter samples OR statistics from ceilometer for more than one resource_id OR operand is not documented for ceilometer to support RESTFul queries for more than one resource_id.

Example, user want to query last sample for CPU meter for more than resource IDs.

Please guide, as how this can be achieved ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-11-14 07:01:12 -0500

ZhiQiang Fan gravatar image

updated 2015-11-14 07:05:27 -0500

1) query last sample for cpu meter for more than one resource id?

there is no way to do it, you can only get one single last sample, which means group by resource ids then get the last sample for each of them cannot achieve via ceilometer api. You need to filter out the returned list manually/

I'm not sure if Gnocchi can do this

2) query statistics cannot use OR operand for multiple resource ids, which means you can only do statistic for single resource id, or for all resource ids

3) query samples for multiple resource ids by OR operand is supported by complex query (actually only OR is supported, because a sample cannot associate with two different resource ids)

for example, you want to get samples for resource ids: res1 or res2,

CLI: ceilometer query-samples --filter '{"or":[{"=":{"resource":"res1"}},{"=":{"resource":"res2"}}]}' --limit 100

$ ceilometer help query-samples usage: ceilometer query-samples [-f <filter>] [-o <orderby>] [-l <limit>]

Query samples.

Optional arguments: -f <filter>, --filter <filter> {complex_op: [{simple_op: {field_name: value}}]} The complex_op is one of: ['and', 'or'], simple_op is one of: ['=', '!=', '<', '<=', '>', '>=']. -o <orderby>, --orderby <orderby> [{field_name: direction}, {field_name: direction}] The direction is one of: ['asc', 'desc']. -l <limit>, --limit <limit> Maximum number of samples to return.

documents for developers: http://docs.openstack.org/developer/c...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-07-24 14:23:48 -0500

Seen: 1,019 times

Last updated: Nov 14 '15