Assigning Agents to a Build Group

The Groups/{Group name}/AddAgents API allows you to assign one or more Agents to an existing Build Group.

You cannot perform the Agent Assignment action if:

  • The Agent is currently participating in a build execution.

  • The Agent is offline.

 Request Syntax

Copy
POST https:// {Coordinator IP Address/Hostname}:{Web Access Port}/Groups/{Group name}/AddAgents
[
    {
        "Name":"{Agent name}",

        "IP":"{Agent IP address}
    }

Where:

In the following example, a request is sent to assign three Agents to the QA Build Group: 

Copy
POST https://win10-1:31100/Groups/QA/AddAgents
[
    {
        "Name":"WIN10-1",

        "IP":"192.100.00.001"
    },

    {
        "Name":"WIN10-2",

        "IP":"192.100.00.002"
    },

    {    
        "Name":"WIN10-3",

        "IP":"192.100.00.003"
    }
]

Response Syntax

When an Agent is successfully assigned to the specified Build Group, the result is: "{Agent name}": "OK".

For example:

Copy
[
    {
        "WIN10-1": "OK"
    },

    {
        "WIN10-2": "OK"
    },

    {
        "WIN10-3": "OK"
    }
]

Errors

The request fails if:

  • The Agent is currently participating in a build execution.

  • The Agent does not exist.

  • The Agent is offline.

  • The Build Group does not exist.

In the following example, one Agent is currently offline, while another Agent does not exist:

Copy
[
    {
        "WIN10-2": "Agent is offline"
    },

    {
        "WIN10-4": "Agent does not exist"
    }
]