[英]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.