Assign Agent to a different Pool via OpenAPI Plugin

Hello JB/TC -

I am interested in the ability to reassign agents to new pools via custom plugin.


I've searched through TeamCity OpenAPI documentation for means to assign an agent to a new pool when a job is complete, but have not been able to find suitable interfaces to access TeamCity's Agent Pool services. 


I have the ability to 'disable' an agent through OpenAPI using the snippet below, but I am unable to update the agent's pool.

override fun buildStarted(sRunningBuild: SRunningBuild) {
sRunningBuild.agent.setEnabled(false, null, "Build Flow Disabled")


Any assistance if possible would be greatly appreciated.




Please sign in to leave a comment.