简体   繁体   English

Azure Devops api 获得保留的构建

[英]Azure Devops api get retained builds

I want to use Azure Devops rest apis to get all retained builds of a specific build definition.我想使用 Azure Devops rest apis 来获取特定构建定义的所有保留构建。

Reading Azure Devops documentation I tried this api:阅读Azure Devops 文档我尝试了这个 api:

https://dev.azure.com/ {organization}/{project}/_apis/build/builds?definitions=1 https://dev.azure.com/ {organization}/{project}/_apis/build/builds?definitions=1

With this I get all build of my build definition '1'.有了这个,我得到了我的构建定义“1”的所有构建。

Each build has the 'keepForever' property.每个构建都有“keepForever”属性。 If this has value 'true', that is a retained build.如果它的值为“true”,则这是一个保留的构建。

Usually the retained builds are fewer than non retained.通常保留的构建少于非保留的构建。 I'd want to have just the retained ones.我只想保留那些。

I tried to add the 'keepForever=true' query string parameter with no luck.我试图添加 'keepForever=true' 查询字符串参数,但没有成功。

Is there a way to made the http request to get retained builds only?有没有办法让 http 请求只获得保留的构建?

Can I avoid to read much data I don't want?我可以避免读取很多我不想要的数据吗?

You can find a list of parameters here: Builds - List - URI Parameters .您可以在此处找到参数列表: 构建 - 列表 - URI 参数 There is no keepForever in that list and no any additional filter options for this parameter.该列表中没有keepForever ,也没有此参数的任何其他过滤器选项。 As workaround, you may try to set some tag for retained builds and then use tagFilters parameter.作为解决方法,您可以尝试为保留的构建设置一些标记,然后使用tagFilters参数。 But that maybe more complex way than filter keepForever property with your code.但这可能比使用您的代码过滤keepForever属性更复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Devops API:构建 - 在构建之间获取工作项 - 未经授权 - Azure Devops API: Builds - Get Work Items Between Builds - Unauthorized Azure DevOps 服务器 object Api 通过更改 id 获取构建 - Azure DevOps Server object Api get builds by change id 在 Azure DevOps 中获取两个构建之间的变化 - Get changes between two builds in Azure DevOps Azure Devops Rest API - 获取当前在代理池中排队的构建 - Azure Devops Rest API- Get builds currently queued in Agent Pool 执行 Azure DevOps API 调用构建租赁需要什么权限 - What permissions are required to perform Azure DevOps API calls for leases of builds 有没有办法通过 API 跟踪 Azure DevOps 中触发的构建? - Is there a way via API to track triggered builds in Azure DevOps? Azure DevOps 管道在构建之间获取工作项 - Azure devops pipeline get work items between builds 如何在 Azure Devops 中使用 OData 获取项目的构建 - How to get the Builds for a project using OData in Azure Devops 使用Azure DevOps REST Api,除列出所有内部版本外,如何通过内部版本号获取内部版本? - Using Azure DevOps REST Api how can I get the build by its build number, except by listing all the builds? 没有Azure DevOps管道-构建-任务 - No Azure DevOps Pipelines - Builds - Tasks
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM