Re: [abacus] Adding metering resource


Piotr Przybylski <piotrp@...>
 

Hi Sebastien,
thanks, that worked well for several resources though the planned API will
make it simpler and more dynamic.

Piotr





From: Jean-Sebastien Delfino <jsdelfino(a)gmail.com>
To: "Discussions about Cloud Foundry projects and the system
overall." <cf-dev(a)lists.cloudfoundry.org>
Date: 09/30/2015 01:20 PM
Subject: [cf-dev] Re: [abacus] Adding metering resource



Hey Piotr,

We're currently registering our sample resource configs in
lib/config/resource/src/index.js [1]. To register yours you can just add
one line like this:

'<your resource_id>': require('<your resource config script>'),

... to that script [1] along with the other sample configs.

Your config doesn't need to be in the resources dir, anywhere on the
node.js require() path should work.

This rudimentary registration mechanism is temporary until we add a
resource config management API to allow service and runtime providers to
register their resource configs externally without having to fiddle with
the Abacus scripts. I believe the plan is to have that API very soon, and
that work is tracked under user story #101019374 [2].

[1]
https://github.com/cloudfoundry-incubator/cf-abacus/blob/master/lib/config/resource/src/index.js#L17
[2] https://www.pivotaltracker.com/story/show/101019374

HTH

-- Jean-Sebastien

On Wed, Sep 30, 2015 at 11:56 AM, Piotr Przybylski <piotrp(a)us.ibm.com>
wrote:
Hi,
I would like to add a new resource, similar to linux-container. What is a
correct way to register that resource ? The resource files are located in
cf-abacus/lib/config/resource/src/resources,
however adding resource file there does not add new resource_id to
resource enumerations (e.g. in
cf-abacus/lib/config/resource/src/index.js).

Thank you

Piotr

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