Share this page

# 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 MyPC).

## URL

Copy code

    /LoadTest/rest/domains/{domainName}/projects/{projectName}/hosts/{hostID}

## Remarks

The host data can be passed as XML containing the equivalent data.

## HTTP Method

GET: Returns the host information.

DELETE: Deletes the host.

## Request

Headers:

Content-Type: application/xml

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.

An XML describing the host.

Request Example
Copy code

    GET http://<LRE_Server>/LoadTest/rest/domains/{domainName}/projects/{projectName}/hosts/{hostID}
    Content-Type: application/xml
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

## Response

Headers:

Content-Type: application/xml

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. See hosts XML

DELETE: No body returned.

## See Also

Add a host

Tips to improve your search results... LoadRunner Enterprise REST API Reference LRE REST API All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic(Undefined variable: _rscC_Basic_Variables.VersionLabel)