Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Groups/{Group name}/AddAgents API allows you to assign Agents to an existing Build Group. You can assign one or multiple Agents simultaneously to a specific Build Group.

You cannot perform the Agent Assignment action in the following cases:

  • The Agent is currently participating in a build execution.

  • The Agent is offline.

 Request Syntax

The Groups/{Group name}/AddAgents API request should contain the Build Group name, and the name and IP address of the Agent you want to assign to it. It is possible to assign multiple Agents to the same Build Group in one request.

Code Block
POST https:// {Coordinator IP Address/Hostname}:{Web Access Port}/Groups/{Group name}/AddAgents

[

    {

        "Name":"{Agent name}",

        "IP":"{Agent IP address}

    }

]   

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

Code Block
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:

Code Block
[

    {

        "WIN10-1": "OK"

    },

    {

        "WIN10-2": "OK"

    },

    {

        "WIN10-3": "OK"

    }

] 

Errors

The Assign Agent request will fail in the following cases:

  • 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:

Code Block
[

    {

        "WIN10-2": "Agent is offline"

    },

    {

        "WIN10-4": "Agent does not exist"

    }

] 

...