Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.39 KB

http_status.rst

File metadata and controls

58 lines (41 loc) · 2.39 KB
.. bb:reporter:: HttpStatusPush

HttpStatusPush

.. py:currentmodule:: buildbot.reporters

from buildbot.plugins import reporters
sp = reporters.HttpStatusPush(serverUrl="http://example.com/submit")
c['services'].append(sp)

:class:`HttpStatusPush` sends HTTP POST requests to serverUrl. The body of request contains json-encoded data of the build as returned by the data API. It is useful to create a status front end outside of Buildbot for better scalability.

It requires either txrequests or treq to be installed to allow interaction with http server.

Note

The json data object sent is completely different from the one that was generated by 0.8.x buildbot. It is indeed generated using data api.

.. py:class:: HttpStatusPush(serverUrl, auth=None, headers=None, generators=None, debug=None, verify=None)

    :param string serverUrl: the url where to do the HTTP POST request
    :param auth: the authentication method to use.
        Refer to the documentation of the requests library for more information.
    :param dict headers: pass custom headers to HTTP request.
    :type generators: list of IReportGenerator instances
    :param generators: A list of report generators that will be used to generate reports to be sent by this reporter.
        Currently the reporter will consider only the report generated by the first generator.
    :param boolean debug: logs every requests and their response
    :param boolean verify: disable ssl verification for the case you use temporary self signed certificates
    :param boolean skipEncoding: disables encoding of json data to bytes before pushing to server

Json object spec

The default json object sent is a build object augmented with some more data as follow.

{
    "url": "http://yourbot/path/to/build",
    "<build data api values>": "[...]",
    "buildset": "<buildset data api values>",
    "builder": "<builder data api values>",
    "buildrequest": "<buildrequest data api values>"
}

If you want another format, don't hesitate to use the format_fn parameter to customize the payload. The build parameter given to that function is of type :bb:rtype:`build`, optionally enhanced with properties, steps, and logs information.