Retrieving a list of agent requests from TFS REST API

风格不统一 提交于 2019-12-23 16:30:24

问题


TFS 2015.3, on premises.

The REST API of TFS has an undocumented portion that deals with app pools: _apis/distributedtask/pools on the server level and further down. I can drill down all the way to agent details: _apis/distributedtask/pools/111/agents/222. Now, in the Web UI there are two collections per agent: requests and capabilities. Does anyone know the REST API URLs for those? Adding either /requests or /capabilities yields a "Document not found" error.

If the TFS API is somehow self describing, I have yet to discover how. I miss WSDL...


回答1:


I opened up Chrome Network inspector and found that these are the API calls for Requests and Capabilities. These are from latest VSTS but I think the same will work for TFS 2015.3 also.

For Requests: _apis/distributedtask/pools/1/jobrequests?agentId=1&completedRequestCount=25

For Capabilities: _apis/distributedtask/pools/1/agents/1?includeCapabilities=true

Note: These are undocumented so you should be vigilant while upgrading your TFS if you are taking dependencies on these.



来源:https://stackoverflow.com/questions/40050966/retrieving-a-list-of-agent-requests-from-tfs-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!