Skip to content

Commit

Permalink
Merge pull request #448 from splunk/documentation-updates
Browse files Browse the repository at this point in the history
Documentation changes
  • Loading branch information
ashah-splunk committed Apr 20, 2022
2 parents fa7b2a8 + f49d37c commit 875a58d
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
Expand Up @@ -5,4 +5,4 @@ splunklib.results

.. autoclass:: Message

.. autoclass:: ResultsReader
.. autoclass:: JSONResultsReader
3 changes: 0 additions & 3 deletions splunklib/binding.py
Expand Up @@ -799,9 +799,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
Expand Up @@ -3018,7 +3018,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
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 875a58d

Please sign in to comment.