11# Splunk SDK for Python Changelog
22
3+ ## Version 1.6.5
4+
5+ ### Bug fixes
6+
7+ * Fixed XML responses to not throw errors for unicode characters.
8+
39## Version 1.6.4
410
511### New features and APIs
@@ -181,7 +187,7 @@ The following bugs have been fixed:
181187
182188### New features and APIs
183189
184- * Added support for Storage Passwords.
190+ * Added support for Storage Passwords.
185191
186192* Added a script (GenerateHelloCommand) to the searchcommand_app to generate a custom search command.
187193
@@ -211,7 +217,7 @@ The following bugs have been fixed:
211217
212218 2 . Logs a traceback to SearchCommand.logger. This is old behavior.
213219
214- * Made ResponseReader more streamlike, so that it can be wrapped in an
220+ * Made ResponseReader more streamlike, so that it can be wrapped in an
215221 io.BufferedReader to realize a significant performance gain.
216222
217223 * Example usage*
@@ -220,7 +226,7 @@ The following bugs have been fixed:
220226 import io
221227 ...
222228 response = job.results(count=maxRecords, offset=self._offset)
223- resultsList = results.ResultsReader(io.BufferedReader(response))
229+ resultsList = results.ResultsReader(io.BufferedReader(response))
224230 ```
225231
226232### Bug fixes
@@ -231,7 +237,7 @@ The following bugs have been fixed:
231237 data errors in result elements.
232238
2332392 . When writing a ReportingCommand you no longer need to include a map method.
234-
240+
235241## Version 1.2.2
236242
237243### Bug fixes
@@ -352,112 +358,112 @@ for any examples.
352358### New features and APIs
353359
354360* An ` AuthenticationError ` exception has been added.
355- This exception is a subclass of ` HTTPError ` , so existing code that expects
361+ This exception is a subclass of ` HTTPError ` , so existing code that expects
356362 HTTP 401 (Unauthorized) will continue to work.
357-
363+
358364* An ` "autologin" ` argument has been added to the ` splunklib.client.connect ` and
359- ` splunklib.binding.connect ` functions. When set to true, Splunk automatically
365+ ` splunklib.binding.connect ` functions. When set to true, Splunk automatically
360366 tries to log in again if the session terminates.
361-
362- * The ` is_ready ` and ` is_done ` methods have been added to the ` Job ` class to
367+
368+ * The ` is_ready ` and ` is_done ` methods have been added to the ` Job ` class to
363369 improve the verification of a job's completion status.
364-
370+
365371* Modular inputs have been added (requires Splunk 5.0+).
366-
372+
367373* The ` Jobs.export ` method has been added, enabling you to run export searches.
368-
369- * The ` Service.restart ` method now takes a ` "timeout" ` argument. If a timeout
370- period is specified, the function blocks until splunkd has restarted or the
371- timeout period has passed. Otherwise, if a timeout period has not been
374+
375+ * The ` Service.restart ` method now takes a ` "timeout" ` argument. If a timeout
376+ period is specified, the function blocks until splunkd has restarted or the
377+ timeout period has passed. Otherwise, if a timeout period has not been
372378 specified, the function returns immediately and you must check whether splunkd
373379 has restarted yourself.
374-
375- * The ` Collections.__getitem__ ` method can fetch items from collections with an
376- explicit namespace. This example shows how to retrieve a saved search for a
380+
381+ * The ` Collections.__getitem__ ` method can fetch items from collections with an
382+ explicit namespace. This example shows how to retrieve a saved search for a
377383 specific namespace:
378384
379385 from splunklib.binding import namespace
380386 ns = client.namespace(owner='nobody', app='search')
381- result = service.saved_searches['Top five sourcetypes', ns]
387+ result = service.saved_searches['Top five sourcetypes', ns]
382388
383389* The ` SavedSearch ` class has been extended by adding the following:
384390 - Properties: ` alert_count ` , ` fired_alerts ` , ` scheduled_times ` , ` suppressed `
385391 - Methods: ` suppress ` , ` unsuppress `
386-
387- * The ` Index.attached_socket ` method has been added. This method can be used
388- inside a ` with ` block to submit multiple events to an index, which is a more
392+
393+ * The ` Index.attached_socket ` method has been added. This method can be used
394+ inside a ` with ` block to submit multiple events to an index, which is a more
389395 idiomatic style than using the existing ` Index.attach ` method.
390-
396+
391397* The ` Indexes.get_default ` method has been added for returnings the name of the
392398 default index.
393-
399+
394400* The ` Service.search ` method has been added as a shortcut for creating a search
395401 job.
396-
397- * The ` User.role_entities ` convenience method has been added for returning a
402+
403+ * The ` User.role_entities ` convenience method has been added for returning a
398404 list of role entities of a user.
399-
400- * The ` Role ` class has been added, including the ` grant ` and ` revoke `
405+
406+ * The ` Role ` class has been added, including the ` grant ` and ` revoke `
401407 convenience methods for adding and removing capabilities from a role.
402-
403- * The ` Application.package ` and ` Application.updateInfo ` methods have been
408+
409+ * The ` Application.package ` and ` Application.updateInfo ` methods have been
404410 added.
405-
411+
406412
407413### Breaking changes
408414
409415* ` Job ` objects are no longer guaranteed to be ready for querying.
410416 Client code should call the ` Job.is_ready ` method to determine when it is safe
411417 to access properties on the job.
412-
418+
413419* The ` Jobs.create ` method can no longer be used to create a oneshot search
414420 (with ` "exec_mode=oneshot" ` ). Use the ` Jobs.oneshot ` method instead.
415-
421+
416422* The ` ResultsReader ` interface has changed completely, including:
417- - The ` read ` method has been removed and you must iterate over the
423+ - The ` read ` method has been removed and you must iterate over the
418424 ` ResultsReader ` object directly.
419- - Results from the iteration are either ` dict ` s or instances of
425+ - Results from the iteration are either ` dict ` s or instances of
420426 ` results.Message ` .
421-
427+
422428* All ` contains ` methods on collections have been removed.
423- Use Python's ` in ` operator instead. For example:
424-
429+ Use Python's ` in ` operator instead. For example:
430+
425431 # correct usage
426432 'search' in service.apps
427-
433+
428434 # incorrect usage
429435 service.apps.contains('search')
430-
436+
431437* The ` Collections.__getitem__ ` method throws ` AmbiguousReferenceException ` if
432438 there are multiple entities that have the specified entity name in
433439 the current namespace.
434-
440+
435441* The order of arguments in the ` Inputs.create ` method has changed. The ` name `
436- argument is now first, to be consistent with all other collections and all
442+ argument is now first, to be consistent with all other collections and all
437443 other operations on ` Inputs ` .
438-
444+
439445* The ` ConfFile ` class has been renamed to ` ConfigurationFile ` .
440446
441447* The ` Confs ` class has been renamed to ` Configurations ` .
442-
448+
443449* Namespace handling has changed and any code that depends on namespace handling
444450 in detail may break.
445-
446- * Calling the ` Job.cancel ` method on a job that has already been cancelled no
451+
452+ * Calling the ` Job.cancel ` method on a job that has already been cancelled no
447453 longer has any effect.
448-
454+
449455* The ` Stanza.submit ` method now takes a ` dict ` instead of a raw string.
450456
451457
452458### Bug fixes and miscellaneous changes
453459
454460* Collection listings are optionally paginated.
455-
456- * Connecting with a pre-existing session token works whether the token begins
461+
462+ * Connecting with a pre-existing session token works whether the token begins
457463 with 'Splunk ' or not; the SDK handles either case correctly.
458-
464+
459465* Documentation has been improved and expanded.
460-
466+
461467* Many small bugs have been fixed.
462468
463469
@@ -481,30 +487,30 @@ for any examples.
481487 - Added Service.saved_searches + units
482488 - Added examples/saved_searches.py
483489* Sphinx based SDK docs and improved source code docstrings.
484- * Support for IPv6 - it is now possible to connect to a Splunk instance
490+ * Support for IPv6 - it is now possible to connect to a Splunk instance
485491 listening on an IPv6 address.
486492
487493### Breaking changes
488494
489495#### Module name
490496
491- The core module was renamed from ` splunk ` to ` splunklib ` . The Splunk product
492- ships with an internal Python module named ` splunk ` and the name conflict
493- with the SDK prevented installing the SDK into Splunk Python sandbox for use
494- by Splunk extensions. This module name change enables the Python SDK to be
497+ The core module was renamed from ` splunk ` to ` splunklib ` . The Splunk product
498+ ships with an internal Python module named ` splunk ` and the name conflict
499+ with the SDK prevented installing the SDK into Splunk Python sandbox for use
500+ by Splunk extensions. This module name change enables the Python SDK to be
495501installed on the Splunk server.
496502
497503#### State caching
498504
499505The client module was modified to enable Entity state caching which required
500- changes to the ` Entity ` interface and changes to the typical usage pattern.
501-
506+ changes to the ` Entity ` interface and changes to the typical usage pattern.
507+
502508Previously, entity state values where retrieved with a call to ` Entity.read `
503509which would issue a round-trip to the server and return a dictionary of values
504510corresponding to the entity ` content ` field and, in a similar way, a call to
505511` Entity.readmeta ` would issue in a round-trip and return a dictionary
506- contianing entity metadata values.
507-
512+ contianing entity metadata values.
513+
508514With the change to enable state caching, the entity is instantiated with a
509515copy of its entire state record, which can be accessed using a variety of
510516properties:
@@ -527,14 +533,14 @@ The entity _callable_ returns the `content` field as before, but now returns
527533the value from the local state cache instead of issuing a round-trip as it
528534did before.
529535
530- It is important to note that refreshing the local state cache is always
536+ It is important to note that refreshing the local state cache is always
531537explicit and always requires a call to ` Entity.refresh ` . So, for example
532- if you call ` Entity.update ` and then attempt to retrieve local values, you
538+ if you call ` Entity.update ` and then attempt to retrieve local values, you
533539will not see the newly updated values, you will see the previously cached
534540values. The interface is designed to give the caller complete control of
535541when round-trips are issued and enable multiple updates to be made before
536542refreshing the entity.
537-
543+
538544The ` update ` and action methods are all designed to support a _ fluent_ style
539545of programming, so for example you can write:
540546
@@ -543,7 +549,7 @@ of programming, so for example you can write:
543549And
544550
545551 entity.disable().refresh()
546-
552+
547553An important benefit and one of the primary motivations for this change is
548554that iterating a collection of entities now results in a single round-trip
549555to the server, because every entity collection member is initialized with
@@ -554,10 +560,10 @@ common scenarios.
554560
555561#### Collections
556562
557- The ` Collection ` interface was changed so that ` Collection.list ` and the
563+ The ` Collection ` interface was changed so that ` Collection.list ` and the
558564corresponding collection callable return a list of member ` Entity ` objects
559565instead of a list of member entity names. This change was a result of user
560- feedback indicating that people expected to see eg: ` service.apps() ` return
566+ feedback indicating that people expected to see eg: ` service.apps() ` return
561567a list of apps and not a list of app names.
562568
563569#### Naming context
@@ -566,7 +572,7 @@ Previously the binding context (`binding.Context`) and all tests & samples took
566572a single (optional) ` namespace ` argument that specified both the app and owner
567573names to use for the binding context. However, the underlying Splunk REST API
568574takes these as separate ` app ` and ` owner ` arguments and it turned out to be more
569- convenient to reflect these arguments directly in the SDK, so the binding
575+ convenient to reflect these arguments directly in the SDK, so the binding
570576context (and all samples & test) now take separate (and optional) ` app ` and
571577` owner ` arguments instead of the prior ` namespace ` argument.
572578
0 commit comments