如何取消詹金斯构建队列中的作业,这是不詹金斯​​通过REST API开始,并在其构建的队列

问题描述:

如何取消建造队列的作业通过REST API詹金斯,这是不詹金斯​​开始,在其构建的队列。我知道如何与下面的命令 - 卷曲-X POST /作业取消正在进行的工作/// doDelete

how to cancel build queue jobs in jenkins through REST API, which are not started by jenkins and are in its build queue. I know how to cancel the in-progress job with below command- curl -X POST /job///doDelete

要在队列中取消作业,可供您参考:

To cancel a job in the queue, you can POST:

http://jenkins/queue/cancelItem?id=x

要找到X,你可以分析的结果:

To find x, you can parse the result of:

http://jenkins/queue/api/json?tree=items[id,task[name]]

要取消构建正在进行中:

To cancel a build that is in progress:

http://jenkins/job/<jobName>/y/stop

要找到Y,你可以分析的结果:

To find y, you can parse the result of:

http://jenkins/job/<jobName>/lastBuild/api/json?tree=building,number