How to get all jobs in Agent pools

Rajendar Talatam 1 Reputation point
2022-01-28T15:31:56.87+00:00

what is the API call which all jobs in each pools .
I know the API for listing all agent pool , I need API get All jobs which are aatched to that agent pool
please advice

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,113 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 12,946 Reputation points
    2022-01-28T22:15:25.247+00:00

    Hello @Rajendar Talatam - Thanks for reaching out.

    You can use the REST API GET

    https://dev.azure.com/{organiztion}/_apis/distributedtask/pools/{poolId}/jobrequests?api-version=6.0

    directly, e.g. via CURL, PowerShell.

    1. CURL sample:

    curl -u :<PAT> https://dev.azure.com/{organiztion}/_apis/distributedtask/pools/{poolId}/jobrequests?api-version=6.0

    1. Powershell Sample:

    az pipelines pool list [--action {manage, none, use}]
    [--detect {false, true}]
    [--org]
    [--pool-name]
    [--pool-type {automation, deployment}]
    [--query-examples]
    [--subscription]

    Reference - use-personal-access-tokens-to-authenticate

    Hope that helps.

    ------------------------------------------------------------------

    If the above response was helpful, please feel free to "Accept as Answer" so it can be beneficial to the community.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.