Skip to content

Commit 703e49a

Browse files
authored
Merge pull request #450 from splunk/DVPL-10990
Removed examples and it's references from the SDK
2 parents c282acc + 8816b60 commit 703e49a

File tree

157 files changed

+11
-36774
lines changed

Some content is hidden

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

157 files changed

+11
-36774
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ proxy.log
1515
MANIFEST
1616
coverage_report
1717
test.log
18-
examples/*/local
19-
examples/**/local.meta
20-
examples/**/*.log
2118
tests/searchcommands_data/log/
2219
tests/searchcommands_data/output/
23-
examples/searchcommands_app/searchcommand_app.log
2420
Test Results*.html
2521
tests/searchcommands/data/app/app.log
2622
splunk_sdk.egg-info/
2723
dist/
28-
examples/searchcommands_app/package/lib/splunklib
2924
tests/searchcommands/apps/app_with_logging_configuration/*.log
3025
*.observed
3126
venv/

README.md

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#### Version 1.6.19
77

8-
The Splunk Enterprise Software Development Kit (SDK) for Python contains library code and examples designed to enable developers to build applications using the Splunk platform.
8+
The Splunk Enterprise Software Development Kit (SDK) for Python contains library code designed to enable developers to build applications using the Splunk platform.
99

1010
The Splunk platform is a search engine and analytic environment that uses a distributed map-reduce architecture to efficiently index, search, and process large time-varying data sets.
1111

@@ -18,7 +18,7 @@ The Splunk developer platform enables developers to take advantage of the same t
1818

1919
## Get started with the Splunk Enterprise SDK for Python
2020

21-
The Splunk Enterprise SDK for Python contains library code and examples that show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
21+
The Splunk Enterprise SDK for Python contains library code, and it's examples are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository, that show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
2222

2323
### Requirements
2424

@@ -39,7 +39,7 @@ Here's what you need to get going with the Splunk Enterprise SDK for Python.
3939

4040
### Install the SDK
4141

42-
Use the following commands to install the Splunk Enterprise SDK for Python libraries. However, it's not necessary to install the libraries to run the examples and unit tests from the SDK.
42+
Use the following commands to install the Splunk Enterprise SDK for Python libraries. However, it's not necessary to install the libraries to run the unit tests from the SDK.
4343

4444
Use `pip`:
4545

@@ -68,8 +68,6 @@ To run the examples and unit tests, you must put the root of the SDK on your PYT
6868

6969
export PYTHONPATH=~/splunk-sdk-python
7070

71-
The SDK command-line examples require a common set of arguments that specify the host, port, and login credentials for Splunk Enterprise. For a full list of command-line arguments, include `--help` as an argument to any of the examples.
72-
7371
### Following are the different ways to connect to Splunk Enterprise
7472
#### Using username/password
7573
```python
@@ -115,29 +113,9 @@ here is an example of .env file:
115113
# Session key for authentication
116114
#sessionKey=<Session-Key>
117115

118-
#### Run the examples
119-
120-
Examples are located in the **/splunk-sdk-python/examples** directory. To run the examples at the command line, use the Python interpreter and include any arguments that are required by the example. In the commands below, replace "examplename" with the name of the specific example in the directory that you want to run:
121-
122-
Using username and Password
123-
124-
python examplename.py --username="admin" --password="changeme"
125-
126-
Using Bearer token
127-
128-
python examplename.py --bearerToken=<value>
129-
130-
Using Session key
131-
132-
python examplename.py --sessionKey="<value>"
116+
#### SDK examples
133117

134-
If you saved your login credentials in the **.env** file, you can omit those arguments:
135-
136-
python examplename.py
137-
138-
To get help for an example, use the `--help` argument with an example:
139-
140-
python examplename.py --help
118+
Examples for the Splunk Enterprise SDK for Python are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository. For details, see the [Examples using the Splunk Enterprise SDK for Python](https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/examplespython) on the Splunk Developer Portal.
141119

142120
#### Run the unit tests
143121

@@ -162,10 +140,9 @@ The test suite uses Python's standard library, the built-in `unittest` library,
162140
| Directory | Description |
163141
|:--------- |:---------------------------------------------------------- |
164142
|/docs | Source for Sphinx-based docs and build |
165-
|/examples | Examples demonstrating various SDK features |
166143
|/splunklib | Source for the Splunk library modules |
167144
|/tests | Source for unit tests |
168-
|/utils | Source for utilities shared by the examples and unit tests |
145+
|/utils | Source for utilities shared by the unit tests |
169146

170147
### Customization
171148
* When working with custom search commands such as Custom Streaming Commands or Custom Generating Commands, We may need to add new fields to the records based on certain conditions.
@@ -216,7 +193,7 @@ class GeneratorTest(GeneratingCommand):
216193

217194
### Access metadata of modular inputs app
218195
* In stream_events() method we can access modular input app metadata from InputDefinition object
219-
* See [GitHub Commit](https://github.com/splunk/splunk-sdk-python/blob/develop/examples/github_commits/bin/github_commits.py) Modular input App example for reference.
196+
* See [GitHub Commit](https://github.com/splunk/splunk-app-examples/blob/master/modularinputs/python/github_commits/bin/github_commits.py) Modular input App example for reference.
220197
```python
221198
def stream_events(self, inputs, ew):
222199
# other code
@@ -262,7 +239,7 @@ To learn about our branching model, see [Branching Model](https://github.com/spl
262239
| [REST API Reference Manual](https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTprolog) | Splunk REST API reference documentation |
263240
| [Splunk>Docs](https://docs.splunk.com/Documentation) | General documentation for the Splunk platform |
264241
| [GitHub Wiki](https://github.com/splunk/splunk-sdk-python/wiki/) | Documentation for this SDK's repository on GitHub |
265-
242+
| [Splunk Enterprise SDK for Python Examples](https://github.com/splunk/splunk-app-examples) | Examples for this SDK's repository |
266243

267244
## Community
268245

docker-compose.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ services:
99
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
1010
- SPLUNK_PASSWORD=changed!
1111
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
12-
volumes:
13-
- ./examples/github_forks:/opt/splunk/etc/apps/github_forks
14-
- ./splunklib:/opt/splunk/etc/apps/github_forks/lib/splunklib
15-
- ./examples/random_numbers:/opt/splunk/etc/apps/random_numbers
16-
- ./splunklib:/opt/splunk/etc/apps/random_numbers/lib/splunklib
17-
- ./examples/github_commits:/opt/splunk/etc/apps/github_commits
18-
- ./splunklib:/opt/splunk/etc/apps/github_commits/lib/splunklib
19-
- ./examples/searchcommands_app/package:/opt/splunk/etc/apps/searchcommands_app
20-
- ./splunklib:/opt/splunk/etc/apps/searchcommands_app/lib/splunklib
21-
- ./examples/twitted/twitted:/opt/splunk/etc/apps/twitted
2212
ports:
2313
- 8000:8000
2414
- 8088:8088

examples/abc/README.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

examples/abc/a.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

examples/abc/b.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/abc/c.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)