The ceilometerclient Python API

Usage

First create a client instance with your credentials:

>>> import ceilometerclient.client
>>> cclient = ceilometerclient.client.get_client(VERSION, username=USERNAME, password=PASSWORD, tenant_name=PROJECT_NAME, auth_url=AUTH_URL)

Here VERSION can be: 1 and 2.

Then call methods on its managers:

>>> cclient.meters.list()
[<Meter ...>, ...]

>>> cclient.samples.list()
[<Sample ...>, ...]

V2 client tips

Use queries to narrow your search (more info at Ceilometer V2 API reference):

>>> query = [dict(field='resource_id', op='eq', value='5a301761-f78b-46e2-8900-8b4f6fe6675a')]
>>> ceilometer.samples.list(meter_name='cpu_util', limit=10, q=query)
[<Sample ...>, ...]

Table Of Contents

Previous topic

The ceilometer shell utility

Next topic

Client Reference

This Page