TeamCity - 如何通过 REST API 获取当前正在运行的构建? [英] TeamCity - how to get currently running builds via REST API?

查看:67
本文介绍了TeamCity - 如何通过 REST API 获取当前正在运行的构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何使用 TeamCity REST API 找出当前正在运行的构建版本,以及它们的运行时间(已用时间与估计时间)?

Does anyone know how to use the TeamCity REST API to find out which builds are currently running, and how far through they are (elapsed time vs estimated time)?

塔马特

推荐答案

URL 返回您要求的内容,包括完成百分比.http://teamcityserver/httpAuth/app/rest/builds?locator=running:true

The URL returns what you are asking for, including percentage complete. http://teamcityserver/httpAuth/app/rest/builds?locator=running:true

<builds count="1">
    <build id="10" number="8" running="true" percentageComplete="24" status="SUCCESS" buildTypeId="bt3" startDate="20110714T210916+1200" href="/httpAuth/app/rest/builds/id:10" webUrl="http://phillipn02:29000/viewLog.html?buildId=10&buildTypeId=bt3"/>
</builds>

来源:http://devnet.jetbrains.net/message/5291132#5291132.REST API 文档 上的相关行是http://teamcity:8111/httpAuth/app/rest/builds/?locator= - 通过构建定位器"获取构建.在使用"部分.

Source: http://devnet.jetbrains.net/message/5291132#5291132. The relevant line on the REST API documentation is the one that reads "http://teamcity:8111/httpAuth/app/rest/builds/?locator= - to get builds by "build locator"." in the "Usage" section.

这适用于 TeamCity 6.5 版;我还没有在早期版本上尝试过,但我怀疑它会恢复到版本 5.

This works with TeamCity version 6.5; I haven't tried it on earlier versions, but I suspect it will work back to version 5.

这篇关于TeamCity - 如何通过 REST API 获取当前正在运行的构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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