Skip to content

Commit

Permalink
Merge pull request #461 from splunk/release/1.6.20
Browse files Browse the repository at this point in the history
Release/1.6.20
  • Loading branch information
vmalaviya-splunk committed Jun 7, 2022
2 parents f28dd7b + be9d985 commit e045c07
Show file tree
Hide file tree
Showing 167 changed files with 154 additions and 36,916 deletions.
77 changes: 14 additions & 63 deletions .github/workflows/release.yml
@@ -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
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
@@ -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
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
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
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.

0 comments on commit e045c07

Please sign in to comment.