Open topic with navigation

# Get Hosts List by Query

## Description

Returns a list of hosts by query (filter).

## URL

    /Admin/rest/v1/hosts?query={<QUERY_NAME>["<YOUR_QUERY_VALUE>"]}

## Hosts Query Values

QUERY_NAME options

-     Name

-     ID

-     Installation

- `HostPurposes` (see note below)

-     Status

-     Attributes

-     Priority

-     SslEnabled

Note: To get hosts that have a specific purpose, but may have other purposes as well, you must surround the value with asterisks (*). For example:

`{HostPurposes['*Controller*']}`

## Remarks

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

## HTTP Method

GET: Returns a list of hosts by query.

## Request

Headers:

Content-Type: application/xml

Accept: application/xml

Cookies:

Version 2020 (or later) | LWSSO_COOKIE_KEY={LwssoCookie};
Versions earlier than 2020 | LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie};

Request Body:

None

Request Example

    GET http://<LRE_Server>/Admin/rest/v1/Hosts?query={name["host name"]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

## Response

Headers:

Content-Type: application/xml

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes

HTML Body:

GET: Returns the data on the entity in the response. See hosts response.

## See Also

hosts
hosts/{hostID}