Get or delete a host by ID
Description
Gets or deletes a host by the specified hostID.
- To get host information, an HTTP request should be sent to the URL returned in the Location header of the response of the Host entity creation (see Add a host ) or the URL can be composed by concatenating the returned Host ID to the URL that was used for the Host creation. For existing hosts in LAB_MANAGEMENT project, you can concatenate the value in the “Host ID” field to the URL that was used for the Host creation.
- To delete a host, an HTTP request should be sent to the URL below. Note that only private hosts can be deleted (hosts that were added from the REST API or from the LRE Application).
URL
/LoadTest/rest/domains/{domainName}/projects/{projectName}/hosts/{hostID}
HTTP method
GET: Returns the host information.
DELETE: Deletes the host.
Request
Headers:
One of the following:
Content-Type: application/xml
Content-Type: application/json
Cookies:
Version | Cookie |
---|---|
2020 or later | LWSSO_COOKIE_KEY={LwssoCookie}; |
Earlier than 2020 | LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie}; |
Request body:
GET: No request body.
DELETE: No request body.
Request examples:
GET http://<LRE_Server>/LoadTest/rest/domains/{domainName}/projects/{projectName}/hosts/{hostID}
Content-Type: application/xml
Cookie: LWSSO_COOKIE_KEY={LwssoCookie};
GET http://<LRE_Server>/LoadTest/rest/domains/{domainName}/projects/{projectName}/hosts/{hostID}
Content-Type: application/json
Cookie: LWSSO_COOKIE_KEY={LwssoCookie};
Response
Headers:
One of:
Accept: application/xml
Accept: application/json
Cookies:
None
HTML return code:
One of the HTTP return codes
Upon successful deletion, returns HTTP status 200 (OK).
HTML body:
DELETE: No body returned.
GET: Returns the data on the entity in the response.
The response contains the following fields.
Element Description LabHost The top-level element.
Name The host name.
Installation The installation type:
- Unix
- WindowsHost
WindowsStandaloneLG
HostPurposes Can contain HostPurpose sub elements with any combination of the following:
- Controller
- LoadGenerator
DataProcessor
Status
The status can be:
- Operational
- NonOperational
- Unavailable
Location (Optional) A valid location name defined in LAB_PPROJECT. If not provided, the default location is used.
MIListener Optional when the location is not defined as over a firewall (OFW).
When the location is an OFW location, the value should be the name of a valid MIListener that is defined in LAB_PPROJECT.
Attributes Can contain Attribute sub elements in order to set Host properties values.
Attribute Attribute value should contain Host Properties values as defined in LAB_PROJECT under Project Customization > Project Lists > Host Properties.
You can specify multiple Attribute elements using either the default host attributes (as in the example below) or any custom attribute defined by the user.
Priority A numeric value between 1 and 9. SslEnabled One of:
- true
- false
Enable IPv6 One of:
- true
- false
ID The host ID.
Response examples:
<LabHost>
<Name>[test]Test_Host2</Name>
<Installation>OneLG</Installation>
<HostPurposes>
<HostPurpose>LoadGenerator</HostPurpose>
</HostPurposes>
<Status>Operational</Status>
<Location>Default</Location>
<MIListener>None</MIListener>
<Attributes>
<Attribute>Host memory:High</Attribute>
</Attributes>
<Priority>7</Priority>
<SslEnabled>false</SslEnabled>
<IPv6Enabled>false</IPv6Enabled>
<Description>created by automation</Description>
<Source>Local</Source>
<Pools>
<PoolID>1000</PoolID>
</Pools>
<IsPrivateHost>false</IsPrivateHost>
<ID>1832</ID>
<CloudAccount />
</LabHost>
{
"IsPrivateHost": false,
"ID": 1832,
"HostPurposes": [
1
],
"Status": 0,
"CloudAccount": "",
"Description": "created by automation",
"Source": "Local",
"Pools": [
1000
],
"Name": "[test]Test_Host2",
"Installation": 1,
"Location": "Default",
"MIListener": "None",
"Attributes": [
"Host memory:High"
],
"Priority": 7,
"SslEnabled": false,
"Ipv6Enabled": false,
"Domain": null,
"UserName": null
}
See also: