openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #11537
Re: [Metering] API Extensibility (was: External API definition)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Loic Dachary <loic@xxxxxxxxxxxx> wrote:
>> Another item that we need to discuss is extensibility of this API.
>
>Hi,
>
>Here is a proposal, which we could discuss further during the meeting.
>
>GET extension=XXXX¶m1=foo¶m2=bar
>
>The API looks up /usr/share/ceilometer/extensions/XXXX.py and loads it.
>The XXXX module defines a query function that takes the following
>arguments:
>
>* QUERY_STRING (i.e. extension=XXXX¶m1=foo¶m2=bar )
>* a handler to the storage
>* a pointer to the configuration (assuming there is a
>/etc/ceilometer.ini file, for instance)
>
>The query function would return the result. For instance { 'in': 20001,
>'out': 489324 } if asked for aggregated network usage.
>
>Multiple extensions directories could be specified and searched,
>allowing a mixture of extensions provided in ceilometer and custom
>extensions to address specific needs or to mature an new extension.
>
>The primary benefit of defining extensions in this way is to avoid
>complex conventions for aggregations or other advanced operations. If
>the API was to impose a syntax or conventions to say "sum this field
>and this one and display the result ordered in this way and grouped by
>this field and this one", it would be redundant with the query language
>of the underlying data. For instance, if using mongodb, it would be
>difficult to expose all the features provided by
>http://www.mongodb.org/display/DOCS/Aggregation or
>http://www.mongodb.org/display/DOCS/MapReduce
I like this approach and the possibilities it provides. It will introduce some interesting questions for caching implementation, but we hound not worry about that yet, I think.
- --
Nick Barcet <nick.barcet@xxxxxxxxxxxxx>
aka: nicolas, nijaba
-----BEGIN PGP SIGNATURE-----
Version: APG v1.0.8
iGsEAREIACsFAk+r0LkkHE5pY29sYXMgQmFyY2V0IDxuaWNvbGFzQGJhcmNldC5j
b20+AAoJEFiD3l2iIpt4/zQAmQEqxPvRVlTpndcwNwhl0SeHq9i8AKCXMsGcPI0g
NNaIx8a+3rwi2Dlaeg==
=WkXC
-----END PGP SIGNATURE-----
References