Host pools

Description

Create a host pool or returns a list of host pools.

URL

Copy code
/Admin/rest/v1/pools

Remarks

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

To add a host pool to LAB_PROJECT, you need to send an HTTP request to create a Host Pool resource.

This API should be authorized for the Application, Tenant, and Site Admin permission levels.

HTTP method

  • POST: Creates the host pool.

  • GET: Returns a list of host pools.

Request

Headers:

One of the following:

  • Content-Type: application/xml

  • Content-Type: application/json

Cookies:

VersionCookie
2023, 24.1, and later

ADM_LWSSO={ADM_LWSSO_COOKIE_VALUE};

2022 - 2022 R2

ADM_LWSSO={ADM_LWSSO_COOKIE_VALUE};

ASP.NET_SessionId_Adm={ASP.NET_SessionId_Adm_COOKIE_VALUE};

LWSSO_COOKIE_KEY={LWSSO_COOKIE_KEY_COOKIE_VALUE};

2021 - 2021 R2

ADM_LWSSO={ADM_LWSSO_COOKIE_VALUE};

ASP.NET_SessionId_Adm={ASP.NET_SessionId_Adm_COOKIE_VALUE};

2020 - 2020 SP3

ADM_LWSSO={ADM_LWSSO_COOKIE_VALUE};

Earlier than 2020

LWSSO_COOKIE_KEY={LWSSO_COOKIE_KEY_COOKIE_VALUE};

QCSession={QC_SESSION_COOKIE_VALUE};

Request body:

  • GET: No request body.

  • POST: XML or JSON describing the host pool.

Request examples:

Copy code
XML example - GET:
GET http://<LRE_Server>/Admin/rest/v1/pools
Content-Type: application/xml
Accept: application/xml
Cookie: ADM_LWSSO={AdmLwssoCookie};
Copy code

JSON example - GET:

GET http://<LRE_Server>/Admin/rest/v1/pools
Content-Type: application/json
Accept: application/json
Cookie: ADM_LWSSO={AdmLwssoCookie}; 
Copy code
XML example - POST:
POST http://<LRE_Server>/Admin/rest/v1/pools
Content-Type: application/xml
Accept: application/xml
Cookie: ADM_LWSSO={AdmLwssoCookie};

<HostPool>
    <Name>Testing_Pool</Name> 
    <Description>System created testing</Description></HostPool>
Copy code
JSON example - POST:
POST http://<LRE_Server>/Admin/rest/v1/pools
Content-Type: application/json
Accept: application/json
Cookie: ADM_LWSSO={AdmLwssoCookie}; 

{
    "Name": "Testing_Pool",
    "Description": "System created testing"
}

Response

Headers:

One of:

  • Accept: application/xml

  • Accept: application/json

Cookies:

None

HTML return code:

One of the HTTP return codes

HTML body:

  • GET: Returns the data on the host pool in the response.

  • POST: Returns XML or JSON of the host pool.

The response contains the following fields.

ElementDescription
HostPoolsThe top-level element. Contains HostPool sub elements with the elements listed below.
NameThe name of the host pool.
DescriptionAn optional description of the host pool.
Hosts

Can contain HostID sub elements which lists the ID of the hosts assigned to the pool.

IDThe ID of the host pool.

Response examples:

Copy code
XML example - GET:
<HostPools>
   <HostPool>
      <Name>TestPool</Name> 
      <Description>Some description</Description>
      <ID>1001</ID>
   </HostPool>
   <HostPool>
      <Name>TestPool2</Name> 
      <Description>Some description</Description>
      <Hosts>
        <HostID>1026</HostID>
        <HostID>1029</HostID> 
      </Hosts>
      <ID>1002<ID>
   </HostPool>
   <HostPool>
      <Name>TestPool4</Name> 
      <Description>Some description</Description>
      <ID>1003</ID>
   </HostPool> 
</HostPools>
Copy code
JSON example - GET:
[
    {
        "ID": 1000,
        "Name": "General",
        "Description": "System created default pool",
        "Hosts": [
            1100,
            1808
        ]
    },
    {
        "ID": 1135,
        "Name": "Pool_REST",
        "Description": "Created with REST",
        "Hosts": [
            1100
        ]
    }
]
Copy code
XML example - POST:
<HostPool>
    <Name>Testing_Pool</Name>
    <Description>System created testing</Description>
    <ID>1110</ID>
</HostPool>
Copy code
JSON example - POST:
{
    "ID": 1111,
    "Name": "Testing_Pool",
    "Description": "System created testing",
    "Hosts": null

See also: