Reputation: 81
Is there a way (via powershell, Azure DevOps' REST api, or via the UI) to pull a list of builds/releases run in the past X time on a specific Agent Pool? I haven't found any documentation to indicate a method yet.
Upvotes: 1
Views: 2014
Reputation: 76670
Get a list of builds/releases for an agent pool?
There is no such out-of-the-box API at this moment, because the agent REST API is undocumented, see REST API Overview for Visual Studio Team Services and Team Foundation Server for more information.
However you could use tools such as Fiddler to track the the API, following below steps to get list of builds/releases for an agent pool with REST API:
Get Pool ID:
GET https://dev.azure.com/<YouOrganizationName>/_apis/distributedtask/pools/
Get Agent ID based on the pool ID:
GET https://dev.azure.com/<YouOrganizationName>/_apis/distributedtask/pools/5/agents/
Get the job requests the specific Build Agent:
GET https://dev.azure.com/<YouOrganizationName>/_apis/distributedtask/pools/5/jobrequests?agentId=4
Now, we could use scripts to list the those builds/releases info, like, "requestId", "result" and so on.
The helped ticket: Retrieving a list of agent requests from TFS REST API
Note:
These are undocumented so you should be vigilant while upgrading your TFS if you are taking dependencies on these.
Hope this helps.
Upvotes: 5