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 2020 (or later) | LWSSO_COOKIE_KEY={LwssoCookie}; |
Versions earlier than 2020 | LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie}; |
Request Body:
GET: No request body.
DELETE: No request body.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
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:
GET: Returns the data on the entity in the response. The fields in the response are:
Element | Description |
---|---|
LabHost | The top-level element. |
Name | The host name. |
Installation | The installation type:
|
HostPurposes | Can contain HostPurpose sub elements with any combination of the following:
|
Status | The status can be:
|
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:
|
Enable IPv6 | One of:
|
ID | The host ID. |
DELETE: No body returned.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
<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