Updates host information.
You can change test host information in Test Management > Test Hosts. For example, you can change a host’s Active status, software configuration, the list of installed test runners and other information.
Authentication
Basic authentication using the host ID and security token. See Authentication for details.
Request Format
To update test host information, send a PATCH request to the URL ending with the integer host ID:
Use the request body in the following format, but include only those properties you want to change. The other properties will remain unchanged.
"host_name": "computer name",
"host_configuration": "hardware and/or software configuration",
"agents": [
"TestComplete/TestExecute",
"JUnit (Selenium)",
"NUnit (Selenium)",
"TestNG (Selenium)",
"ReadyAPI / SoapUI OS"
],
"os": "operating system",
"is_active": boolean,
"agent_version": "Test Agent binary version"
}
host_name : string
The new computer name.
host_configuration : string
Hardware or software information. Use any format you like, for example, a comma-separated list or key=value pairs separated by new line characters.
agents : array of strings
A JSON array of the names of test agents installed on the host.
Currently, REST API supports the following agents:
- TestComplete/TestExecute
- ReadyAPI / SoapUI OS
- JUnit (Selenium)
- TestNG (Selenium)
- NUnit (Selenium)
os : string
The operating system name and version.
is_active : boolean
true
means that the user can schedule automated tests on this host. false
means that the test host is inactive and cannot be used for test runs.
agent_version : string
The version of the Test Agent executable, in the x.xx.xxxx
format.
A sample request to change the host status from inactive to active:
PATCH http://yourserver.com/rest-api/service/automation/v2/hosts/143 HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 23
{
"is_active": true
}
The same request made by using cURL:
curl -u &id-token; -X PATCH -d {"is_active": false} -H "Content-Type: application/json" http://yourserver.com/rest-api/service/automation/v2/hosts/143
Response Format
On success, the operation responds with HTTP status code 200 and returns a JSON object with the updated host information.
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 353
{
"id": 143,
"host_name": "RACK11-W7X64",
"host_configuration": "x64, net45, firefox, chrome, flash",
"agents": [
"TestComplete/TestExecute",
"JUnit (Selenium)",
"NUnit (Selenium)",
"TestNG (Selenium)",
"ReadyAPI / SoapUI OS"
],
"os": "Windows 7 Ultimate 64-bit SP1",
"is_active": true,
"security_token": "d2e1ffd1-3c74-4ccf-738b-10997283e35f",
"agent_version": "2.10.1607"
}