Skip to content

Commit

Permalink
add some example in data api documentation for getting smaller set of…
Browse files Browse the repository at this point in the history
… logs
  • Loading branch information
tardyp committed Aug 23, 2016
1 parent f0348ea commit 930a458
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions master/buildbot/spec/types/logchunk.raml
Expand Up @@ -23,6 +23,18 @@ description: |
These are specified as query parameters via the REST interface, or as arguments to the :py:meth:`~buildbot.data.connector.DataConnector.get` method in Python.
The result will begin with line ``offset`` (so the resulting ``firstline`` will be equal to the given ``offset``), and will contain up to ``limit`` lines.
Following example will get the first 100 lines of a log::
from buildbot.data import resultspec
first_100_lines = yield self.master.data.get(("logs", log['logid'], "contents"),
resultSpec=resultspec.ResultSpec(limit=100))
Following example will get the last 100 lines of a log::
from buildbot.data import resultspec
last_100_lines = yield self.master.data.get(("logs", log['logid'], "contents"),
resultSpec=resultspec.ResultSpec(offset=log['num_lines']-100))
.. note::
There is no event for a new chunk. Instead, the log resource is updated when new chunks are added, with the new number of lines.
Expand Down

0 comments on commit 930a458

Please sign in to comment.