Skip to content

Commit

Permalink
Documentation changes
Browse files Browse the repository at this point in the history
updated the comments and changes for JSONResultsReader class to be added in the generated docs
  • Loading branch information
ashah-splunk committed Apr 19, 2022
1 parent f28dd7b commit f49d37c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ splunklib.results

.. autoclass:: Message

.. autoclass:: ResultsReader
.. autoclass:: JSONResultsReader
3 changes: 0 additions & 3 deletions splunklib/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,6 @@ def request(self, path_segment, method="GET", headers=None, body={},
:type app: ``string``
:param sharing: The sharing mode of the namespace (optional).
:type sharing: ``string``
:param query: All other keyword arguments, which are used as query
parameters.
:type query: ``string``
:return: The response from the server.
:rtype: ``dict`` with keys ``body``, ``headers``, ``reason``,
and ``status``
Expand Down
2 changes: 1 addition & 1 deletion splunklib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@ def itemmeta(self):
def oneshot(self, query, **params):
"""Run a oneshot search and returns a streaming handle to the results.
The ``InputStream`` object streams XML fragments from the server. To parse this stream into usable Python
The ``InputStream`` object streams fragments from the server. To parse this stream into usable Python
objects, pass the handle to :class:`splunklib.results.JSONResultsReader` along with the query param
"output_mode='json'" ::
Expand Down
12 changes: 8 additions & 4 deletions splunklib/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
accessing search results while avoiding buffering the result set, which can be
very large.
To use the reader, instantiate :class:`ResultsReader` on a search result stream
To use the reader, instantiate :class:`JSONResultsReader` on a search result stream
as follows:::
reader = ResultsReader(result_stream)
Expand Down Expand Up @@ -55,7 +55,8 @@

__all__ = [
"ResultsReader",
"Message"
"Message",
"JSONResultsReader"
]


Expand Down Expand Up @@ -308,11 +309,14 @@ class JSONResultsReader(object):
:class:`Message` object for Splunk messages. This class has one field,
``is_preview``, which is ``True`` when the results are a preview from a
running search, or ``False`` when the results are from a completed search.
This function has no network activity other than what is implicit in the
stream it operates on.
:param `stream`: The stream to read from (any object that supports
``.read()``).
:param `stream`: The stream to read from (any object that supports``.read()``).
**Example**::
import results
response = ... # the body of an HTTP response
reader = results.JSONResultsReader(response)
Expand Down

0 comments on commit f49d37c

Please sign in to comment.