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
3
votes
1 answer

How to check the executor of a job with the Jenkins API?

I was looking at the jenkins api, specifically around jobs that have been previously executed on my jenkins master. Using the following code: http://host/job//lastBuild/api/json I can see the 'executor' field is 'null' when the job is run…
Tesenka
  • 83
  • 9
2
votes
1 answer

How to pass parameters to Jenkins' API with Python and api4jenkins?

I'm having trouble with Jenkins' API while using Python 3.10.2 with Ubuntu LTS 20.4 with Jenkins 2.361 with api4jenkins 1.11 as the wrapper for the API. My main trouble is passing parameters to a Task. I'm able to start the task, and I'm doing as…
Alex Turner
  • 698
  • 6
  • 16
2
votes
0 answers

jenkinsapi python - trigger and track the job result

according to this question jenkinsapi python - how to trigger and track the job result, I should get the next build number and then track it, this solution will fail when running in multi threading. is there a way to cover this case also ? maybe by…
feras odeh
  • 51
  • 4
2
votes
1 answer

Not Able To Access Jenkins API From Plain JavaScript

I'm fairly new to API's and JavaScript so I'm not sure what wrong I'm doing here, please find the details below for the problem which I'm facing Objective - Get Jenkins Details On A Webpage As a part of my objective, I'm trying to make a web page…
Deepak Yadav
  • 321
  • 1
  • 8
  • 19
2
votes
0 answers

How to fetch system info from jenkins

Jenkins has many api's but do we have anything using which we can fetch systeminfo via python code or web scraping. The system info will be present on the web page http://your.jenkins.url/systemInfo
Check_mate
  • 45
  • 8
2
votes
2 answers

how to get all the jenkins users through api

I'm trying to get all the user in jenkins by using api . For example I hit the following command in postman and it is showing me all the jobs in jenkins . Url = 192.168.195.150:8080/api/json?pretty=true Result: { "_class":…
SKuser
  • 35
  • 1
  • 4
  • 9
2
votes
2 answers

How can i get all this builds numbers between particular date using python Jenkins API?

For example, i have bunch of builds between 22 and 23. How can i get all this builds numbers between particular date using python Jenkins API?
Alex Nikitin
  • 841
  • 1
  • 10
  • 29
2
votes
0 answers

Jenkins CSRF: how to use the Build Token Root Plugin to call the crumbIssuer ? (anonymous access)

Jenkins version: 2.121.1 . Global security: LDAP + Matrix-based security . No access rights for Anonymous. Since anonymous access is disabled, my script cannot get access to 'http://jenkins_host/crumbIssuer/api/json'. in order to get the CSRF…
freeAR
  • 943
  • 3
  • 18
  • 32
2
votes
0 answers

__init__() got an unexpected keyword argument 'ssl_verify'

Currently, I am trying to make a Jenkins API request with Python; however, I am getting in return a certificate error. In order to bypass this (and take the easy way out) I'm calling a jenkins request with the parameter ssl_verify = False. But the…
boppa
  • 149
  • 3
  • 15
2
votes
1 answer

Jenkins: What is better to use? Crumb or Authentication Token?

To trigger a job remotely via script: Jenkins provides two mechanisms. One is Jenkins generated Crumb - common for all jobs. Other option is manually created Authentication Token - can be unique for all jobs. Which of these two option is preferred…
2
votes
3 answers

Remotely Build Specific Jenkins Branch

I'm wondering if it's possible to specify a branch to build when triggering a Jenkins job remotely. I'm writing a Python script which involves running a specific Jenkins build. I'm able to run the build from my script successfully, but I'm wondering…
kicksticks
  • 239
  • 3
  • 14
2
votes
1 answer

How to get list of free_style jobs using xml REST api in jenkins?

I want to get list of free_style jobs from remote Jenkins. eg. http://localhost:8080/api/xml?tree=jobs[name,url,description] by this i am able to get all jobs but i want to filter only freestyle project.
user1349964
  • 137
  • 5
2
votes
0 answers

Create jenkins credentials via API on other Domain except GLOBAL

As i explained on the Title have a piece of groovy script to create a credential (SSH key based) on jenkins master GLOBAL domain but i would like to know is there any way to create the same on other domain except GLOBAL. Say for example have below…
2
votes
2 answers

How to query specific branch build number from Jenkins JSON Remote Access API

Within the browser for my jenkins job I'm running the following query. lastStableBuild/api/json?pretty=true&tree=actions[buildsByBranchName[*[*]]] Results from the above query { "_class" : "hudson.model.FreeStyleBuild", "actions" : [ { …
dooplenty
  • 124
  • 7
2
votes
3 answers

How to create a jenkins credentials via API?

Does anybody know how to create a new jenkins (2.8) credentials (f.e for a git access) via API or POST request in Jenkins? I have tried to use this code (from another stackoverflow topic), but it does nothing: import json import requests def…
Oleg
  • 41
  • 1
  • 3
1 2
3
12 13