Open topic with navigation

# hosts

## Description

Adds a host or returns a list of hosts.

## URL

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

## Remarks

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

To add a host to LAB_PROJECT, you need to send an HTTP request to create a Host resource. The host will be added as a private host. The host is added to the pool assigned to the project used in the request URL (the part being sent in the domainName and projectName fields).

## HTTP Method

POST: Creates the host.

GET: Returns a list of hosts.

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

POST: An XML describing the host. See hosts XML.

Request Example - POST

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

    <Host xmlns="http://www.hp.com/PC/REST/API">
        <Name>testingHost</Name>
        <Installation>WindowsHost</Installation>
        <HostPurposes>
    	<HostPurpose>Controller</HostPurpose>
    	<HostPurpose>LoadGenerator</HostPurpose>
        </HostPurposes>
        <Status>Operational</Status>
        <Location>Default</Location>
        <MIListener>None</MIListener>
        <Attributes>
    	<Attribute>HostMemory:High</Attribute>
    	<Attribute>HostStrength:Medium</Attribute>
    	<Attribute>InstalledComponents:DotNetFramework</Attribute>
    	<Attribute>InstalledComponents:CitrixClient</Attribute>
    	<Attribute>InstalledComponents:JavaRuntime</Attribute>
        </Attributes>
        <Priority>5</Priority>
        <SslEnabled>false</SslEnabled>
        <ID>1048</ID>
    </Host>

## Response

Headers:

Content-Type: application/xml

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes

Upon successful deletion, returns HTTP status 201 (Created).

HTML Body:

The data on the entity in the response. See hosts XML.

The Location contains the link to the newly created entity.

## See Also

hosts/{hostID}
Get Hosts List by Query