|
4 | 4 |
|
5 | 5 | ### New features and APIs |
6 | 6 |
|
7 | | -* Added a distinct `AuthenticationError` and optional autologin/autorelogin. |
8 | | -* Added `is_ready` and `is_done` methods to `Job`. |
9 | | - - Job objects are no longer guaranteed to be ready, so `is_ready` should be |
10 | | - checked if your code assumes this. |
11 | | -* Collection listings are optionally paginated. |
12 | | -* Added modular inputs (for Splunk 5.0+). |
13 | | -* Added `Jobs.export()` method. |
14 | | -* Service.restart now takes a timeout argument. If it is specified, the function blocks until |
15 | | - splunkd has restarted or the timeout has passed; if it is not specified, then it returns |
16 | | - immediately and you have to check whether splunkd has restarted yourself. |
17 | | -* `Collections.__getitem__` can fetch items from collections |
18 | | - with an explicit namespace. For example, in addition to |
19 | | - `result = service.saved_searches['Top five sourcetypes']`, you can write: |
20 | | - |
21 | | -``` |
22 | | -from splunklib.binding import namespace |
23 | | -ns = client.namespace(owner='nobody', app='search') |
24 | | -result = service.saved_searches['Top five sourcetypes', ns] |
25 | | -``` |
26 | | - |
27 | | -* Extended `SavedSearch`: |
28 | | - - New properties: `alert_count`, `fired_alerts`, `scheduled_times`, `suppressed` |
29 | | - - New operations: `suppress`, `unsuppress` |
30 | | -* Added `Index.attached_socket()` which can be used inside a with-block to |
31 | | - submit multiple events to an index. This is a more idiomatic style than |
32 | | - using the preexisting `Index.attach()` method. |
33 | | -* Added `Indexes.get_default()` which returns the name of the default index that data will be submitted into. |
34 | | -* Connecting with a preexisting session token works whether the token begins with 'Splunk ' or not; |
35 | | - the SDK will handle either case correctly. |
36 | | -* Added `Service.search()` method as a shortcut for creating a search job. |
37 | | -* Added `User.role_entities` as a convenience to return a list of the actual |
38 | | - entity objects for the roles of a user. `User.roles` still returns a list |
39 | | - of the role names. |
40 | | -* Added `Role.grant` and `revoke` as convenience methods to add and remove |
| 7 | +* An `AuthenticationError` exception has been added. |
| 8 | + |
| 9 | +* An `"autologin"` argument has been added to the `splunklib.client.connect` and `splunklib.binding.connect` functions. |
| 10 | + When set to true, Splunk automatically tries to log in again if the session terminates. |
| 11 | + |
| 12 | +* The `is_ready` and `is_done` methods have been added to the `Job` class to improve the verification of a job's completion status. |
| 13 | + |
| 14 | +* Modular inputs have been added (requires Splunk 5.0+). |
| 15 | + |
| 16 | +* The `Jobs.export` method has been added, enabling you to run export searches. |
| 17 | + |
| 18 | +* The `Service.restart` method now takes a `"timeout"` argument. If a timeout period is specified, the function blocks |
| 19 | + until splunkd has restarted or the timeout period has passed. Otherwise, if a timeout period has not been specified, |
| 20 | + the function returns immediately and you must check whether splunkd has restarted yourself. |
| 21 | + |
| 22 | +* The `Collections.__getitem__` method can fetch items from collections with an explicit namespace. This example shows |
| 23 | + how to retrieve a saved search for a specific namespace: |
| 24 | + |
| 25 | + from splunklib.binding import namespace |
| 26 | + ns = client.namespace(owner='nobody', app='search') |
| 27 | + result = service.saved_searches['Top five sourcetypes', ns] |
| 28 | + |
| 29 | +* The `SavedSearch` class has been extended by adding the following: |
| 30 | + - Properties: `alert_count`, `fired_alerts`, `scheduled_times`, `suppressed` |
| 31 | + - Methods: `suppress`, `unsuppress` |
| 32 | + |
| 33 | +* The `Index.attached_socket` method has been added. This method can be used inside a `with` block to |
| 34 | + submit multiple events to an index, which is a more idiomatic style than using the existing `Index.attach` method. |
| 35 | + |
| 36 | +* The `Indexes.get_default` method has been added for returnings the name of the default index. |
| 37 | + |
| 38 | +* The `Service.search` method has been added as a shortcut for creating a search job. |
| 39 | + |
| 40 | +* The `User.role_entities` convenience method has been added for returning a list of role entities of a user. |
| 41 | + |
| 42 | +* The `Role` class has been added, including the `grant` and `revoke` convenience methods for adding and removing |
41 | 43 | capabilities from a role. |
42 | | -* Added `Application.package()` and `updateInfo()` methods. |
43 | | -* Lots of docstrings expanded. |
44 | | -* Lots of small bugs fixed. |
| 44 | + |
| 45 | +* The `Application.package` and `Application.updateInfo` methods have been added. |
| 46 | + |
45 | 47 |
|
46 | 48 | ### Breaking changes |
47 | 49 |
|
48 | 50 | * Authentication errors are now reported as `AuthenticationError` instead of as |
49 | | - an `HTTPError` with code 401. |
| 51 | + `HTTPError` with code 401. |
| 52 | + |
50 | 53 | * `Job` objects are no longer guaranteed to be ready for querying. |
51 | | - Client code should call `Job.is_ready()` to determine when it is safe to |
| 54 | + Client code should call the `Job.is_ready` method to determine when it is safe to |
52 | 55 | access properties on the job. |
53 | | -* `Jobs.create()` can no longer be used to create a oneshot search |
54 | | - (with `exec_mode=oneshot`). Use the `Jobs.oneshot()` method instead. |
55 | | -* The `ResultsReader` interface has changed completely. |
56 | | - - The `read` method has been removed. |
57 | | - Instead iterate over the `ResultsReader` object directly. |
58 | | - - Results from the iteration are either `dict`s or `results.Message` |
59 | | - instances. |
| 56 | + |
| 57 | +* The `Jobs.create` method can no longer be used to create a oneshot search |
| 58 | + (with `"exec_mode=oneshot"`). Use the `Jobs.oneshot` method instead. |
| 59 | + |
| 60 | +* The `ResultsReader` interface has changed completely, including: |
| 61 | + - The `read` method has been removed and you must iterate over the `ResultsReader` object directly. |
| 62 | + - Results from the iteration are either `dict`s or instances of `results.Message`. |
| 63 | + |
60 | 64 | * All `contains` methods on collections have been removed. |
61 | | - Use Python's `in` operator instead. For example, instead of |
62 | | - `service.apps.contains('search')`, use `'search' in service.apps`. |
63 | | -* `Collections.__getitem__` will throw an `AmbiguousReferenceException` if |
| 65 | + Use Python's `in` operator instead. For example: |
| 66 | + |
| 67 | + # correct usage |
| 68 | + 'search' in service.apps |
| 69 | + |
| 70 | + # incorrect usage |
| 71 | + service.apps.contains('search') |
| 72 | + |
| 73 | +* The `Collections.__getitem__` method throws `AmbiguousReferenceException` if |
64 | 74 | there are multiple entities that have the specified entity name in |
65 | 75 | the current namespace. |
66 | | -* The argument order of `Inputs.create` has changed to have the `name` |
67 | | - argument first. This is consistent with all other collections and all other |
| 76 | + |
| 77 | +* The order of arguments in the `Inputs.create` method has changed. The `name` |
| 78 | + argument is now first, to be consistent with all other collections and all other |
68 | 79 | operations on `Inputs`. |
69 | | -* `ConfFile` has been renamed to `ConfigurationFile`. |
70 | | - `Confs` has been renamed to `Configurations`. |
71 | | -* Namespace handling has changed subtly. |
72 | | - Code that depends on namespace handling in detail may break. |
73 | | -* Calling `Job.cancel()` on a job that has already been cancelled no longer |
| 80 | + |
| 81 | +* The `ConfFile` class has been renamed to `ConfigurationFile`. |
| 82 | + |
| 83 | +* The `Confs` class has been renamed to `Configurations`. |
| 84 | + |
| 85 | +* Namespace handling has changed and any code that depends on namespace handling in detail may break. |
| 86 | + |
| 87 | +* Calling the `Job.cancel` method on a job that has already been cancelled no longer |
74 | 88 | has any effect. |
75 | | -* `Stanza.submit` now takes a dict instead of a raw string. |
| 89 | + |
| 90 | +* The `Stanza.submit` method now takes a `dict` instead of a raw string. |
| 91 | + |
| 92 | + |
| 93 | +### Bug fixes and miscellaneous changes |
| 94 | + |
| 95 | +* Collection listings are optionally paginated. |
| 96 | + |
| 97 | +* Connecting with a pre-existing session token works whether the token begins with 'Splunk ' or not; |
| 98 | + the SDK handles either case correctly. |
| 99 | + |
| 100 | +* Documentation has been improved and expanded. |
| 101 | + |
| 102 | +* Many small bugs have been fixed. |
76 | 103 |
|
77 | 104 |
|
78 | 105 | ## 0.8.0 (beta) |
|
0 commit comments