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
0
votes
0 answers

Issue with accessing Jenkins api with Vue/Axios call

I tried making a get call with axios from my Vue js codebase/ environment to Jenkins API and I'm unable to do so. I've read every resource that I could but wasn't able to fix this particular problem. I even created a .htaccess file to see if it…
dacD
  • 25
  • 2
  • 4
0
votes
1 answer

How to restrict my groovy script to get only the build count for 24 hrs/1day and it fails if i run it when a job is under execution

I have the below groovy script designed to get me the total no of builds that have been triggered on each job, now i want to restrict it to just fetch the jobs that have been executed in duration of last 24 hrs also if i run this script on jenkins…
0
votes
2 answers

How to fix the Jenkins 401 Unauthorized when using java API and provided correct credentials

I'm trying to connect to Jenkins using Java based on https://wiki.jenkins.io/display/JENKINS/Authenticating+scripted+clients I am always getting 401 Unauthorized error. User name and password are correct, I can login to Jenkins using them through…
anurag
  • 1
  • 1
  • 1
0
votes
0 answers

Jenkins - Not able to trigger build via API

I was trying to access jenkins via api When a api call is made in POSTMAN it is working perfectly fine, but if the same is accessed in an application(written in react), getting the following error To run : "java -jar jenkins.war" url :…
Developer
  • 9
  • 3
0
votes
1 answer

Using Jenkins API token without Username

Is Jenkins has token mechanism to authorize Jenkins APIs without using username? Thanks, Srikanth.
0
votes
2 answers

Is there a function in any Jenkins API that provides me with a slave nodes COMPUTERNAME/Hostname

I need to get together a list of all the hostnames of the jenkins slave nodes set up on my jenkins master node. Many of the nodes are set up with names like SLAVE NODE EXAMPLE instead of having their server name as the name of the node. I know how…
0
votes
1 answer

Subversion post commit hook for Jenkins

I just spent a day wading through a decade's worth of SO questions, forum posts and the Jenkins Subversion Plugin wiki and documentation. The question I was trying to answer: What is the current minimal setup required to trigger jobs by Subversion…
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79
0
votes
1 answer

Pure Java REST API POST calls to Jenkins /reload or /restart always return status 403 forbidden, but work

I'm getting an Exception when running this, but Jenkins actually executes the requested action: URL url = new URL("https://somehost.com/jenkins/quietDown"); HttpURLConnection c= (HttpURLConnection) url.openConnection(); …
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79
0
votes
1 answer

How to request Jenkins API REST behind NGINX reverse proxy both in Docker?

I have Jenkins behind NGINX reverse proxy, both docker containers are in the same network thanks to docker compose. The only entrance to Jenkins server is through NGINX which expose 80 port. Once the request reach NGINX container then it redirects…
0
votes
1 answer

angular http post - trigger jenkins build with parameters

using below typescript function to trigger a jenkins build - httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': 'Basic ' + btoa('username:password'), }) …
Suraj Nerati
  • 99
  • 1
  • 8
0
votes
3 answers

How do I retrieve the last good build with depth 2 with the Python JenkinsAPI

I'm trying to retrieve the build data for a specific build with depth 2 but the default is always 1 J = Jenkins(host,user,password) job = J.get_job(job_name) build_number = job.get_last_good_build() It's not mentioned in the documentation, only how…
shanwar
  • 319
  • 1
  • 2
  • 19
0
votes
2 answers

While using jenkins API, getting a failure on attribute 'Jenkins'

I am executing my script on Mac (macOS 10.14.1) using Python (2.7.10). This is what i have in my script: server_jenkins = jenkins.Jenkins(JENKINS_URL, username=JENKINS_USER, password=JENKINS_PASS) And this is the error i am getting: AttributeError:…
Nisim Naim
  • 151
  • 1
  • 15
0
votes
0 answers

Jenkins API returning 403 on HTTPURLConnector

I'm setting up some things and I need to access my Jenkins API. Well, everything works fine if I send a GET request to http://.../job/DogoBot/lastBuild/api/json with restman and javascript's XMLHttpRequest, etc. But when I try HTTPURLConnector from…
0
votes
1 answer

Jenkins API 500 with python

I tried to use curl to create job , it's done successfully. But when I use python tempfile or python jenkins API ,server return a 500 error. ``` def create_job(job_name, config_xml): headers = {'Content-Type': 'text/xml'} f =…
Joe
  • 52
  • 1
  • 9
0
votes
1 answer

Unable to create default project for Jenkins extensions

I just opened the terminal and executed the below command which will create a default project structure for Jenkins Plugin development. But I had build failure with below error message.I'm a newbie for Jenkins plugins world. Command: mvn…
ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84