【问题标题】:Azure Devops API - how to filter/search by project name?Azure Devops API - 如何按项目名称过滤/搜索?
【发布时间】:2021-12-18 13:11:33
【问题描述】:

我正在使用 GET project List API,我想通过搜索查询参数过滤掉结果。

我在某个组织下有多个项目,我只想取回以“名称”首字母开头的项目。我到处查看文档,但找不到任何方法进行这样的查询。有没有办法缩小结果范围?

我看到一些 API 有 ?$filter={filter} 查询参数,但它不适用于项目过滤。

【问题讨论】:

    标签: azure-devops azure-devops-rest-api


    【解决方案1】:

    正如您所说,在此 API 中不可能在您获得结果之前过滤结果。

    您只能在使用 Bash/Powershell 等获得结果后过滤项目。

    【讨论】:

      【解决方案2】:

      我遇到了类似的问题,除了我试图根据 Azure Devops 的 Repo 列表进行过滤。
      似乎 M$ ​​在提供一致的过滤器功能方面做得很糟糕。
      我确实注意到某些 API 确实提供了 ?$filter={filter},我发现 documentation here 可能会有所帮助? 某些 API 以搜索条件/commits?searchCriteria.$skip={searchCriteria.$skip}&searchCriteria.$top={searchCriteria.$top}...
      https://docs.microsoft.com/en-us/rest/api/azure/devops/git/commits/get-commits?view=azure-devops-rest-6.0

      的形式提供了不同的搜索方法

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-19
        • 2020-05-05
        • 1970-01-01
        • 2022-11-17
        • 1970-01-01
        • 2016-05-24
        相关资源
        最近更新 更多