rest api example to get all enabled compatible agents for a given build type id

Is there a REST API to get all enabled compatible agents for a given build type id  ?

The reason I ask this is because I want to custom run a build on all enabled compatible agents  .

The must-have requirements are that it do a clean sources .

I was investigating  REST API  app/rest/buildQueue  to submit custom build that clean sources , by http POST some xml such as

<build>
  <triggeringOptions cleanSources='true' rebuildAllDependencies='true' queueAtTop='false'/>
  <buildType id='MY_build_ID'/>
   <agent id="1"/>
  <comment><text>a build triggered by rest API</text></comment>
</build>



But I want it for all compatible enabled agents .

1 comment
Comment actions Permalink

Hi,

To trigger a build on all enabled and compatible agents, use "allEnabledCompatible" as agent ID:
GET http://user:password@teamcity:8111/httpAuth/action.html?add2Queue=MyBuildConf&agentId=allEnabledCompatible

To get all compatible agents for queued build you need to send the following HTTP request:
GET http://user:password@teamcity:8111/httpAuth/app/rest/buildQueue/taskId:XXX/compatibleAgents

0

Please sign in to leave a comment.