使用 API 批准 Azure 管道

发布于 2025-01-09 08:48:51 字数 164 浏览 3 评论 0 原文

我正在开发一个天蓝色的 DevOps 管道。我有一个批准阶段,该阶段会停止管道,直到有人批准运行,以便管道恢复。

有没有办法通过 REST API 调用批准运行?或者是否有一种方法可以在未经批准的情况下使用 REST API 调用来停止和恢复管道?

(PS。它是一个 yaml 管道)

I'm working on an azure DevOps pipeline. I have an approval stage which stops the pipeline until someone approves the run so the pipeline resumes.

Is there a way, to approve the run with a REST API call? Or is there maybe a way to stop and resume a pipeline using a REST API call without an approval?

(PS. Its a yaml pipeline)

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

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

发布评论

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

评论(1

习惯那些不曾习惯的习惯 2025-01-16 08:48:51

您可以使用 批准休息 API

首先,使用 批准 - 查询并找到您的批准 ID。

其次,使用 批准 - 更新,在正文中使用您从上一步获得的 approvalId

[
  {
    "approvalId": "approvalId from the Approvals - Query step",
    "comment": "Approving",
    "status": "approved"
  }
]

You can use the Approvals Rest API.

First, get the approvals list with Approvals - Query and find your approval id.

Second, approve it with Approvals - Update, in the body use the approvalId you got from the previous step:

[
  {
    "approvalId": "approvalId from the Approvals - Query step",
    "comment": "Approving",
    "status": "approved"
  }
]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文