Skip to content

Commit 0a4ac01

Browse files
authored
Merge pull request splunk#212 from splunk/master
Master -> Develop for 1.6.5
2 parents 6d01201 + f9f8844 commit 0a4ac01

File tree

5 files changed

+77
-71
lines changed

5 files changed

+77
-71
lines changed

CHANGELOG.md

Lines changed: 73 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
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

233239
2. 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
495501
installed on the Splunk server.
496502

497503
#### State caching
498504

499505
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+
502508
Previously, entity state values where retrieved with a call to `Entity.read`
503509
which would issue a round-trip to the server and return a dictionary of values
504510
corresponding 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+
508514
With the change to enable state caching, the entity is instantiated with a
509515
copy of its entire state record, which can be accessed using a variety of
510516
properties:
@@ -527,14 +533,14 @@ The entity _callable_ returns the `content` field as before, but now returns
527533
the value from the local state cache instead of issuing a round-trip as it
528534
did 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
531537
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
533539
will not see the newly updated values, you will see the previously cached
534540
values. The interface is designed to give the caller complete control of
535541
when round-trips are issued and enable multiple updates to be made before
536542
refreshing the entity.
537-
543+
538544
The `update` and action methods are all designed to support a _fluent_ style
539545
of programming, so for example you can write:
540546

@@ -543,7 +549,7 @@ of programming, so for example you can write:
543549
And
544550

545551
entity.disable().refresh()
546-
552+
547553
An important benefit and one of the primary motivations for this change is
548554
that iterating a collection of entities now results in a single round-trip
549555
to 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
558564
corresponding collection callable return a list of member `Entity` objects
559565
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
561567
a 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
566572
a single (optional) `namespace` argument that specified both the app and owner
567573
names to use for the binding context. However, the underlying Splunk REST API
568574
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
570576
context (and all samples & test) now take separate (and optional) `app` and
571577
`owner` arguments instead of the prior `namespace` argument.
572578

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.org/splunk/splunk-sdk-python.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-python)
22
# The Splunk Software Development Kit for Python
33

4-
#### Version 1.6.4
4+
#### Version 1.6.5
55

66
The Splunk Software Development Kit (SDK) for Python contains library code and
77
examples designed to enable developers to build applications using Splunk.

examples/searchcommands_app/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def run(self):
439439
setup(
440440
description='Custom Search Command examples',
441441
name=os.path.basename(project_dir),
442-
version='1.6.4',
442+
version='1.6.5',
443443
author='Splunk, Inc.',
444444
author_email='devinfo@splunk.com',
445445
url='http://github.com/splunk/splunk-sdk-python',

splunklib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
from __future__ import absolute_import
1818
from splunklib.six.moves import map
19-
__version_info__ = (1, 6, 4)
19+
__version_info__ = (1, 6, 5)
2020
__version__ = ".".join(map(str, __version_info__))

splunklib/binding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ def request(url, message, **kwargs):
13521352
head = {
13531353
"Content-Length": str(len(body)),
13541354
"Host": host,
1355-
"User-Agent": "splunk-sdk-python/1.6.3",
1355+
"User-Agent": "splunk-sdk-python/1.6.5",
13561356
"Accept": "*/*",
13571357
"Connection": "Close",
13581358
} # defaults

0 commit comments

Comments
 (0)