Skip to content

Commit d68a895

Browse files
author
Fred Ross
committed
Merge pull request #68 from splunk/fross/misc
Fixed two bugs.
2 parents 8a5a2ef + 1a4fa9b commit d68a895

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

splunklib/client.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"NotSupportedError",
7777
"OperationError",
7878
"IncomparableException",
79-
"Service"
79+
"Service",
80+
"namespace"
8081
]
8182

8283
PATH_APPS = "apps/local/"
@@ -2423,6 +2424,7 @@ def events(self, **kwargs):
24232424
24242425
:return: The ``InputStream`` IO handle to this job's events.
24252426
"""
2427+
kwargs['segmentation'] = kwargs.get('segmentation', 'none')
24262428
return self.get("events", **kwargs).body
24272429

24282430
def finalize(self):
@@ -2508,6 +2510,7 @@ def results(self, **query_params):
25082510
25092511
:return: The ``InputStream`` IO handle to this job's results.
25102512
"""
2513+
query_params['segmentation'] = query_params.get('segmentation', 'none')
25112514
return self.get("results", **query_params).body
25122515

25132516
def preview(self, **query_params):
@@ -2550,6 +2553,7 @@ def preview(self, **query_params):
25502553
25512554
:return: The ``InputStream`` IO handle to this job's preview results.
25522555
"""
2556+
query_params['segmentation'] = query_params.get('segmentation', 'none')
25532557
return self.get("results_preview", **query_params).body
25542558

25552559
def searchlog(self, **kwargs):
@@ -2717,7 +2721,10 @@ def export(self, query, **params):
27172721
"""
27182722
if "exec_mode" in params:
27192723
raise TypeError("Cannot specify an exec_mode to export.")
2720-
return self.post(path_segment="export", search=query, **params).body
2724+
params['segmentation'] = params.get('segmentation', 'none')
2725+
return self.post(path_segment="export",
2726+
search=query,
2727+
**params).body
27212728

27222729
def itemmeta(self):
27232730
"""There is no metadata available for class:``Jobs``.
@@ -2777,7 +2784,10 @@ def oneshot(self, query, **params):
27772784
"""
27782785
if "exec_mode" in params:
27792786
raise TypeError("Cannot specify an exec_mode to oneshot.")
2780-
return self.post(search=query, exec_mode="oneshot", **params).body
2787+
params['segmentation'] = params.get('segmentation', 'none')
2788+
return self.post(search=query,
2789+
exec_mode="oneshot",
2790+
**params).body
27812791

27822792

27832793
class Loggers(Collection):

0 commit comments

Comments
 (0)