Add a host

Description

Adds a host or returns a list of hosts.

URL

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

Remarks

The host data can be passed as XML or JSON 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:

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.

POST: An XML or JSON describing the host. The fields in the request and response are:

ElementDescription
LabHostThe top-level element.
NameThe host name.
InstallationThe installation type:
  • Unix
  • WindowsHost
  • WindowsStandaloneLG

HostPurposesCan contain HostPurpose sub elements with any combination of the following:
  • Controller
  • LoadGenerator
  • DataProcessor

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

PriorityA numeric value between 1 and 9.
SslEnabled

One of:

  • true
  • false

Enable IPv6

(Available in versions: 24.3 and later)

One of:

  • true
  • false
IDThe host ID.

Response

Headers:

One of:

  • Accept: application/xml

  • Accept: application/json

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes

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

HTML Body:

The data on the entity in the response.

See Also

Get or delete a host by ID
Get Hosts List by Query