0

I have Jenkins instance with the Config File Provider Plugin installed, and I have configured some files using this plugin. I want to retrieve the configuration of these files programmatically using the Python Jenkins client library.

I have tried using the jenkins.Jenkins class from the Python Jenkins library to get the configuration, but I am getting a 404 error for the URL http://<JENKINS_URL>/computer/%7B'classpath':%20'config-file-provider'%7D/scriptText.

Here's the code I tried:

import jenkins

# Connect to Jenkins
server = jenkins.Jenkins('http://<JENKINS_URL>')

# Get configuration of Config File Provider Plugin
config = server.run_script('configFileProvider.getConfigFileById("<CONFIG_FILE_ID>")')

I am getting the following error:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://<JENKINS_URL>/computer/%7B'classpath':%20'config-file-provider'%7D/scriptText

How can I correctly retrieve the configuration of a file configured using the Config File Provider Plugin in Jenkins using the Python Jenkins client library? Any help or guidance would be appreciated.

Underoos
  • 4,708
  • 8
  • 42
  • 85

0 Answers0