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
3 comments
Comment actions Permalink

Also I have found the following in the Audit history -

15 Jul 15 00:21 xxxx Agent <Object was deleted> was moved to agent pool zAdhoc - Waiting For Setup
14 Jul 15 23:42 xxxx Agent <Object was deleted> was moved to agent pool zAdhoc - Waiting For Setup
14 Jul 15 23:36 xxxx Agent <Object was deleted> was moved to agent pool zAdhoc - Waiting For Setup
14 Jul 15 23:32 xxxx Agent <Object was deleted> was moved to agent pool zAdhoc - Waiting For Setup
14 Jul 15 23:29 xxxx Agent <Object was deleted> was moved to agent pool zAdhoc - Waiting For Setup


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)

0
Comment actions Permalink

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.

0
Comment actions Permalink

Thanks Alina. I will upgrade to TeamCity 9.1 asap.

0

Please sign in to leave a comment.