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