Not able to use Rest Invoke to pull reports in DevTest getting Invalid test ID

Document ID : KB000116941
Last Modified Date : 04/10/2018
Show Technical Document Details
Question:
Using Postman, I have successfully uploaded a MAR-File using the lisa-invoke2 API /api/Dcm/CoordinatorServers/Coordinator/actions/deployMar which returns with:

POST 
http://ABC:1505/api/Dcm/CoordinatorServers/Coordinator/actions/deployMar 
POST 
http://ABC:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/actions/start 

But when I try to pull the report

GET 
http://ABC:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/report


I am seeing error 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error xmlns="http://www.ca.com/lisa/invoke/v2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 Error.xsd" type="application/vnd.ca.lisaInvoke.error+xml">
    <Id>2702</Id>
    <Message>Invalid test ID:61932EDDC71011E8A23000505698155F</Message>
    <AdditionalInformation>&#xD;


Even though Test ID is correct.
Environment:
All supported DevTest Environments
Answer:
This is working as designed. With Invoke API, the links in response of deployMar action are only valid until that the test case/suite is present in coordinator. Once it has finished execution and is removed from the Coordinator server, those links will become stale and give the error you have seen. 

So, all the links listed below is present only until the test/suite  is still executing.   

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Test xmlns="http://www.ca.com/lisa/invoke/v2.0" name="61932EDDC71011E8A23000505698155F" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ca.com/lisa/invoke/v2.0 Test.xsd" href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F" type="application/vnd.ca.lisaInvoke.test+xml">
    <Name>DevTest_config_info [StagingDoc5]</Name>
    <Status>2</Status>
    <RunBy>admin</RunBy>
    <Instances>4</Instances>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator" rel="up"/>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/actions" rel="actions"/>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/actions/start" rel="start"/>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/actions/stop" rel="stop"/>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/report" rel="report"/>
    <Link href="http://abrsh01-s5113.ca.com:1505/api/Dcm/CoordinatorServers/Coordinator/Tests/61932EDDC71011E8A23000505698155F/metrics/status" rel="metrics"/>

</Test>

You can test this by using a staging document that has more number if users or execution cycles and click on these response links then the test suite is still under execution. You won't get that error.