[devel at bb.net] Extending the Data API / REST API

Pierre Tardy tardyp at gmail.com
Wed May 3 19:07:17 UTC 2017


Hi Sveto,

Could you please explain what kind of specific data you want to put in
buildbot? Do you need the real time capabilities?

Data API is a middleware between REST and mq/DB apis, so in order to add
more Data API, you need to add db table, and db api to manage that. It is
not that simple.

There are much more simple way to create REST API. e.g:

http://couchdb.apache.org/
https://github.com/Kinto/kinto
http://python-eve.org/

If you really want to add REST endpoints to buildbot, you can create a web
plugin. This is something that is demonstrated in buildbot_travis:
https://github.com/buildbot/buildbot_travis/blob/master/buildbot_travis/api.py
You can see there the /config endpoint, which implement loading and saving
the buildbot travis config via the web UI.

Regards
Pierre

On Wed, May 3, 2017 at 8:24 PM Sveto Krchnavy <sveto70 at gmail.com> wrote:

> Hi.
>
> Thanks for the answer. The way you proposed is understood, but is not
> inline with buildbot needs, we need specific data to be available via a
> REST API.
>
> In reality, we don't need to extend api v2, we want to have there parallel
> API but data concept is good to be reused. What is proposed way to do the
> extension?
>
>
> Best regards.
>
> Sveto.
>
>
> On 03/05/2017 20:07, Dustin J. Mitchell wrote:
>
> The idea is, you should not develop a custom extension that you do not
> intend to upstream -- that's why there's no "pluggability" included.
> Instead, if you have a need to add functionality, you should write a patch
> to Buildbot and work to get it included in the framework itself.  So you
> can extend the list of submodules by editing the source :)
>
> Dustin
>
> 2017-05-03 8:25 GMT-04:00 Sveto Krchnavy <sveto70 at gmail.com>:
>
>> Hi.
>>
>> I wrote this request to users mailing list but probably devel is better
>> list.
>>
>>
>> I checked the section '3.2.2.4. Extending the Data API' in documentation
>> and there is written:
>>
>> "The data API may be extended in various ways: adding new endpoints, new
>> fields to resource types, new update methods, or entirely new resource
>> types. In any case, you should only extend the API if you plan to submit
>> the extensions to be merged into Buildbot itself. Private API extensions
>> are strongly discouraged."
>>
>> What is main reason to discourage extending data API?
>> What is preferred way to extend data API with new endpoints with
>> additional resources (extending REST API)?
>>
>> I checked the code and there is no support to extend the list of
>> submodules in DataConnector class.
>>
>> Thanks.
>>
>> _______________________________________________
>> devel mailing list
>> devel at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/devel
>>
>
>
> _______________________________________________
> devel mailing list
> devel at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/devel/attachments/20170503/46c0f9b1/attachment.html>


More information about the devel mailing list