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
1
vote
1 answer

How to solve the JSON Decode Error that occurs only in Jenkins?

I am trying to run a python code on Jenkins which is located on the remote server. The code runs fine in my local jenkins as well as command prompt. It also runs correctly on the command prompt of the remote machine but fails while running on…
Pranali Dhole
  • 53
  • 1
  • 6
1
vote
1 answer

Java Generics: What is the intention of this pattern?

I have seen this in the Jenkins API, and I would like to understand the purpose of this pattern. I cannot grasp the meaning of JobT and RunT. Class Run,RunT extends Run> From:…
Thomas Hirsch
  • 2,102
  • 3
  • 19
  • 39
1
vote
0 answers

How to fix error 403 when making a post request to Jenkins use Python requests library?

I want to delete a job in Jenkins use api, I use python's requests library. It ok when I make a GET request (requests.get(...)) but when I make a POST request (requests.post(...)), it return code 403. I searched a solution use urllib2, but I can't…
1
vote
1 answer

jenkins responds "HTTP/1.1 302 Found" when trying to access /lastBuild/api/json

I'm trying to access jenkins (v2.177) API using curl. For instance, I try to get the lastbuild number as follows : curl -v -u user:pass http://myjenkins:port/job/myjob/lastBuild/api/json Insted of giving me a json, I get a "302 Found" with…
Peter
  • 11
  • 2
1
vote
0 answers

How to get build history by using git hub URL that used in Jenkins SCM through Jenkins API

I just want to get the build execution history like Execution status, Who is executed this build (Auto/Manual), build Id, through Jenkins API for specific SCM repository. I just want to fetch all these details based on the GitHub repository that I…
ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84
1
vote
1 answer

Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response(Jenkins API)

I see below error when trying to access Jenkins API(https://jenkinsbox:3000/api/json) using angular service with Basic authentication providing in headers. Error: Failed to load http://jenkinsbox:30000/api/json?&tree=jobs[name]: Request header…
Suraj Nerati
  • 99
  • 1
  • 8
1
vote
0 answers

Replicate curl request to Jenkins in Java

There are a hundred questions like this but I couldn't find any working answer to my question. With curl I have a working request, response is 201: created: curl -i -X POST…
Damian
  • 79
  • 1
  • 11
1
vote
1 answer

How can I pass parameters using jenkins-api into my Dockerfile

I am using the javascript jenkins-api to kick off a build via an express API as follows jenkins.build_with_params('jobname', {param1: "xxxxxx", param2: "xxxxx"}, function(err, data) { if (err){ console.log(err); …
user4447899
  • 320
  • 7
  • 21
1
vote
1 answer

How to pass multiple build parameter value for a Jenkins job using Rest Assured?

I want to remotely build a jenkins job using multiple parameter through restassured API jobs in java. I tried using the following link…
Akash Tyagi
  • 97
  • 2
  • 15
1
vote
1 answer

Set Jenkins "Global Tool Configuration" properties using script

I am trying to deploy the jenkins pod through docker and configure the Jenkins Jobs through the scripts. Using some of below restAPIs a) https:///scriptText b) https:///job//build c) https:///job/api/json . . and…
va1bhav
  • 365
  • 1
  • 5
  • 21
1
vote
2 answers

In Jenkins, can I find a job by its display name?

I have a pipeline project with a stage in which a unique identifier is retrieved from an external system and set as the job's display name. I know this identifier to be unique for my whole Jenkins installation, so any search by this key should…
willyjoker
  • 787
  • 6
  • 16
1
vote
0 answers

How to make an API call to a Jenkins server which requires authentication?

I am using the following function from https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients. import java.io.IOException; import java.net.URI; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import…
1
vote
1 answer

Is there any Jenkins API to retrieve PMD/ findbugs, checkstyle results

I have a requirement to retrieve Findbugs, PMD and checkstyle reports using API.FindBugs: bug report can be extracted from findbug.xml Is there any other option other than extracting report from xml files? Update: Answer As @Andrew said, You can…
Anupama Boorlagadda
  • 1,158
  • 1
  • 11
  • 19
1
vote
1 answer

How to automate release and staging phases with token using Jenkins and Artifactory?

I want to automate the Artifactory release and staging in jenkins job. I got this curl command, curl -X GET "http://localhost:9090/job/artifactory-8.0-release/artifactory/staging? it is working fine, but it is asking for authentication. When i do…
1
vote
1 answer

How to get the list of the file names from build artifacts using jenkins rest api?

I am trying to get the list of file names from the build artifacts using jenkins rest api. This URL http://your.jenkins.server/job/your.job/lastStableBuild/artifact/relativePath would download the artifact. Is it possible to get the names of the…
user2301
  • 1,857
  • 6
  • 32
  • 63