Jobs created with REST APIs do not appear in Submitted Requests for Portal

book

Article ID: 141343

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

One of our requirements is to use TDM REST APIs in our Continuous Deployment pipeline.

To accomplish this, we created a Postman Collection, using the following methods:

Login - http://{{url}}:{{port}}/TestDataManager/user/login Get Project ID - http://{{url}}:{{port}}/TDMProjectService/api/ca/v1/projects Get Version ID - http://{{url}}:{{port}}/TDMProjectService/api/ca/v1/projects/{{projectId}}/versions Get Generator ID - http://{{url}}:{{port}}/TDMGeneratorService/api/ca/v1/generators?projectId={{projectId}}&versionId={{versionId}} Publish Data - http://{{url}}:{{port}}/TDMJobService/api/ca/v1/jobs Get Job Status - http://{{url}}:{{port}}/TDMJobService/api/ca/v1/job/{{jobId}}

All of them run successfully, in the Postman, and I can see that the last method shows the following response:

{

    "name""Publish_Petclinic_Owners",

    "jobId"27,

    "description""Publish to Petclinic using Owners",

    "projectName"null,

    "projectId"0,

    "versionId"null,

    "versionName"null,

    "createdBy""Administrator",

    "email""[email protected]",

    "scheduledTime""2017-09-01T12:21:00Z",

    "startTime""2019-11-20T00:30:30Z",

    "endTime""2019-11-20T00:31:15Z",

    "elapsedTime"null,

    "scheduledTimeL"1504268460000,

    "startTimeL"1574209830877,

    "endTimeL"1574209875030,

    "status""Completed",

    "type""PUBLISH",

    "parentId"0,

    "jobs": [],

    "duration"44153,

    "artifactLocation""C:\\ProgramData\\CA\\CA Test Data Manager Portal\\\\Jobs\\Job_27.zip",

    "origin""petclinic",

    "parameters": {

        "generatorId""2351.0",

        "dataSourceProfile""Petclinic",

        "dataTargetProfile""Petclinic",

        "repeatCount""10.0",

        "publishTo""TGT"

    },

    "statusMessage""Publish to Petclinic using Owners is complete",

    "runningStatus"null,

    "created"null,

    "createdL"null

}

My understanding is that the APIs are called in the correct way and data are getting published.

I checked the folder %ProgramData%\CA\CA Test Data Manager Portal\Jobs, and I was able to see the file Job_27.zip was created.

The issue, however, lies with TDM Portal. I checked the "Submitted Requests" menu, and looked under all the options (Generators, Self-service Catalog, Modelling, etc), but the request was not present.

I checked the database and the data was created.

When I run the same Generator from the Portal itself, and the request is presented in the "Submitted Requests".

So, why doesn't the REST API submitted requests also show in TDM Portal?

 

Environment

Release : 4.8

Component : CA Test Data Manager

Resolution

In the API parameters; the "origin" parameter specifies which category ('Self Service Catalog', 'Generators' and so on) the submitted requests page the request will show up - for example to show request when 'Generators' category is selected then the parameter should be set to "generation".

However, in your example, your REST API call is using "petclinic" (which of course is unknown to TDM). So the fix is very easy - replace "origin": "petclinic" with "origin": "generation" in the Postman body definition for Publish Data request, and the request will be seen form Portal under the Submitted Requests page.