简体   繁体   中英

Azure Devops api get retained builds

I want to use Azure Devops rest apis to get all retained builds of a specific build definition.

Reading Azure Devops documentation I tried this api:

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

With this I get all build of my build definition '1'.

Each build has the 'keepForever' property. If this has value 'true', that is a retained build.

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.

Is there a way to made the http request to get retained builds only?

Can I avoid to read much data I don't want?

You can find a list of parameters here: Builds - List - URI Parameters . There is no keepForever in that list and no any additional filter options for this parameter. As workaround, you may try to set some tag for retained builds and then use tagFilters parameter. But that maybe more complex way than filter keepForever property with your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM