1
1
# Splunk SDK for Python Changelog
2
2
3
+ ## Version 1.6.5
4
+
5
+ ### Bug fixes
6
+
7
+ * Fixed XML responses to not throw errors for unicode characters.
8
+
3
9
## Version 1.6.4
4
10
5
11
### New features and APIs
@@ -181,7 +187,7 @@ The following bugs have been fixed:
181
187
182
188
### New features and APIs
183
189
184
- * Added support for Storage Passwords.
190
+ * Added support for Storage Passwords.
185
191
186
192
* Added a script (GenerateHelloCommand) to the searchcommand_app to generate a custom search command.
187
193
@@ -211,7 +217,7 @@ The following bugs have been fixed:
211
217
212
218
2 . Logs a traceback to SearchCommand.logger. This is old behavior.
213
219
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
215
221
io.BufferedReader to realize a significant performance gain.
216
222
217
223
* Example usage*
@@ -220,7 +226,7 @@ The following bugs have been fixed:
220
226
import io
221
227
...
222
228
response = job.results(count=maxRecords, offset=self._offset)
223
- resultsList = results.ResultsReader(io.BufferedReader(response))
229
+ resultsList = results.ResultsReader(io.BufferedReader(response))
224
230
```
225
231
226
232
### Bug fixes
@@ -231,7 +237,7 @@ The following bugs have been fixed:
231
237
data errors in result elements.
232
238
233
239
2 . When writing a ReportingCommand you no longer need to include a map method.
234
-
240
+
235
241
## Version 1.2.2
236
242
237
243
### Bug fixes
@@ -352,112 +358,112 @@ for any examples.
352
358
### New features and APIs
353
359
354
360
* 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
356
362
HTTP 401 (Unauthorized) will continue to work.
357
-
363
+
358
364
* 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
360
366
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
363
369
improve the verification of a job's completion status.
364
-
370
+
365
371
* Modular inputs have been added (requires Splunk 5.0+).
366
-
372
+
367
373
* 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
372
378
specified, the function returns immediately and you must check whether splunkd
373
379
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
377
383
specific namespace:
378
384
379
385
from splunklib.binding import namespace
380
386
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]
382
388
383
389
* The ` SavedSearch ` class has been extended by adding the following:
384
390
- Properties: ` alert_count ` , ` fired_alerts ` , ` scheduled_times ` , ` suppressed `
385
391
- 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
389
395
idiomatic style than using the existing ` Index.attach ` method.
390
-
396
+
391
397
* The ` Indexes.get_default ` method has been added for returnings the name of the
392
398
default index.
393
-
399
+
394
400
* The ` Service.search ` method has been added as a shortcut for creating a search
395
401
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
398
404
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 `
401
407
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
404
410
added.
405
-
411
+
406
412
407
413
### Breaking changes
408
414
409
415
* ` Job ` objects are no longer guaranteed to be ready for querying.
410
416
Client code should call the ` Job.is_ready ` method to determine when it is safe
411
417
to access properties on the job.
412
-
418
+
413
419
* The ` Jobs.create ` method can no longer be used to create a oneshot search
414
420
(with ` "exec_mode=oneshot" ` ). Use the ` Jobs.oneshot ` method instead.
415
-
421
+
416
422
* 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
418
424
` 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
420
426
` results.Message ` .
421
-
427
+
422
428
* 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
+
425
431
# correct usage
426
432
'search' in service.apps
427
-
433
+
428
434
# incorrect usage
429
435
service.apps.contains('search')
430
-
436
+
431
437
* The ` Collections.__getitem__ ` method throws ` AmbiguousReferenceException ` if
432
438
there are multiple entities that have the specified entity name in
433
439
the current namespace.
434
-
440
+
435
441
* 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
437
443
other operations on ` Inputs ` .
438
-
444
+
439
445
* The ` ConfFile ` class has been renamed to ` ConfigurationFile ` .
440
446
441
447
* The ` Confs ` class has been renamed to ` Configurations ` .
442
-
448
+
443
449
* Namespace handling has changed and any code that depends on namespace handling
444
450
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
447
453
longer has any effect.
448
-
454
+
449
455
* The ` Stanza.submit ` method now takes a ` dict ` instead of a raw string.
450
456
451
457
452
458
### Bug fixes and miscellaneous changes
453
459
454
460
* 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
457
463
with 'Splunk ' or not; the SDK handles either case correctly.
458
-
464
+
459
465
* Documentation has been improved and expanded.
460
-
466
+
461
467
* Many small bugs have been fixed.
462
468
463
469
@@ -481,30 +487,30 @@ for any examples.
481
487
- Added Service.saved_searches + units
482
488
- Added examples/saved_searches.py
483
489
* 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
485
491
listening on an IPv6 address.
486
492
487
493
### Breaking changes
488
494
489
495
#### Module name
490
496
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
495
501
installed on the Splunk server.
496
502
497
503
#### State caching
498
504
499
505
The 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
+
502
508
Previously, entity state values where retrieved with a call to ` Entity.read `
503
509
which would issue a round-trip to the server and return a dictionary of values
504
510
corresponding to the entity ` content ` field and, in a similar way, a call to
505
511
` Entity.readmeta ` would issue in a round-trip and return a dictionary
506
- contianing entity metadata values.
507
-
512
+ contianing entity metadata values.
513
+
508
514
With the change to enable state caching, the entity is instantiated with a
509
515
copy of its entire state record, which can be accessed using a variety of
510
516
properties:
@@ -527,14 +533,14 @@ The entity _callable_ returns the `content` field as before, but now returns
527
533
the value from the local state cache instead of issuing a round-trip as it
528
534
did before.
529
535
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
531
537
explicit 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
533
539
will not see the newly updated values, you will see the previously cached
534
540
values. The interface is designed to give the caller complete control of
535
541
when round-trips are issued and enable multiple updates to be made before
536
542
refreshing the entity.
537
-
543
+
538
544
The ` update ` and action methods are all designed to support a _ fluent_ style
539
545
of programming, so for example you can write:
540
546
@@ -543,7 +549,7 @@ of programming, so for example you can write:
543
549
And
544
550
545
551
entity.disable().refresh()
546
-
552
+
547
553
An important benefit and one of the primary motivations for this change is
548
554
that iterating a collection of entities now results in a single round-trip
549
555
to the server, because every entity collection member is initialized with
@@ -554,10 +560,10 @@ common scenarios.
554
560
555
561
#### Collections
556
562
557
- The ` Collection ` interface was changed so that ` Collection.list ` and the
563
+ The ` Collection ` interface was changed so that ` Collection.list ` and the
558
564
corresponding collection callable return a list of member ` Entity ` objects
559
565
instead 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
561
567
a list of apps and not a list of app names.
562
568
563
569
#### Naming context
@@ -566,7 +572,7 @@ Previously the binding context (`binding.Context`) and all tests & samples took
566
572
a single (optional) ` namespace ` argument that specified both the app and owner
567
573
names to use for the binding context. However, the underlying Splunk REST API
568
574
takes 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
570
576
context (and all samples & test) now take separate (and optional) ` app ` and
571
577
` owner ` arguments instead of the prior ` namespace ` argument.
572
578
0 commit comments