简体   繁体   中英

Azure DevOps REST API call retrieving only top 100 records

I am using the below API call for retrieving all the CouldTests, but it is returning only 100 records. How can retrieve all the records?.

$uri = https://{instance}/{collection}/{project}/_apis/test/runs?minLastUpdatedDate=2020-01-28&maxLastUpdatedDate=2020-01-29&releaseIds=123456&$top=2000 $TestRuns = Invoke-RestMethod -Uri $uri
-Headers $headers

Any help is appreciated. Thanks in advance

For more about the above Link please refer.: https://docs.microsoft.com/en-us/rest/api/azure/devops/test/runs/query?view=azure-devops-server-rest-5.0

See the continuationToken portion of that doc link that you reference. Basically, if the response contains a continuationToken, then you have to call the API again and pass in that continuationToken, repeating until there is no more continuationToken in the response.

This is common across most Azure APIs, although sometimes the naming is different such as nextLink.

使用 Invoke-WebRequest 而不是 Invoke-RestMethod 并且它正在工作。

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