Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to "delay" a job via the REST API

Tags:

jenkins

The instant messaging plugin is capable of taking an IM message like, "build XYZ in 10s" and setting the job to run in 10 seconds. It does this via a java API to schedule the job[0].

I'd like to know if there is some magic parameter I can pass on the REST API[1] that will allow me to "delay" a job in the same manner?

thanks.

[0] - https://github.com/jenkinsci/instant-messaging-plugin/blob/master/src/main/java/hudson/plugins/im/bot/BuildCommand.java#L54

[1] - https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

like image 492
dan Avatar asked May 15 '13 17:05

dan


1 Answers

GET the following URL:

http://jenkins/job/jobname/build?delay=4000sec

This example will result in a job being started after 4000 seconds.

Screenshot of build queue

This works with the buildWithParameters URL for parameterized jobs as well.

like image 75
Daniel Beck Avatar answered Oct 28 '22 11:10

Daniel Beck