简体   繁体   English

Azure Devops API,如何判断代理是否正在运行构建?

[英]Azure Devops API, How can I tell if an agent is running a build?

This api https://me.visualstudio.com/_apis/distributedtask/pools/12/agents/123 give me information like "enabled": true, and "status": "online", but does not indicate if this machine is running a build or Idle.这个 api https://me.visualstudio.com/_apis/distributedtask/pools/12/agents/123给我信息像“启用”:真,和“状态”:“在线”,但不表明这台机器是运行构建或空闲。

I can see that info on page https://me.visualstudio.com/_settings/agentpools?poolId=102&view=agents under Current Status.我可以在当前状态下的页面https://me.visualstudio.com/_settings/agentpools?poolId=102&view=agents上看到该信息。 Is there an API that gives me Current Status?是否有提供当前状态的 API?

You can add the querystring includeAssignedRequest=true to get any jobs currently assigned the specific agent.您可以添加查询字符串includeAssignedRequest=true以获取当前分配给特定代理的任何作业。 If the agent is currently running a job, the response contains an assignedRequest object如果代理当前正在运行作业,则响应包含一个assignedRequest对象

https://me.visualstudio.com/_apis/distributedtask/pools/12/agents/123?includeAssignedRequest=true

See includeAssignedRequest请参阅包含分配的请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM