Reputation: 29
Is there an Azure CLI Command which can list the agent pools and the jobs run in them ?
Upvotes: 1
Views: 1990
Reputation: 42043
To list the agent pools, you could use az pipelines pool list
.
az pipelines pool list [--action {manage, none, use}]
[--detect {false, true}]
[--org]
[--pool-name]
[--pool-type {automation, deployment}]
[--query-examples]
[--subscription]
To list the jobs run in them, there is no built-in CLI command, the workaround is to call the REST API GET https://dev.azure.com/{organiztion}/_apis/distributedtask/pools/{poolId}/jobrequests?api-version=6.0
directly, e.g. via CURL, Powershell.
CURL sample:
curl -u :<PAT> https://dev.azure.com/{organiztion}/_apis/distributedtask/pools/{poolId}/jobrequests?api-version=6.0
Upvotes: 3