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

Is there a wat to Copy Jenkins Job with Builds using API?

I was searching for a way to copy jenkins job with builds using API. I tried few Python Wrappers: from api4jenkins import Jenkins j = Jenkins('http://127.0.0.1:8080/', auth=('admin', 'admin')) j.copy_job('freestylejob', 'newjob') but the copy…
Parth Jeet
  • 129
  • 2
  • 15
0
votes
1 answer

Jenkins API - filter last builds for how are triggered and time

Hello I need to get every night last builds triggered by timer, check status and if unsuccessful re-trigger. Couldn't find a way how to filter a build for particular time and by how is triggered curl --insecure --user test:test…
Alfador
  • 15
  • 6
0
votes
2 answers

Jenkins api token expiry

I have been trying to setup Jenkins api token so that I can use it tin python codes. Is there any expiry for the Jenkins api token created via the UI.
Dennis
  • 21
  • 1
  • 3
0
votes
1 answer

Jenkins API: list all available labels

In the Jenkins API it's possible to query for information regarding a specific label (MY_LABEL) by invoking: https://JENKINS_URL/label/MY_LABEL/api/json?pretty=true Question: Is there any endpoint that could list ALL the available labels on a…
Niclas
  • 1,306
  • 5
  • 15
  • 28
0
votes
1 answer

How to pass environment variable to Jenkins Remote API when submitting job

I have a declarative pipeline job (this is not multi-branch pipeline job using Jenkinsfile) without parameters but some stages are conditional based on value in environment variable: stage('deploy-release') { when { environment name:…
0
votes
1 answer

Trigger parameterized builds through api calls

I am trying to trigger the Jenkins builds through API calls everything is working without parameters. If i am trying with parameters job is not getting triggered. curl -I -u tmp:apitoken…
rahuls36
  • 15
  • 7
0
votes
0 answers

How to get Jenkins Build details like build number and test result status of a particular GitHub commit

I am working on a POC, where I want to get Jenkins build details like build number, Test result status, build status of a particular number using Git Hub Commitsha number. Can someone let me know if there is any GitHub API that can be use to fetch…
Karthik P
  • 107
  • 2
  • 12
0
votes
1 answer

How to setup the first admin user in Jenkins as part of the initial install and not through the UI?

I am planning to launch Jenkins in a Docker container and would like to set up the admin user as part of the initial install and not via the UI.
user3442679
  • 59
  • 1
  • 1
  • 11
0
votes
0 answers

Jenkins API is giving access denied error

When I use jenkins get api from browser, it works perfectly... But when i hit api using curl it is giving below error... Curl command: curl -u JENKINS_USER_ID:TOKEN JENKINS_API_URL Access Denied... is missing the Overall/Read permission.
Abhishek Parmar
  • 287
  • 2
  • 8
  • 21
0
votes
1 answer

Trigger a Openshift Jenkins Job via command line (CURL)

I am trying to trigger a job present in jenkins hosted in openshift platform. I am trying to trigger the job through command line. I tried the below: curl -x post -u username:password https://myjenkins.com/job/myjob/build?delay=0sec and this…
lr-pal
  • 339
  • 2
  • 6
  • 20
0
votes
1 answer

Unable to trigger Jenkins build via java

I want to trigger Jenkins to build a job but the below code just retrieves the error 403. public static void main(String[] args) { try { URL url = new URL("http://localhost:8080/job/RPA/build?token=117cdb21bf4c01f8c20ff5cf7e368dba8c");…
M.Zaky
  • 41
  • 1
  • 10
0
votes
1 answer

"build_job() got an unexpected keyword argument" Error when jenkins jobs triggered through jenkins API

def runjob(joblist): server = Jenkins('http://localhost:8080', username='',password='' ) for x in joblist: server.build_job(name=x,token="NRT") This used to run and trigger the job but started throwing this error now,…
Rahul Nanda
  • 37
  • 1
  • 6
0
votes
1 answer

Cant get Last build status problematically from Jenkins - 403 forbidden

I want to get from Jenkins the last build status via C# code, once I'm triggered a "GET" request it returns me 403 forbidden. public void GetJsonByGet(string url) { string json = string.Empty; HttpWebRequest request =…
0
votes
1 answer

Accessing Jenkins API using Javascript

As titled, I tried to access the Jenkins API (Jenkins latest version, which is 2.204.1) using the Jenkins library. I tried to make a call to retrieve the build log using the following code in React import Jenkins from 'jenkins' // ngrok is used to…
Fred A
  • 1,602
  • 1
  • 24
  • 41
0
votes
1 answer

Generating comprehensive Jenkins plugin manifest using Plugin Manager's REST API and JQ

I'm trying to get a Set of installed Jenkins plugins through the API using curl and jq but can't seem to flatten nested arrays correctly. An example of the output JSON I'm fetching: { "plugins": [ { "shortName": "foo", …
starscream_disco_party
  • 2,816
  • 5
  • 26
  • 42