Questions tagged [jenkins-api]

Jenkins provides an API that allows you to access Jenkins via REST (see http://localhost:8080/api/ of a running Jenkins) to retrieve information or interact with Jenkins.

Jenkins provides an API that allows you to access Jenkins via REST (see http://localhost:8080/api/ of a running Jenkins) to retrieve information or interact with Jenkins.

181 questions
25
votes
6 answers

Create jobs and execute them in jenkins using REST

I am trying to create a WCF REST client that will communicate to Jenkins and create a job from an XML file and then build the job. My understanding is that you can do that with Jenkins. Can some one please provide some commands that you can type on…
David
  • 617
  • 1
  • 6
  • 15
12
votes
2 answers

Jenkins API throws IOException: Failed to persist config.xml

I am trying to use the Jenkins API with curl to create a new job, on Ubuntu 17.10. I'm following the example on this thread. Creating the crumb works well. However, the call to create the job fails with a stack trace with root cause: [edited to add…
Don Subert
  • 2,636
  • 4
  • 27
  • 37
11
votes
1 answer

As a Jenkins administrator, how do I get a user's API token without logging in as them?

As an administrator, how do I get an API token for a user other than myself, without logging in as them? When I visit the user configuration page, all I see is that "Token is hidden", and I cannot change it either.
Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129
8
votes
1 answer

How to retrieve all previous builds for a Jenkins job through the API?

I'm building a python script to pull build history data for Jenkins jobs. I've been successful with this using the Requests library to retrieve the json output, feed into a dataframe, and report on. I'm noticing it's only pulling the last 100…
miwiwa
  • 105
  • 1
  • 4
8
votes
2 answers

Python jenkinsapi ignore certificate

Recently, I turned jenkins to https. This is my code to use jenkinsapi : import jenkinsapi from jenkinsapi.jenkins import Jenkins from jenkinsapi.utils.requester import Requester import requests url = 'https://jenkinsd:443' username =…
Yehiel G
  • 231
  • 1
  • 2
  • 8
8
votes
2 answers

Is there any Jenkins API to get artifacts name and download it?

I want to ask, If I use jenkins. How can I get all artifacts list and download it, but not from jenkins web interface. I want to make my own web interface for certain goals. Is there any jenkins API to do this?
Kenny Basuki
  • 625
  • 4
  • 11
  • 27
7
votes
2 answers

Schedule Jenkins job using Jenkins Rest API

I have a Jenkins job which is scheduled for a specific time. I want to modify that timing programmatically. I tried to modify the build by installing Schedule Build plugin and modify it using http://jenkins_url/job/jobname/build?delay=3344sec. But…
user2439278
  • 1,222
  • 7
  • 41
  • 75
7
votes
2 answers

Jenkins API - is there a non-user (e.g. job-based) API token for read-only access?

There used to be a way for an anonymous user - such as a script - to query certain aspects of Jenkins via its REST API. For example, finding out the name of a user who started a particular build job, or the date it executed. However the security…
davidA
  • 12,528
  • 9
  • 64
  • 96
7
votes
0 answers

Jenkins: Get job name from an item in queue (through API)

I cannot seem to find the job name of an item in the queue through the API. Am I missing something (obvious)? I created two dummy jobs that require a machine named "build1" that is offline. When I access http://JENKINS_URL:8080/queue/api/json I get…
Samuel GIFFARD
  • 796
  • 6
  • 22
6
votes
1 answer

jenkinsapi python - how to trigger and track the job result

I am using JenkinsAPI to trigger parametrized jobs. I am aware of the REST API that Jenkins use, but our setup does not allow that directly; so the main mean for me to trigger jobs is through this library. So far I have no problems to find jobs on…
user9990443
6
votes
3 answers

How to get a list of Jenkins builds that ran at a particular time?

My current Jenkins has a large number of jobs. Different folders, each with multiple jobs. I recently saw that one Jenkins slave(which is auto-scaled) is sending too many requests to another server at a particular time. However, I am unable to find…
Amanjeet Singh
  • 323
  • 1
  • 3
  • 8
6
votes
1 answer

Get build information from jenkins using rest api

I want to retrieve the build summary for last 3 days from Jenkins using its rest API's and save the result as an XML file, How I can proceed with this?
Mukul
  • 351
  • 1
  • 7
  • 18
6
votes
1 answer

How to find and query a specific build in Jenkins using the Python Jenkins API

We have a Jenkins job that runs builds using specific parameters. Two of these parameters are important for me: the machine that the build is being deployed on, and the version number of the package that is…
shanwar
  • 319
  • 1
  • 2
  • 19
5
votes
1 answer

How to list the jenkins jobs script path programmatically

I'd like to create a groovy script to run on the jenkins console to list the job definition with the repository used and the script path (the jenkinsfile), with an output like this: JobName -> git repository -> script path So far I was able to list…
Mikyjpeg
  • 1,179
  • 1
  • 13
  • 39
5
votes
0 answers

Please clarify: Jenkins REST API with CSRF needs crumbs for user:PASSWORD, but not user:API_TOKEN?

I found that with CSRF Protection enabled, I can either issue a post request with crumbs header and using username:PASSWORD for the basic auth header: String basic = ":"; HttpURLConnection c = (HttpURLConnection) new…
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79
1
2 3
12 13