[abacus] Resource config and pricing config API

Jean-Sebastien Delfino

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.


-- Jean-Sebastien

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