TFS 2015 Rest Api - 忽略查询参数并且不过滤构建?

TFS 2015 Rest Api - query parameters ignored and not filtering builds?

TFS 2015 update 3 的 REST api 中是否存在错误,在查询构建时它实际上并没有过滤?

例如我 运行 以下查询并获得 1000 个结果 http://myservername:8080/tfs/DefaultCollection/myproject/_apis/build/builds

我运行以下得到相同的结果 http://myservername:8080/tfs/DefaultCollection/myproject/_apis/build/builds?definitionId=thisdefinitiondoesnotexist

同样使用 top 仍然有 returns 1000 个结果 http://myservername:8080/tfs/DefaultCollection/myproject/_apis/build/builds?top=5

等等等等

似乎 none 个过滤器正在应用 - 这是为什么?

您需要运行查询完全遵循 REST API 的语法。否则它会自动忽略有效参数后面的无效参数,只运行有效部分。

获取构建列表:

GET https://{instance}/DefaultCollection/{project}/_apis/build/builds?api-version={version}[&definitions={string}][&queues={string}][&buildNumber={string}][&type={string}][&minFinishTime={DateTime}][&maxFinishTime={DateTime}][&requestedFor={string}][&reasonFilter={string}][&statusFilter={string}][&tagFilters={string}][&propertyFilters={string}][&$top={int}][&continuationToken={string}]

第二个查询应该是:(它是“definitions=”但不是 definitionId=)

GET http://myservername:8080/tfs/DefaultCollection/myproject/_apis/build/builds?definitions= {specify definition ID eg: 25,26,27}
它会响应"count": 0,如果指定的定义id不存在。

第三个查询应该是:(在"top"之前添加$

GET http://myservername:8080/tfs/DefaultCollection/myproject/_apis/build/builds?$top=5

请参阅 https://www.visualstudio.com/en-us/docs/integrate/api/build/builds 以了解如何使用构建 REST API。