如何让进度条数据,通过API运行詹金斯工作 [英] how to get progress bar data for a running jenkins job through the API
本文介绍了如何让进度条数据,通过API运行詹金斯工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用詹金斯API来获取有关我目前的职位信息。我能找到的最后构建信息( ... /工作/ MyJob / lastBuild / API / XML
),但我没有看到现场(S),它可以让我创建进度条。我看到一个 estimatedDuration
字段和建筑
字段,但没有告诉我它已经运行了多长时间。
解决方案
下面是给我我需要的信息的网址:
<$p$p><$c$c>http://<host>/job/<jobname>/lastBuild/api/xml?tree=timestamp,estimatedDuration其中产量是这样的:
&LT; freeStyleBuild&GT;
&LT; estimatedDuration&GT; 86126&LT; / estimatedDuration&GT;
&LT;&时间戳GT; 1350615637401&LT; /时间戳&GT;
&LT; / freeStyleBuild&GT;
I want to use the jenkins API to get information about my current jobs. I can find information on the last build (.../job/MyJob/lastBuild/api/xml
) but I'm not seeing the field(s) that would let me create a progress bar. I see an estimatedDuration
field and a building
field, but nothing that tells me how long it's already been running.
解决方案
Here's the URL that gives me the information I need:
http://<host>/job/<jobname>/lastBuild/api/xml?tree=timestamp,estimatedDuration
Which yields something like:
<freeStyleBuild>
<estimatedDuration>86126</estimatedDuration>
<timestamp>1350615637401</timestamp>
</freeStyleBuild>
这篇关于如何让进度条数据,通过API运行詹金斯工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文