TeamCity REST API Reference 2024.07 Help

Manage Agent Pools

This article lists REST API requests concerning agent pools.

Get Agent Pools

To get a list of all agent pools, use:

/app/rest/agentPools

The request responds with an AgentPools entity which contains instances of an AgentPool entity. The request accepts locator parameter which should be typed as AgentPoolLocator.

For example, to get a pool named MyPool, use:

/app/rest/agentPools/name:MyPool

Create Agent Pool

To create an empty pool, POST an empty AgentPool entity to:

/app/rest/agentPools

Example payload:

<agentPool name="string"/>
{ "name" : "name" }

Update Agent Pool

To update an existing pool, PUT an updated AgentPool to this endpoint:

/app/rest/agentPools/<agentPoolLocator>

Delete Agent Pool

To delete an agent pool, send DELETE to this endpoint:

/app/rest/agentPools/<agentPoolLocator>

Manage Agents Within Agent Pool

To move agent to a given pool, POST an Agent entity to this endpoint:

/app/rest/agentPools/<agentPoolLocator>/agents

Example payload (this will move the agent with the ID 1 to the given pool):

<agent id="1"/>
{ "id" : "1" }

Manage Projects Associated with Pool

To associate a project with a given pool, POST a Project entity to the below endpoint:

/app/rest/agentPools/<agentPoolLocator>/projects

Example payload (this will move project with the ID MyProject to the given pool):

<project id="MyProject"/>
{ "id" : "MyProject" }

To remove a project from a pool, use:

DELETE /app/rest/agentPools/<agentPoolLocator>/projects/<projectLocator>

projectLocator is typed as ProjectLocator.

Last modified: 29 March 2022