Re: [abacus] Resource config and pricing config API


Jean-Sebastien Delfino
 

Thanks for reviewing. +1 to organize in separate sections with a diagram,
that will definitely help.

- Jean-Sebastien

On Thu, Oct 8, 2015 at 4:23 PM, Michael Maximilien <mmaximilien(a)gmail.com>
wrote:

I've been trying to use it and while good and complete, it could be better
and clearer.

I opened: https://github.com/cloudfoundry-incubator/cf-abacus/issues/76

With some suggestions.

Best,

max



On Wed, Oct 7, 2015 at 10:33 AM, Jean-Sebastien Delfino <
jsdelfino(a)gmail.com> wrote:

Hi all,

Until recently the Abacus resource configuration and pricing data used
for metering and rating were defined in Javascript scripts under
lib/config/resource and lib/config/price (we had a few sample and test
configs included there). While convenient for initial testing and demo,
this was just temporary (and very limited) and we needed a proper API to
allow integrators to control externally what resource configs and prices
should be used.

That API is now in place and it's pretty simple (details in the API doc
in doc/api.md and the code as well), but I wanted to post a brief
overview here for the folks that may be in the process of integrating
Abacus in their platform:

- you are implementing the API, we call you (at an endpoint you configure
in an env variable) to retrieve the resource and pricing config you want us
to use;

- we call GET /v1/provisioning/resources/:resource_id/config/:time to get
the config you want us to use for resource :resource_id, effective at a
given time :time (as these can evolve over time);

- we call GET /v1/pricing/resources/:resource_id/config/:time to get the
pricing you want us to use for resource :resource_id effective at a given
time :time;

- we cache the configs you return in a LRU cache and round the effective
times to 10min to avoid bombarding you a million times when processing a
million usage docs;

- we will use the resource and pricing config you've returned for
metering and rating usage submitted to Abacus.

Hope that'll help if you're starting with that API. Please post here for
any questions or discussions of changes you'd like to see, any ideas you
have to improve this etc.

HTH

-- Jean-Sebastien


--
max
http://maximilien.org
http://blog.maximilien.com

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.