Open topic with navigation

# TrendReports/{ID}

## Description

Adds a run to an existing trend report, and returns the report metadata (per the specified trend report ID).

## URL

    /LoadTest/rest/domains/{domainName}/projects/{projectName}/TrendReports/{ID}

## Remarks

Only runs in the Finished state can be added.

To get the report data, request TrendReports/{ID}/data.

## HTTP Method

POST: Adds a run to a trend report.

GET: Returns the report metadata in the body of the response.

## Request

Headers:

Content-Length: {length}

Host: {PCServer}

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

Element | Description
--- | ---
TrendReport | The root element.
Project | The project to which the run belongs. The project can be different than the project of the report.
TestSetId | The ID of the test set that contains the executed test.
TestId | The Test ID.
RunId | The Run ID.
TrendedRanged | (Optional) The range of the run to add to the report. Default: the entire run.

Request Example

    POST /LoadTest/rest/domains/{domainName}/projects/{projectName}/TrendReports/{ID} HTTP/1.1
    Content-Type: application/xml
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};
    Host: <LRE_Server>
    Content-Length: 203
    Expect: 100-continue

    <TrendReport  xmlns="http://www.hp.com/PC/REST/API" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <Project>PC</Project>
      <RunId>2</RunId>
      <TestSetId>5</TestSetId>
    </TrendReport>

    <TrendReport  xmlns="http://www.hp.com/PC/REST/API">
      <Project>PC</Project>
      <TestSetId>1</TestSetId>
      <TestId>2</TestId>
      <RunId>4</RunId>
      <TrendedRange>
        <StartTime>
          <Hours>1</Hours>
          <Minutes>0</Minutes>
          <Seconds>0</Seconds>
        </StartTime>
        <EndTime>
          <Hours>2</Hours>
          <Minutes>0</Minutes>
          <Seconds>0</Seconds>
        </EndTime>
      </TrendedRange>
    </TrendReport>

## Response

Headers:

None

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes

Upon success, returns HTTP status 200 (OK).

HTML Body:

The XML containing the trend report metadata. See TrendReports/{ID} XML.

Upon success, the response will contain the following information:

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: -1
    Date: Sun, 29 Nov 2015 13:40:44 GMT
    Content-Length: 0

## See Also

TrendReports/{ID}/data