使用REST API获取Azure ADO中管道的所有状态

发布于 2025-02-04 18:07:39 字数 514 浏览 4 评论 0原文

我正在尝试使用REST API在Azure ADO中获取管道状态。

我尝试使用 https://learn.microsoft.com/en-us/rest/rest/api/azure/devops/devops/build/build/status/get?view= azure-devops-rest-6.0

但是仅给出最后完成的工作的状态。

我希望获得管道所有运行的状态。您能否指导我并帮助相关的API。“

I am trying to fetch the status of pipeline in Azure ADO using rest API.

I tried using GET status API using https://learn.microsoft.com/en-us/rest/api/azure/devops/build/status/get?view=azure-devops-rest-6.0

But it gives only the status of the last completed job.

I am looking to fetch status of all the runs of the pipeline. Could you please guide me and help with the relevant API.enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以心动 2025-02-11 18:07:39

Get status API only shows the latest run status of this pipeline.

As a work around, you could use Get Runs List API: https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/list?view=azure-devops-rest-6.0

GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1

And check the result value from the response body.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文