Jenkins provides machine-consumable remote access API to its functionalities. Currently it comes in three flavors:
XML
JSON with JSONP support
Python
Remote access API is offered in a REST-like style. That is, there is no single entry point for all features, and instead they are available under the “…/api/” URL where “…” portion is the data that it acts on.
For example, if your Jenkins installation sits at http://ci.jruby.org/, visiting http://ci.jruby.org/api/ will show just the top-level API features available – primarily a listing of the configured jobs for this Jenkins instance.
Or if you want to access information about a particular build, e.g. http://ci.jruby.org/job/jruby-base/lastSuccessfulBuild/, then go to http://ci.jruby.org/job/jruby-base/lastSuccessfulBuild/api/ and you’ll see the list of functionalities for that build.
Remote API can be used to do things like these:
Retrieve information from Jenkins for programmatic consumption.
trigger a new build
create/copy jobs
Jobs with parameters, Also see Parameterized Build.
if [ -n "$job_status" ] then # Run your script commands here else echo "BUILD FAILURE: Other build is unsuccessful or status could not be obtained." exit 1 fi
How to restart Jenkins manually?
To restart Jenkins manually, you can use either of the following commands:
(jenkins_url)/safeRestart – Allows all running jobs to complete. New jobs will remain in the queue to run after the restart is complete.
(jenkins_url)/restart – Forces a restart without waiting for builds to complete.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Jenkins Error: Running two Java Versions – Jenkins Problem in Mac OS Jenkins Error: /usr/bin/p4 error in windows machine with jenkins Jenkins Error: Jenkins time-out while pushing to github Jenkins Error: Jenkins Workspace Issue Jenkins Error: java.io.IOException: Failed to rename jenkins Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have…
pasupuleti2 created the topic: Suddenly started hanging Suddenly jenkins started hanging. that keeps hanging every second. We have many projects in Jenkins. The jobs were running fine in the past. Yesterday I installed Perl plugins in jenkins and suddenly it started hanging. Nothing is dispalying. Please help me to resolve this issue without loosing old…
Postman is a little program, or a Chrome extension to be precise, which allows you to access RESTful APIs in a very convenient way, with a graphical user interface and an easy way to send data and see response data. How to download Postman? 1. First of all go to https://www.postman.com/downloads/ Now it will show…
scmuser created the topic: Questions on Hudson Hi, I have setup Hudson successfully and covered all most all the features. But Still i have some question which want to get clarify with the help of community members. 1. Each Project Build Number in Hudson and build artifact folder naming are different. How can we match…
rajeshkumar created the topic: Hudson plugin development in Eclipse I’m following the instructions to create a plugin workspace located at: wiki.hudson-ci.org/display/HUDSON/Plugin+tutorial however, when I run the setup (mvn hpi:run), the plugin doesn’t show up as a configuration option in the Hudson Management console. It does show up as an installed plugin in the Plugin Manager….