Splunk Cloud Platform

Admin Config Service Manual

Manage Python versions in Splunk Cloud Platform

The Admin Config Service (ACS) API lets you change the Python runtime version of your Splunk Cloud Platform deployment on a self-service basis. You can use this functionality to rollback the Python version in case you experience failures as a result of migration to a newer python version, and upgrade the Python version once those issues are resolved.

Requirements

To change the Python version using the ACS API:

  • You must have the sc_admin role.

Python version change 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 change 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.

Manage the Python version using the ACS API

You can use the ACS API to check the current Python runtime version of your deployment and change 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 force_python3, python3, python3.7, python3.9, and python2. For example:

{
  "pythonRuntime": "force_python3"
}

For endpoint details, see python-runtime in the ACS endpoint reference.

Change the Python version

To change the Python runtime version for your deployment, send an HTTP POST request to the python-runtime endpoint, specifying the pythonVersion value 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" : "python2"
        }'

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.

Last modified on 18 July, 2024
Manage private apps in Splunk Cloud Platform   Manage Splunkbase apps 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, 9.1.2312, 9.2.2403 (latest FedRAMP release), 9.2.2406


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters