Lokesh S
Lokesh S

Reputation: 426

Ceilometer api to use and its result parmeters

I was trying to fetch the resource and usage of resources of an instance using ceilometer api. I have used v2/meters/instance , v2/meters/cpu_util and v2/meters/memory. The result these api's return is too large and I'm not able to identify the paramater that needs to be taken to find the resource usage. I need to find the cpu utilization, bandwidth and memory usage of an instance using the ceilometer api. Can anyone please tell me which api I need to use to get the cpu utilization, bandwidth and memory usage of an instance and the parameter that needs to be taken to get the usage.

Thanks for any help in advance. Regards , Lokesh.S

Upvotes: 0

Views: 1812

Answers (2)

ZhiQiang Fan
ZhiQiang Fan

Reputation: 1048

ceilometer --debug sample-list -m cpu_util -l 1 -q resource={your_vm_id}

Note that

--debug enables you to observe what rest API has been requested, you can learn example from it and write your own rest request, or just use CLI if you can. And this option will show rest response with full detailed sample information, CLI will format it and some information may be dropped.

-l 1 means just limit to return one result, so you will not flushed by huge mount of data

-q resource={your_vm_id} means only get cpu_util sample for that vm

you can read this official document of http://docs.openstack.org/developer/ceilometer/webapi/v2.html, or read my post http://zqfan.github.io/assets/doc/ceilometer-havana-api-v2.html (which is written in Chinese)

Upvotes: 1

user3455018
user3455018

Reputation: 11

If you use the CLI, you can limit the number of samples with the -l/--limit parameter like in the example below:

`ceilometer sample-list -m cpu_util -l 10`

Upvotes: 1

Related Questions