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

Check if file path exists in a different node jenkins?

Lets say I have 2 nodes: NodeA NodeB I want to check if NodeB has a given directory through NodeA. Is there a way to do this through the Jenkins API? Expected Results NodeA should return true if the file path exists in NodeB NodeA should retrun…
1
vote
1 answer

get Jenkins instance from bare groovy

I'm trying to calling Jenkins API from bare groovy script ( in local environment ) instead of https://jenkins.domain.com/script. Now I can successful import Jenkins libs as below: @GrabResolver(name='jenkins',…
Marslo
  • 2,994
  • 4
  • 26
  • 35
1
vote
1 answer

Python | Jenkins API | Unable to get build data or build response

Python Version - 3.10.4 and Jenkins Version - 2.321 Am trying to fetch the build information using python script and Jenkins API. from jenkinsapi.jenkins import Jenkins def get_server_instance(): jenkins_url = 'My build…
1
vote
1 answer

How to call Jenkins REST API without passing credentials using Java in already logged-in Jenkins?

I have used Jenkins REST API URL to get build status using Java (JAR). It is working successfully by passing user name and password to the API URL. I created a job in Jenkins and using that JAR file to get build status. But, my question is that why…
1
vote
1 answer

How to get nodes credentials using jenkinsapi

I need to get credentials information (which credentials used) for node. Currently I use this code that prints LOT of information but no credentials info that used for the node: for node in get_server_instance().nodes._data['computer']: for i…
Ziv M
  • 409
  • 6
  • 18
1
vote
1 answer

How to trigger the build of a Jenkins pipeline using REST API with parameters in a POST request?

I made necessary setup to allow a Jenkins pipeline job to be triggered remotely using its REST API. I'm now testing build trigger using curl. Builds are triggered properly but none of the build parameters are detected. Jenkins version is…
donmelchior
  • 893
  • 3
  • 13
  • 31
1
vote
1 answer

How to re-run Parameterized Jenkins Job again via code (without using rebuild plugin through UI)?

I have 80 jenkins jobs which I want to re-build programmatically. All 80 were run with different set of parameters. I can see 2 approaches here for job x which is inside a view as well as folder, Use some Jenkins API to build x job just by…
1
vote
1 answer

How to get details of Jenkins job triggered in "Post-Build Actions" from Jenkins REST API?

I have a Jenkins job A which triggers job B in its Post-Build Actions section. Post Build Actions Need Jenkins REST API with which I can get build result details for job A which should include details for job B as well. I have tried…
1
vote
1 answer

Get all builds started by user in Jenkins

The following page in Jenkins is supposed to list the builds started by a user user - https:///user//builds But this is always empty for all users in my Jenkins. There are no errors in System Log or in the browser. Not sure…
Shashank V
  • 10,007
  • 2
  • 25
  • 41
1
vote
1 answer

Jenkins JSON API - Locate Build, Build Environment, and Build Trigger API data

I am working with the Jenkins API JSON. I understand the format to retrieve API data in JSON /job//api/json Within the job//configure UI we can configure/add Build triggers, build env, and build data. I want to be…
Roger Perez
  • 2,807
  • 29
  • 31
1
vote
1 answer

How to get Script Path from each Jenkins Jobs using Groovy Console Script/Jenkins API

I have a requirement to fetch Script path from Jenkins Job . Please find the below screenshot to understand the requirement more clearly. I have checked in google to get some Groovy Console Script which lists details of each Job. By using the…
1
vote
0 answers

How to find an instances of a test by status from across all builds

I'm creating an api request using the Jenkins api. Im struggling to make the link from the build api docs, to the testreport api docs. So far I have: api/json?&pretty=true&tree=allBuilds[TestResultAction[*]]] This isn't working, I think…
MrClamps
  • 31
  • 9
1
vote
0 answers

Add Jenkins user with Ansible or cURL

I'm preparing a project with Jenkins in Docker container. After a lot of research, I don't find any solution how to add new Jenkins user with Ansible or cURL. There are some suggestions…
ptsonkov
  • 11
  • 3
1
vote
2 answers

Jenkins to List count of build for jenkins job

I wanted to create a jenkins job which can list me all jenkins job with it is count of number of builds it has executed. Jenkins API or Groovy may work. Below API provide me list of all build ids for particular job but I'm looking for count for…
Jay2201
  • 21
  • 1
  • 7
1
vote
1 answer

How to parse and update jenkins job config.xml using python jenkinsapi module

I have installed Jenkinsapi python module and created below python script. from jenkinsapi.jenkins import Jenkins jenkinsSource = 'http://10.52.123.124:8080/' server = Jenkins(jenkinsSource, username = 'XXXXX', password =…
user2439278
  • 1,222
  • 7
  • 41
  • 75