Downgrade Python version in Splunk Cloud Platform
The Admin Config Service (ACS) API lets you downgrade the Python runtime version of your Splunk Cloud Platform deployment programmatically on a self-service basis. You can use this functionality to rollback the current Python version to Python 2 in case you experience failures as a result of migration to Python 3 in Splunk Cloud Platform.
Requirements
To downgrade the Python version using the ACS API:
- You must have the
sc_admin
role.
Python version downgrade requires a restart. The ACS endpoint does not trigger an immediate restart. Splunk Cloud Platform triggers the restart internally on a nightly basis.
Python version downgrade can take up to to 24 hours to complete.
Set up the ACS API
Before using the ACS API, you must download the ACS OpenAPI 3.0 specification, which includes the parameters, response codes, and other data you need to work with the ACS API.
You must also create an authentication token in Splunk Cloud Platform for use with ACS endpoint requests. For details on how to set up the ACS API, see Set up the ACS API.
Downgrade the Python version using the ACS API
You can use the ACS API to check the current Python runtime version of your deployment and downgrade the Python version if necessary.
Check the current Python version
To check the current Python runtime version, send an HTTP GET request to the python-runtime
endpoint. For example:
curl 'https://admin.splunk.com/{stack-name}/adminconfig/v2/python-runtime' \ --header 'Authorization: Bearer eyJraWQ...'
The response shows the current Python runtime version. Supported values are python2
, force_python3
and python3
For example:
{ "pythonRuntime": "force_python3" }
For endpoint details, see python-runtime in the ACS endpoint reference.
Downgrade Python version
To downgrade the Python runtime version for your deployment, send an HTTP POST request to the python-runtime
endpoint, specifying the pythonVersion
parameter in the request body. For example:
curl -X POST 'https://admin.splunk.com/{stack-name}/adminconfig/v2/python-runtime' \ --header 'Authorization: Bearer eyJraWQ...' \ -H "Content-Type: application/json" \ --data '{ "pythonVersion" : "unset" }'
The response indicates that the Python version has been rolled back to Python 2:
{ "message": "pythonVersion rolled back to python2" }
For endpoint details, see python-runtime in the ACS endpoint reference.
To upgrade the Python version after downgrading to Python 2, contact Splunk Support.
Configure outbound ports for Splunk Cloud Platform | Manage app permissions in Splunk Cloud Platform |
This documentation applies to the following versions of Splunk Cloud Platform™: 8.2.2112, 8.2.2201, 8.2.2202, 8.2.2203, 9.0.2205, 9.0.2208, 9.0.2209, 9.0.2303, 9.0.2305, 9.1.2308 (latest FedRAMP release), 9.1.2312, 9.2.2403
Feedback submitted, thanks!