有没有一种方法可以“延迟"响应.通过REST API进行的工作 [英] Is there a way to "delay" a job via the REST API
问题描述
即时消息插件可以接收IM消息,例如在10秒钟内构建XYZ",并将作业设置为在10秒内运行.它通过Java API来计划作业[0].
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].
我想知道是否可以通过REST API [1]传递一些魔术参数,使我能够以相同的方式延迟"工作?
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?
谢谢.
[0]- [1]- https://wiki.jenkins-ci. org/display/JENKINS/Remote + access + API
推荐答案
获取以下URL:
http://jenkins/job/jobname/build?delay=4000sec
此示例将导致作业在4000秒后开始.
This example will result in a job being started after 4000 seconds.
这对于参数化作业也适用于buildWithParameters
URL.
This works with the buildWithParameters
URL for parameterized jobs as well.
这篇关于有没有一种方法可以“延迟"响应.通过REST API进行的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!