Moving agents to a different pool via REST Api
Hi Guys,
According to the instructions in https://confluence.jetbrains.com/display/TCD9/REST+API#RESTAPI-Agents
I can move a build agent to a different pool via the following call -
Move an agent to the pool from the previous pool:
POST <agent id='YYY'/> to the pool's agents http://teamcity.url/app/rest/agentPools/id:XXX/agents
But I have tried doing a POST as per above instructions, but all I got was the details of the build agent I was trying to move to another pool? Nothing happened after that.
I have attached the response returned from the api call.
Have anyone come across this issue before?
Example:
curl -v -u user:password http://teamcity.url/app/rest/agentPools/id:XXX/agents --request POST --header "Content-Type:application/xml" --data "<agent id='1'/>"
Attachment(s):
apiresponse.xml
Please sign in to leave a comment.
Also I have found the following in the Audit history -
The agent is definitely there running build configurations at the moment.... but TeamCity seems to think the agent is deleted?
Are there something else I need to do to refresh / fix this?
UPDATE - I have tried using a different agent for the api call, and TeamCity have moved a different agent to the pool instead of the one I specified. Looks like the registration of agents in TeamCity is out of sync?
I am currently using TeamCity Enterprise 9.0.3 (build 32334)
Hi Gavin,
This is the bug: https://youtrack.jetbrains.com/issue/TW-40502, that was fixed in 9.1 version. Please upgrade to the latest version.
Sorry for the inconvenience.
Thanks Alina. I will upgrade to TeamCity 9.1 asap.