|
76 | 76 | "NotSupportedError", |
77 | 77 | "OperationError", |
78 | 78 | "IncomparableException", |
79 | | - "Service" |
| 79 | + "Service", |
| 80 | + "namespace" |
80 | 81 | ] |
81 | 82 |
|
82 | 83 | PATH_APPS = "apps/local/" |
@@ -2423,7 +2424,12 @@ def events(self, **kwargs): |
2423 | 2424 |
|
2424 | 2425 | :return: The ``InputStream`` IO handle to this job's events. |
2425 | 2426 | """ |
2426 | | - return self.get("events", **kwargs).body |
| 2427 | + if 'segmentation' not in kwargs: |
| 2428 | + segmentation = 'none' |
| 2429 | + else: |
| 2430 | + segmentation = kwargs.pop('segmentation') |
| 2431 | + return self.get("events", segmentation=segmentation, |
| 2432 | + **kwargs).body |
2427 | 2433 |
|
2428 | 2434 | def finalize(self): |
2429 | 2435 | """Stops the job and provides intermediate results for retrieval. |
@@ -2508,7 +2514,12 @@ def results(self, **query_params): |
2508 | 2514 |
|
2509 | 2515 | :return: The ``InputStream`` IO handle to this job's results. |
2510 | 2516 | """ |
2511 | | - return self.get("results", **query_params).body |
| 2517 | + if 'segmentation' not in query_params: |
| 2518 | + segmentation = 'none' |
| 2519 | + else: |
| 2520 | + segmentation = query_params.pop('segmentation') |
| 2521 | + return self.get("results", segmentation=segmentation, |
| 2522 | + **query_params).body |
2512 | 2523 |
|
2513 | 2524 | def preview(self, **query_params): |
2514 | 2525 | """Returns a streaming handle to this job's preview search results. |
@@ -2550,7 +2561,12 @@ def preview(self, **query_params): |
2550 | 2561 |
|
2551 | 2562 | :return: The ``InputStream`` IO handle to this job's preview results. |
2552 | 2563 | """ |
2553 | | - return self.get("results_preview", **query_params).body |
| 2564 | + if 'segmentation' not in query_params: |
| 2565 | + segmentation = 'none' |
| 2566 | + else: |
| 2567 | + segmentation = query_params.pop('segmentation') |
| 2568 | + return self.get("results_preview", segmentation=segmentation, |
| 2569 | + **query_params).body |
2554 | 2570 |
|
2555 | 2571 | def searchlog(self, **kwargs): |
2556 | 2572 | """Returns a streaming handle to this job's search log. |
@@ -2717,7 +2733,14 @@ def export(self, query, **params): |
2717 | 2733 | """ |
2718 | 2734 | if "exec_mode" in params: |
2719 | 2735 | raise TypeError("Cannot specify an exec_mode to export.") |
2720 | | - return self.post(path_segment="export", search=query, **params).body |
| 2736 | + if 'segmentation' not in params: |
| 2737 | + segmentation = 'none' |
| 2738 | + else: |
| 2739 | + segmentation = params.pop('segmentation') |
| 2740 | + return self.post(path_segment="export", |
| 2741 | + search=query, |
| 2742 | + segmentation=segmentation, |
| 2743 | + **params).body |
2721 | 2744 |
|
2722 | 2745 | def itemmeta(self): |
2723 | 2746 | """There is no metadata available for class:``Jobs``. |
@@ -2777,7 +2800,14 @@ def oneshot(self, query, **params): |
2777 | 2800 | """ |
2778 | 2801 | if "exec_mode" in params: |
2779 | 2802 | raise TypeError("Cannot specify an exec_mode to oneshot.") |
2780 | | - return self.post(search=query, exec_mode="oneshot", **params).body |
| 2803 | + if 'segmentation' not in params: |
| 2804 | + segmentation = 'none' |
| 2805 | + else: |
| 2806 | + segmentation = params.pop('segmentation') |
| 2807 | + return self.post(search=query, |
| 2808 | + exec_mode="oneshot", |
| 2809 | + segmentation=segmentation, |
| 2810 | + **params).body |
2781 | 2811 |
|
2782 | 2812 |
|
2783 | 2813 | class Loggers(Collection): |
|
0 commit comments