Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.6.20 #461

Merged
merged 43 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
30b6be8
Add optional retries to connection attempts
mew1033 Nov 19, 2019
f329ba3
Remove biased language example, replace with saved search
fantavlik Dec 15, 2021
25625dc
Formatting
fantavlik Dec 15, 2021
e457e58
Merge commit '5267feadeb61567a83a31899dbe5f0e253ba49e5' into fix-bias…
fantavlik Dec 15, 2021
1c1fa67
Merge branch 'optional-retry' into add-http-retries
ashah-splunk Mar 10, 2022
1cdd852
Merge pull request #293 from mew1033/add-http-retries
ashah-splunk Mar 10, 2022
1ffb2a5
Update test_service.py
ashah-splunk Mar 15, 2022
7d4dd58
Update testlib.py
ashah-splunk Mar 15, 2022
523aefc
Added test case and example for Optional Retry
ashah-splunk Mar 21, 2022
9ffbb74
setup update
ashah-splunk Mar 22, 2022
44415b4
Merge pull request #445 from splunk/master
akaila-splunk Mar 29, 2022
f5ffb67
added auth token cookie check
akaila-splunk Apr 1, 2022
09d0c0f
Updated auth_headers checks
akaila-splunk Apr 1, 2022
0d873a7
added check for auth token in cookie
akaila-splunk Apr 1, 2022
1b8f6cc
Update release.yml
ashah-splunk Apr 4, 2022
1b4ed0f
Update release.yml
ashah-splunk Apr 4, 2022
a72f7b6
Update release.yml
ashah-splunk Apr 4, 2022
71b8ed7
Update release.yml
ashah-splunk Apr 4, 2022
feada51
Update release.yml
ashah-splunk Apr 8, 2022
f3213b6
Update release.yml
ashah-splunk Apr 8, 2022
d16a145
Update testlib.py
ashah-splunk Apr 8, 2022
a675c05
Optional retry for CI test cases
ashah-splunk Apr 8, 2022
df13906
Update test_service.py
ashah-splunk Apr 12, 2022
af2898b
Update binding.py
ashah-splunk Apr 12, 2022
e162cc0
Merge pull request #446 from splunk/release-workflow-refactor
ashah-splunk Apr 13, 2022
3c9f1ab
changed retry delay variable name
ashah-splunk Apr 13, 2022
ac706f7
Added Output mode JSON support for jobs.create
ashah-splunk Apr 14, 2022
f7f15b2
Update client.py
ashah-splunk Apr 14, 2022
f49d37c
Documentation changes
ashah-splunk Apr 19, 2022
fa7b2a8
Merge pull request #425 from splunk/fix-biased-language-example
fantavlik Apr 19, 2022
875a58d
Merge pull request #448 from splunk/documentation-updates
ashah-splunk Apr 20, 2022
ce390c6
Merge pull request #447 from splunk/DVPL-10137
ashah-splunk Apr 20, 2022
7acd49a
Update binding.py
ashah-splunk Apr 20, 2022
8881cd8
Merge pull request #442 from splunk/optional-retry
ashah-splunk Apr 20, 2022
368f936
test case refactoring for code change
ashah-splunk Apr 22, 2022
c282acc
Merge pull request #449 from splunk/set-cookie-issue-438
ashah-splunk Apr 27, 2022
48d1d6f
removed example directory
akaila-splunk May 2, 2022
a4e04cc
removed examples test cases
akaila-splunk May 2, 2022
8816b60
updated README.md file and removed example references
akaila-splunk May 2, 2022
703e49a
Merge pull request #450 from splunk/DVPL-10990
ashah-splunk May 12, 2022
b319a98
Remove restart() call from disable method
vmalaviya-splunk Jun 1, 2022
f016f44
Merge pull request #460 from splunk/remove-restart-from-disable
vmalaviya-splunk Jun 6, 2022
be9d985
Release changes
vmalaviya-splunk Jun 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
77 changes: 14 additions & 63 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,10 @@
name: Release
on:
push:
branches:
- master
workflow_dispatch: { }

jobs:
find_version:
name: Find Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout source
uses: actions/checkout@v2.3.2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Get version
id: get-version
run: python -c 'import splunklib; print("::set-output name=version::%s" % splunklib.__version__)'
- name: Install tox
run: pip install tox
- name: Generate API docs
run: |
rm -rf ./docs/_build
tox -e docs
cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX"
tag_version:
needs: find_version
name: Tag Version
runs-on: ubuntu-latest
steps:
- name: Create tag
uses: tvdias/github-tagger@v0.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.find_version.outputs.version }}
release:
needs: [ find_version, tag_version ]
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2.3.2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.find_version.outputs.version }}
release_name: Release/${{ needs.find_version.outputs.version }}
body: |
## Version ${{ needs.find_version.outputs.version }}
types: [published]

**TODO: Insert CHANGELOG.md contents here.**
draft: false
prerelease: false
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: apidocs
path: docs/_build/docs_html.zip
jobs:
publish:
needs: release
name: Deploy Release to PyPI
runs-on: ubuntu-latest
steps:
Expand All @@ -84,6 +23,18 @@ jobs:
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Install tox
run: pip install tox
- name: Generate API docs
run: |
rm -rf ./docs/_build
tox -e docs
cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX"
- name : Docs Upload
uses: actions/upload-artifact@v3
with:
name: apidocs
path: docs/_build/docs_html.zip
# Test upload
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@master
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@ proxy.log
MANIFEST
coverage_report
test.log
examples/*/local
examples/**/local.meta
examples/**/*.log
tests/searchcommands_data/log/
tests/searchcommands_data/output/
examples/searchcommands_app/searchcommand_app.log
Test Results*.html
tests/searchcommands/data/app/app.log
splunk_sdk.egg-info/
dist/
examples/searchcommands_app/package/lib/splunklib
tests/searchcommands/apps/app_with_logging_configuration/*.log
*.observed
venv/
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Splunk Enterprise SDK for Python Changelog

## Version 1.6.20

### New features and APIs
* [#442](https://github.com/splunk/splunk-sdk-python/pull/442) Optional retries feature added
* [#447](https://github.com/splunk/splunk-sdk-python/pull/447) Create job support for "output_mode:json" [[issue#285](https://github.com/splunk/splunk-sdk-python/issues/285)]

### Bug fixes
* [#449](https://github.com/splunk/splunk-sdk-python/pull/449) Set cookie [[issue#438](https://github.com/splunk/splunk-sdk-python/issues/438)]
* [#460](https://github.com/splunk/splunk-sdk-python/pull/460) Remove restart from client.Entity.disable

### Minor changes
* [#444](https://github.com/splunk/splunk-sdk-python/pull/444) Update tox.ini
* [#446](https://github.com/splunk/splunk-sdk-python/pull/446) Release workflow refactor
* [#448](https://github.com/splunk/splunk-sdk-python/pull/448) Documentation changes
* [#450](https://github.com/splunk/splunk-sdk-python/pull/450) Removed examples and it's references from the SDK


## Version 1.6.19

### New features and APIs
Expand Down
41 changes: 9 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# The Splunk Enterprise Software Development Kit for Python

#### Version 1.6.19
#### Version 1.6.20

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.
The Splunk Enterprise Software Development Kit (SDK) for Python contains library code designed to enable developers to build applications using the Splunk platform.

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.

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

## Get started with the Splunk Enterprise SDK for Python

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.
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.

### Requirements

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

### Install the SDK

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.
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.

Use `pip`:

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

export PYTHONPATH=~/splunk-sdk-python

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.

### Following are the different ways to connect to Splunk Enterprise
#### Using username/password
```python
Expand Down Expand Up @@ -115,29 +113,9 @@ here is an example of .env file:
# Session key for authentication
#sessionKey=<Session-Key>

#### Run the examples

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:

Using username and Password

python examplename.py --username="admin" --password="changeme"

Using Bearer token

python examplename.py --bearerToken=<value>

Using Session key

python examplename.py --sessionKey="<value>"
#### SDK examples

If you saved your login credentials in the **.env** file, you can omit those arguments:

python examplename.py

To get help for an example, use the `--help` argument with an example:

python examplename.py --help
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.

#### Run the unit tests

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

### Customization
* 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.
Expand Down Expand Up @@ -216,7 +193,7 @@ class GeneratorTest(GeneratingCommand):

### Access metadata of modular inputs app
* In stream_events() method we can access modular input app metadata from InputDefinition object
* 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.
* 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.
```python
def stream_events(self, inputs, ew):
# other code
Expand Down Expand Up @@ -262,7 +239,7 @@ To learn about our branching model, see [Branching Model](https://github.com/spl
| [REST API Reference Manual](https://docs.splunk.com/Documentation/Splunk/latest/RESTREF/RESTprolog) | Splunk REST API reference documentation |
| [Splunk>Docs](https://docs.splunk.com/Documentation) | General documentation for the Splunk platform |
| [GitHub Wiki](https://github.com/splunk/splunk-sdk-python/wiki/) | Documentation for this SDK's repository on GitHub |

| [Splunk Enterprise SDK for Python Examples](https://github.com/splunk/splunk-app-examples) | Examples for this SDK's repository |

## Community

Expand Down
10 changes: 0 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ services:
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
- SPLUNK_PASSWORD=changed!
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
volumes:
- ./examples/github_forks:/opt/splunk/etc/apps/github_forks
- ./splunklib:/opt/splunk/etc/apps/github_forks/lib/splunklib
- ./examples/random_numbers:/opt/splunk/etc/apps/random_numbers
- ./splunklib:/opt/splunk/etc/apps/random_numbers/lib/splunklib
- ./examples/github_commits:/opt/splunk/etc/apps/github_commits
- ./splunklib:/opt/splunk/etc/apps/github_commits/lib/splunklib
- ./examples/searchcommands_app/package:/opt/splunk/etc/apps/searchcommands_app
- ./splunklib:/opt/splunk/etc/apps/searchcommands_app/lib/splunklib
- ./examples/twitted/twitted:/opt/splunk/etc/apps/twitted
ports:
- 8000:8000
- 8088:8088
Expand Down
2 changes: 1 addition & 1 deletion docs/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ splunklib.results

.. autoclass:: Message

.. autoclass:: ResultsReader
.. autoclass:: JSONResultsReader
24 changes: 0 additions & 24 deletions examples/abc/README.md

This file was deleted.

70 changes: 0 additions & 70 deletions examples/abc/a.py

This file was deleted.