Skip to content

Commit b218dc0

Browse files
author
David Noble
committed
Documentation update to address Matt's build issues
1 parent ae26899 commit b218dc0

File tree

8 files changed

+165
-85
lines changed

8 files changed

+165
-85
lines changed

docs/index.rst

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ For more information, see the `Splunk Developer Portal <http://dev.splunk.com/vi
2424

2525
**Custom HTTP handler**
2626

27-
:class:`~splunklib.binding.HTTPError` class
27+
:class:`~splunklib.binding.HTTPError` class
2828

2929
:class:`~splunklib.binding.HttpLib` class
3030

@@ -34,9 +34,9 @@ For more information, see the `Splunk Developer Portal <http://dev.splunk.com/vi
3434

3535
:func:`~splunklib.client.connect` function
3636

37-
:class:`~splunklib.client.Service` class
37+
:class:`~splunklib.client.Service` class
3838

39-
:class:`~splunklib.client.Endpoint` base class
39+
:class:`~splunklib.client.Endpoint` base class
4040

4141

4242
**Entities and collections**
@@ -88,7 +88,7 @@ For more information, see the `Splunk Developer Portal <http://dev.splunk.com/vi
8888
:class:`~splunklib.client.User` class
8989

9090
:class:`~splunklib.client.Users` class
91-
91+
9292

9393
**Exceptions**
9494

@@ -114,28 +114,39 @@ For more information, see the `Splunk Developer Portal <http://dev.splunk.com/vi
114114

115115
:func:`~splunklib.data.record` function
116116

117-
:class:`~splunklib.data.Record` class
117+
:class:`~splunklib.data.Record` class
118118

119119
:doc:`results`
120120
--------------
121121

122-
:class:`~splunklib.results.ResultsReader` class
122+
:class:`~splunklib.results.ResultsReader` class
123123

124-
:class:`~splunklib.results.Message` class
124+
:class:`~splunklib.results.Message` class
125125

126126
:doc:`modularinput`
127-
--------------
127+
-------------------
128+
129+
:class:`~splunklib.modularinput.Argument` class
130+
131+
:class:`~splunklib.modularinput.Event` class
132+
133+
:class:`~splunklib.modularinput.EventWriter` class
134+
135+
:class:`~splunklib.modularinput.InputDefinition` class
136+
137+
:class:`~splunklib.modularinput.Scheme` class
138+
139+
:class:`~splunklib.modularinput.Script` class
140+
141+
:class:`~splunklib.modularinput.ValidationDefinition` class
128142

129-
:class:`~splunklib.modularinput.Argument` class
143+
:doc:`searchcommands`
144+
---------------------
130145

131-
:class:`~splunklib.modularinput.Event` class
146+
:class:`~splunklib.searchcommands.GeneratingCommand` class
132147

133-
:class:`~splunklib.modularinput.EventWriter` class
148+
:class:`~splunklib.searchcommands.ReportingCommand` class
134149

135-
:class:`~splunklib.modularinput.InputDefinition` class
150+
:class:`~splunklib.searchcommands.StreamingCommand` class
136151

137-
:class:`~splunklib.modularinput.Scheme` class
138-
139-
:class:`~splunklib.modularinput.Script` class
140-
141-
:class:`~splunklib.modularinput.ValidationDefinition` class
152+
:class:`~splunklib.searchcommands.Option` class

docs/modularinput.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
splunklib.modularinput
2-
--------------
2+
----------------------
33

44
.. automodule:: splunklib.modularinput
55

docs/searchcommands.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
splunklib.searchcommands
2+
------------------------
3+
4+
.. automodule:: splunklib.searchcommands
5+
6+
.. autofunction:: dispatch
7+
8+
.. automodule:: splunklib.searchcommands.generating_command
9+
10+
.. autoclass:: GeneratingCommand
11+
:members:
12+
:inherited-members:
13+
14+
.. automodule:: splunklib.searchcommands.reporting_command
15+
16+
.. autoclass:: ReportingCommand
17+
:members:
18+
:inherited-members:
19+
20+
.. automodule:: splunklib.searchcommands.streaming_command
21+
22+
.. autoclass:: StreamingCommand
23+
:members:
24+
:inherited-members:
25+
26+
.. automodule:: splunklib.searchcommands.decorators
27+
28+
.. autoclass:: Option
29+
:members:
30+
:inherited-members:
31+
32+
.. automodule:: splunklib.searchcommands.validators
33+
34+
.. autoclass:: splunklib.searchcommands.validators.Boolean
35+
:members:
36+
:inherited-members:
37+
38+
.. autoclass:: splunklib.searchcommands.validators.Duration
39+
:members:
40+
:inherited-members:
41+
42+
.. autoclass:: splunklib.searchcommands.validators.Fieldname
43+
:members:
44+
:inherited-members:
45+
46+
.. autoclass:: splunklib.searchcommands.validators.File
47+
:members:
48+
:inherited-members:
49+
50+
.. autoclass:: splunklib.searchcommands.validators.Integer
51+
:members:
52+
:inherited-members:
53+
54+
.. autoclass:: splunklib.searchcommands.validators.RegularExpression
55+
:members:
56+
:inherited-members:
57+
58+
.. autoclass:: splunklib.searchcommands.validators.Set
59+
:members:
60+
:inherited-members:
61+
62+
.. autoclass:: splunklib.searchcommands.validators.Validator
63+
:members:
64+
:inherited-members:

splunklib/modularinput/validation_definition.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
from utils import parse_xml_data
2222

2323
class ValidationDefinition(object):
24-
"""This class represents the XML sent by Splunk for external validation of a new modular input.
24+
"""This class represents the XML sent by Splunk for external validation of a
25+
new modular input.
2526
2627
**Example**::
2728
28-
v = ValidationDefinition()
29+
``v = ValidationDefinition()``
30+
2931
"""
3032
def __init__(self):
3133
self.metadata = {}
@@ -40,25 +42,26 @@ def __eq__(self, other):
4042
def parse(stream):
4143
"""Creates a ``ValidationDefinition`` from a provided stream containing XML.
4244
43-
The XML typically will look like
44-
45-
<items>
46-
<server_host>myHost</server_host>
47-
<server_uri>https://127.0.0.1:8089</server_uri>
48-
<session_key>123102983109283019283</session_key>
49-
<checkpoint_dir>/opt/splunk/var/lib/splunk/modinputs</checkpoint_dir>
50-
<item name="myScheme">
51-
<param name="param1">value1</param>
52-
<param_list name="param2">
53-
<value>value2</value>
54-
<value>value3</value>
55-
<value>value4</value>
56-
</param_list>
57-
</item>
58-
</items>
45+
The XML typically will look like this:
46+
47+
``<items>``
48+
`` <server_host>myHost</server_host>``
49+
`` <server_uri>https://127.0.0.1:8089</server_uri>``
50+
`` <session_key>123102983109283019283</session_key>``
51+
`` <checkpoint_dir>/opt/splunk/var/lib/splunk/modinputs</checkpoint_dir>``
52+
`` <item name="myScheme">``
53+
`` <param name="param1">value1</param>``
54+
`` <param_list name="param2">``
55+
`` <value>value2</value>``
56+
`` <value>value3</value>``
57+
`` <value>value4</value>``
58+
`` </param_list>``
59+
`` </item>``
60+
``</items>``
5961
6062
:param stream: ``Stream`` containing XML to parse.
6163
:return definition: A ``ValidationDefinition`` object.
64+
6265
"""
6366

6467
definition = ValidationDefinition()

splunklib/searchcommands/decorators.py

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ class Option(property):
7878
Short form (recommended). When you are satisfied with built-in or custom
7979
validation behaviors.
8080
81-
```
82-
total = splunklib.Option(
83-
doc=''' **Syntax:** **total=***<fieldname>*
84-
**Description:** Name of the field that will hold the computed
85-
sum''',
86-
require=True, validate=splunklib.Fieldname())
87-
```
81+
``total = splunklib.Option(``
82+
`` doc=''' **Syntax:** **total=***<fieldname>*``
83+
`` **Description:** Name of the field that will hold the computed``
84+
`` sum''',``
85+
`` require=True, validate=splunklib.Fieldname())``
8886
8987
**Example:**
9088
@@ -94,27 +92,26 @@ class Option(property):
9492
[destruction][1]. You must be prepared to accept a value of None which
9593
represents the unset state.
9694
97-
```
98-
@Option
99-
def logging_configuration(self):
100-
\""" **Syntax:** logging_configuration=<path>
101-
**Description:** Loads an alternative logging configuration file for
102-
a command invocation. The logging configuration file must be in
103-
Python ConfigParser-format. The *<path>* name and all path names
104-
specified in configuration are relative to the app root directory.
105-
106-
\"""
107-
return self._logging_configuration
108-
109-
@logging_configuration.setter
110-
def logging_configuration(self, value):
111-
if value is not None
112-
logging.configure(value)
113-
self._logging_configuration = value
114-
115-
def __init__(self)
116-
self._logging_configuration = None
117-
```
95+
``@Option``
96+
``def logging_configuration(self):``
97+
`` \""" **Syntax:** logging_configuration=<path>``
98+
`` **Description:** Loads an alternative logging configuration file for``
99+
`` a command invocation. The logging configuration file must be in``
100+
`` Python ConfigParser-format. The *<path>* name and all path names``
101+
`` specified in configuration are relative to the app root directory.``
102+
`` ``
103+
`` \"""``
104+
`` return self._logging_configuration``
105+
106+
``@logging_configuration.setter``
107+
``def logging_configuration(self, value):``
108+
`` if value is not None``
109+
`` logging.configure(value)``
110+
`` self._logging_configuration = value``
111+
`` ``
112+
``def __init__(self)``
113+
`` self._logging_configuration = None``
114+
`` ``
118115
119116
[1]: http://docs.python.org/reference/datamodel.html#object.__del__ "Python data model: Objects, values and types"
120117

splunklib/searchcommands/search_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def stderr_dest(self):
385385
Specify one of these string values:
386386
387387
Value | Meaning
388-
----------|---------------------------------------------------------
388+
----------+---------------------------------------------------------
389389
`log` | Write messages to the job's search.log file
390390
`message` | Write each line of each message as a search info message
391391
`none` | Discard all messages logged to stderr

splunklib/searchcommands/streaming_command.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,16 @@ class StreamingCommand(SearchCommand):
3535
You can tell Splunk to run your streaming command locally on a search head,
3636
never remotely on indexers:
3737
38-
```
39-
@Configuration(local=False)
40-
class CountMatchesCommand(StreamingCommand):
41-
...
42-
```
38+
``@Configuration(local=False)``
39+
``class CountMatchesCommand(StreamingCommand):``
40+
`` ...``
4341
4442
If your streaming command modifies the time order of event records you must
4543
tell Splunk to ensure correct behavior:
4644
47-
```
48-
@Configuration(overrides_timeorder=True)
49-
class CountMatchesCommand(StreamingCommand):
50-
...
51-
```
45+
``@Configuration(overrides_timeorder=True)``
46+
``class CountMatchesCommand(StreamingCommand):``
47+
`` ...``
5248
5349
"""
5450
#region Methods
@@ -84,7 +80,8 @@ def _execute(self, operation, reader, writer):
8480
#endregion
8581

8682
class ConfigurationSettings(SearchCommand.ConfigurationSettings):
87-
""" TODO: Documentation
83+
""" Represents the configuration settings that apply to a
84+
StreamingCommand
8885
8986
"""
9087
#region Properties

0 commit comments

Comments
 (0)