如何通过DevOps REST API获取特定提交的构建列表 [英] How to get build list for particular Commit through DevOps REST API
问题描述
我需要通过Azure DevOps REST API检索与特定Commit相关联的生成列表(请参见TFS UI图片).我可以使用蛮力来做到这一点:
- 通过 解决方案
有API call. Cannot find here a filter for commit:
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds
- Then filter-out only builds with specified
"commitId": "eed1b008520c2b32669bef9a0a08be8a50b6e8a4"
But this is extremely inefficient solution. Can you help me if there is a more efficient way? I tried to load details for Commit with links, but there is no link to build or builds.
There is Statuses API for Commit. It seems that when starting and ending build, the appropriate status is posted.
So when I call
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/statuses?api-version=5.1
I get all last builds associated with the Commit and their statuses.
Thanks to Hugh Lin for showing me direction..
这篇关于如何通过DevOps REST API获取特定提交的构建列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!