如何通过 API 获取正在运行的 jenkins 作业的进度条数据 [英] how to get progress bar data for a running jenkins job through the API

查看:164
本文介绍了如何通过 API 获取正在运行的 jenkins 作业的进度条数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 jenkins API 来获取有关我当前工作的信息.我可以找到有关上次构建的信息 (.../job/MyJob/lastBuild/api/xml),但我没有看到可以让我创建进度条的字段.我看到一个 estimatedDuration 字段和一个 building 字段,但没有任何东西告诉我它已经运行了多长时间.

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.

推荐答案

这是提供我所需信息的 URL:

Here's the URL that gives me the information I need:

http://<host>/job/<jobname>/lastBuild/api/xml?tree=timestamp,estimatedDuration

产生如下结果:

<freeStyleBuild>
  <estimatedDuration>86126</estimatedDuration>
  <timestamp>1350615637401</timestamp>
</freeStyleBuild>

这篇关于如何通过 API 获取正在运行的 jenkins 作业的进度条数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆