运行“PUT”在 Azure DevOps 上使用 Rest-Api 进行请求

发布于 2025-01-17 06:02:04 字数 463 浏览 3 评论 0原文

我正在尝试使用 Postman 运行 PUT 请求,以更改 Azure DevOps 中特定生成定义的保留规则,并更改 daysToKeep 值。

输入图片此处描述

但我不断收到错误: “请求指定管道 ID 1722,但提供的管道 ID 为 0。”

知道我哪里出错了吗?

在此处输入图像描述

I'm trying to run a PUT request using Postman to change the retention rules of a specific build definition, in Azure DevOps, and change the daysToKeep value.

enter image description here

But I keep getting the error:
"The request specifies pipeline ID 1722 but the supplied pipeline has ID 0."

Any idea where do I go wrong?

enter image description here

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

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

发布评论

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

评论(2

や三分注定 2025-01-24 06:02:04

为了更改/更新构建定义上的任何参数,请首先运行 GET 请求。
结果 JSON 输出应用作 PUT 请求的正文。
使用此主体并更改\更新您需要的相关参数...
增加位于 1 中 JSON 输出根目录中的“revision”参数非常重要(例如,如果当前为 97,则下次运行时应为 98)。

特别感谢 Tinxuanna 指导我找到这个解决方案!

In order to change\update any parameter on the build definition, first run a GET request.
The result JSON output should be used as the body for the PUT request.
Use this body and change\update the relevant parameter(s) you need...
It is very important to increase the "revision" parameter, located in the root of the JSON output, in 1. (for example, if current is 97, for next run it should be 98).

Special thanks to Tinxuanna for directing me to this solution!

段念尘 2025-01-24 06:02:04

@ShaiO 请查看此链接 列出 Azure DevOps 管道。它可能会帮助您,因为它获取管道列表。

然后您可以按照文档创建管道。

@ShaiO Please take a look at this link List pipelines Azure DevOps. It may help you because it gets a list of the pipelines.

Then you can create a pipeline following the documentation.

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