Skip to content

Commit 906c581

Browse files
author
Sam Stelle
committed
Release 1.3.0
2 parents 96a4c2e + 87927ca commit 906c581

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+817
-169
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ examples/*/local
1717
examples/*/metadata
1818
tests/searchcommands_data/log/
1919
tests/searchcommands_data/output/
20+
examples/searchcommands_app/searchcommand_app.log
21+
Test Results*.html

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Splunk SDK for Python Changelog
22

33

4+
## Version 1.3.0
5+
6+
### New features and APIs
7+
8+
* Added support for Storage Passwords.
9+
10+
* Added a script (GenerateHelloCommand) to the searchcommand_app to generate a custom search command.
11+
12+
* Added a human readable title parameter to `modularinput.argument`.
13+
14+
* Renamed the searchcommand `csv` module to `splunk_csv`.
15+
16+
### Bug fixes
17+
18+
* Now entities that contain slashes in their name can be created, accessed and deleted correctly.
19+
20+
* Fixed a perfomance issue with connecting to Splunk on Windows.
21+
22+
* Improved the `service.restart()` function.
23+
424
## Version 1.2.3
525

626
### New features and APIs

Commands.conf.spec.xlsx

1.03 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The Splunk Software Development Kit for Python
22

3-
#### Version 1.2.3
3+
#### Version 1.3.0
44

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

docs/client.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ splunklib.client
110110
:inherited-members:
111111

112112
.. autoclass:: Service
113-
:members: apps, confs, capabilities, event_types, fired_alerts, indexes, info, inputs, jobs, loggers, messages, modular_input_kinds, parse, restart, restart_required, roles, search, saved_searches, settings, splunk_version, users
113+
:members: apps, confs, capabilities, event_types, fired_alerts, indexes, info, inputs, jobs, loggers, messages, modular_input_kinds, parse, restart, restart_required, roles, search, saved_searches, settings, splunk_version, storage_passwords, users
114114
:inherited-members:
115115

116116
.. autoclass:: Settings
@@ -121,6 +121,14 @@ splunklib.client
121121
:members: submit
122122
:inherited-members:
123123

124+
.. autoclass:: StoragePassword
125+
:members: clear_password, encrypted_password, realm, username
126+
:inherited-members:
127+
128+
.. autoclass:: StoragePasswords
129+
:members: create, delete
130+
:inherited-members:
131+
124132
.. autoclass:: User
125133
:members: role_entities
126134
:inherited-members:

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ For more information, see the `Splunk Developer Portal <http://dev.splunk.com/vi
8585

8686
:class:`~splunklib.client.Settings` class
8787

88+
:class:`~splunklib.client.StoragePassword` class
89+
90+
:class:`~splunklib.client.StoragePasswords` class
91+
8892
:class:`~splunklib.client.User` class
8993

9094
:class:`~splunklib.client.Users` class

examples/github_forks/github_forks.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
from splunklib.modularinput import *
2020

21-
try:
22-
import xml.etree.cElementTree as ET
23-
except ImportError:
24-
import xml.etree.ElementTree as ET
25-
2621
class MyScript(Script):
2722
"""All modular inputs should inherit from the abstract base class Script
2823
from splunklib.modularinput.script.

examples/random_numbers/random_numbers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
from splunklib.modularinput import *
2020

21-
try:
22-
import xml.etree.cElementTree as ET
23-
except ImportError:
24-
import xml.etree.ElementTree as ET
25-
2621
class MyScript(Script):
2722
"""All modular inputs should inherit from the abstract base class Script
2823
from splunklib.modularinput.script.

examples/searchcommands_app/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
splunk-sdk-python search_commands_app example
1+
splunk-sdk-python searchcommands_app example
22
=============================================
33

4-
This app provides three examples of custom search commands; one of each of the
5-
base types:
4+
This app provides several examples of custom search commands which illustrate each of the base types:
65

76
Command | Type | Description
87
:------------ |:-----------|:----------------------------------------------------
8+
generatehello| Generating | Generates a specified number of 'Hello World' events
99
simulate | Generating | Generates a sequence of events drawn from a csv file using repeated random sampling with replacement
1010
sum | Reporting | Adds all the numbers in a set of fields.
1111
countmatches | Streaming | Counts the number of non-overlapping matches to a regular expression in a set of fields.
@@ -18,7 +18,8 @@ The app is tested on Splunk 5 and 6. Here is its manifest:
1818
│ │ └── searchcommands ....... splunklib.searchcommands module
1919
│ ├── simulate.py .............. SimulateCommand implementation
2020
│ ├── sum.py ................... SumCommand implementation
21-
│   └── countmatches.py .......... CountMatchesCommand implementation
21+
│   ├── countmatches.py .......... CountMatchesCommand implementation
22+
│   └── generatehello.py ........... HelloWorldCommand implementation
2223
├── default
2324
│ ├── data
2425
│ │   └── ui
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright 2011-2014 Splunk, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"): you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
import sys, time
18+
from splunklib.searchcommands import \
19+
dispatch, GeneratingCommand, Configuration, Option, validators
20+
21+
@Configuration()
22+
class GenerateHelloCommand(GeneratingCommand):
23+
count = Option(require=True, validate=validators.Integer())
24+
25+
def generate(self):
26+
for i in range(1, self.count + 1):
27+
text = 'Hello World %d' % i
28+
yield {'_time': time.time(), 'event_no': i, '_raw': text }
29+
30+
dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__)

0 commit comments

Comments
 (0)