Share this page

# Get runs by query

## Description

Returns a list of runs by query (filter).

## URL

Copy code

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

## Remarks

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

## Runs query values

QUERY_NAME options:

- `ID`

- `RunID`

- `TestID`

- `Domain;Project` (filtering by `Domain` or `Project` requires both `Domain` and `Project`)

- `TestName`

- `RunName` (previously `Name` )

- `StartDate`

- `EndDate`

- `Duration`

- `UserName`

- `ControllerName`

- `State` (previously `RunState`)

- `VusersMax` (previously `PCVUsersMax`)

- `VusersAverage` (previously `PCVUsersAvg`)

- `VusersInvolved` (previously `InvolvedVusers`)

- `TimeslotID`

Tip: Queries can include the following relationship characters to help you narrow down your search: <, >, <=, and >=.

## HTTP method

GET: Returns a list of runs by query.

## Request

Headers:

One of the following:

- Content-Type: application/xml

- Content-Type: application/json

Cookies:

Version | Cookie
--- | ---
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:

None

Request examples:

Copy code
XML example: All runs that belong to a test with ID = 1

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={TestID[1]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs that belong to a test with ID = 1

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={TestID[1]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
XML example: All runs with ID between 1030 - 1035, and project run ID = 32

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={ID[>1030];ID[<1035];RunID[32]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs with ID between 1030 - 1035, and project run ID = 32

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={ID[>1030];ID[<1035];RunID[32]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
XML example: All runs sorted by ID in descending order so that only the ID field is retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?fields=ID&order-by={ID[DESC]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs sorted by ID in descending order so that only the ID field is retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?fields=ID&order-by={ID[DESC]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
XML example: All runs sorted by ID in ascending order so that only the ID and project fields are retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?fields=ID,Project&order-by={ID[ASC]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs sorted by ID in ascending order so that only the ID and project fields are retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?fields=ID,Project&order-by={ID[ASC]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
XML example: All runs with start date greater than a given value and sorted by ID in ascending order, so that only ID and start date fields are retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={StartDate[>'2017-02-01%2014:17:17']}&fields=ID,StartDate&order-by={ID[ASC]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs with start date greater than a given value and sorted by ID in ascending order, so that only ID and start date fields are retrieved

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={StartDate[>'2017-02-01%2014:17:17']}&fields=ID,StartDate&order-by={ID[ASC]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
XML example: All runs from the given domain and project

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={Domain[DEFAULT];Project[INST_PATCH]}
    Content-Type: application/xml
    Accept: application/xml
    Cookie: ADM_LWSSO={AdmLwssoCookie};

Copy code
JSON example: All runs from the given domain and project

    GET http://<LRE_Server>/Admin/rest/v1/runs?query={Domain[DEFAULT];Project[INST_PATCH]}
    Content-Type: application/json
    Accept: application/json
    Cookie: ADM_LWSSO={AdmLwssoCookie};

## 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 entity in the response.

Depending on the query, the fields in the response can be:

Element | Description
--- | ---
ID | The Run ID.
RunID | The project run ID.
TestID | The test ID.
Project | The name of the project.
Domain | The domain name.
TestName | The name given to the test when it was created.
RunName (previously Name) | The run name.
StartDate | The date and time the run started (`YYYY:MM:DD HH:MM:SS`).
EndDate | The date and time the run ended (`YYYY:MM:DD HH:MM:SS`).
Duration | The run time, in minutes.
UserName | The name of the user running the test.
ControllerName | The Controller involved in the test run.
State (previously RunState) | One of: Before Collating Results Before Creating Analysis Data Canceled Collating Results Creating Analysis Data Failed Collating Results Failed Creating Analysis Data Finished Initializing Pending Creating Analysis Data Run Failure Running Stopping
VusersMax (previously PCVUsersMax) | The maximum number of concurrent Vusers that ran in the test.
VusersAverage (previously PCVUsersAvg) | The average number of Vusers used per run.
VusersInvolved (previously InvolvedVusers) | The total number of Vusers that ran in the test.
TimeslotID | The ID of the time slot.

Response examples:

Copy code
XML response: All runs sorted by ID in descending order so that only the ID field is retrieved

    <LabRuns>
       <LabRun>
         <ID>1042</ID>
       </LabRun>
       <LabRun>
         <ID>1041</ID>
       </LabRun>
       <LabRun>
         <ID>1040</ID>
       </LabRun>
    </LabRuns>

Copy code
XML response: All runs sorted by ID in ascending order so that only the ID and project fields are retrieved

    <LabRuns>
       <LabRun>
         <ID>1013</ID>
         <Project>INST_PATCH</Project>
       </LabRun>
       <LabRun>
         <ID>1014</ID>
         <Project>INST_PATCH</Project>
       </LabRun>
    </LabRuns>

Copy code
XML response: All runs with start date greater than a given value and sorted by ID in ascending order, so that only ID and start date fields are retrieved

    <LabRuns>
       <LabRun>
         <ID>1014</ID>
         <StartDate>2017-02-01 14:27:15</StartDate>
       </LabRun>
       <LabRun>
         <ID>1017</ID>
         <StartDate>2017-02-01 15:13:13</StartDate>
       </LabRun>
    </LabRuns>

See also:

- Get all runs

Tips to improve your search results... OpenText™ Enterprise Performance Engineering Admin API Reference OpenText™ Enterprise Performance Engineering All View Local Help Center View Online Help Center(Undefined variable: _rscC_Basic_Variables.VersionLabel)