Reputation: 137
I am calling the jobrequest
endpoint of the pools resource. Adding the querystring completedRequestCount
returns a pattern I cannot figure out. (This api is undocumented).
https://dev.azure.com/{orgname}/_apis/distributedtask/pools/{poolId}/jobrequests/?completedRequestCount={int}
{int}
is 0, then all running/unassigned jobs are returned{int}
is 1, then a number of results are returned. One pool returned two, another returned nine.{int}
is 2, then double the results of {int}
=1 is returned. One pool returned four, another returned eighteen{int}
is 3, then three times the results of {int}
=1 is returnedThe returned jobs don't seem to be in a strict chronological order. The returned jobs are normally jobs that have been run recently.
What is the query string completedRequestCount
returning and how does the changing of {int}
affect it?
Upvotes: 1
Views: 370
Reputation: 137
Following from Hugh Lin's answer, I discovered that https://dev.azure.com/{org}/_apis/distributedtask/pools/{poolId}/jobrequests?completedRequestCount=1
returns the last completed job for each agent in the pool and are grouped by agent in chronological order.
The pool where I received 9 results when ?completedRequestCount=1
contained 9 agents, the pool where I received 2 results only had 2 agents.
When completedRequestCount=2
then the last two completed jobs are returned for each agent.
Upvotes: 2
Reputation: 19361
I tried to add agentId
parameter in the request url ,the returned count shows normal, completedRequestCount
parameter is used to specify the count of latest job requests returned. You can refer to this case.
https://dev.azure.com/{org}/_apis/distributedtask/pools/{poolId}/jobrequests?agentId={agentId}&completedRequestCount={int}
Below is my test in postman :
Upvotes: 3