Test Data Manager

Expand all | Collapse all

Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

  • 1.  Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Oct 24, 2018 06:19 AM

    below is the format i am posting using Swagger UI.

    {    "name":"Publish_to_TDM_DEMO",   "description":"Publish to TDM_Demo using TDM_DEMO",   "projectName":"Project_Ashish",   "projectId":"7857",   "versionId":"7974",  "type":"PUBLISHJOB",   "origin":"generation",   "scheduledTime":1540374410,   "email":"ashish.rathore@telenetgroup.be",   "jobs":[  ],   "parameters":{    "generatorId":"7977",   "jobType":"PUBLISH",   "title":"Publish to TDM_DEMO",   "publishTo":"RESTAPIPOCCCA_17623",   "target":"REST_API_POC_CCA",   "dataTargetProfile":"TDMShredder",   "repeatCount":1,   "tables":[    {    "tableNo":1,   "tableName":"PO_tdm_root",   "status":1   },   {    "tableNo":2,   "tableName":"billTo",   "status":1   },   {    "tableNo":3,   "tableName":"items",   "status":1   },   {    "tableNo":4,   "tableName":"shipTo",   "status":1   },   {    "tableNo":5,   "tableName":"item",   "status":1   }   ],   "email":"ashish.rathore@telenetgroup.be"   }  }

     

    can some one please help and share working REST API for Publishing data generation Job from Swagger UI



  • 2.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Broadcom Employee
    Posted Oct 24, 2018 06:59 AM

    Hi,

        There is an example of a Publish API request on this page - Use APIs to Prepare Test Data for Non-Relational Sources - CA Test Data Manager - 4.6 - CA Technologies Documentation  in the "Publish Data" section.

     

       This is also a simple example of a response from my test system : 

     

    {
    "name":"Publish_New_Patient_Records",
    "projectId":6404,
    "scheduledTime": "2017-06-10T09:25:00Z",
    "type":"PUBLISHJOB",
    "origin":"generation",
    "jobs":[],
    "parameters":{
    "variableDefaults":[],
    "generatorId":6408,
    "jobType":"PUBLISH",
    "title":"Publish Patient Records",
    "publishTo":"TGT",
    "repeatCount":"10",
    "actionOnDuplicate":"continue",
    "actionOnGenDuplicate":"remove",
    "target":"MEDREC",
    "dataTargetProfile":"Medrec Target"
    }
    }

     

    Regards

    Keith



  • 3.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 15, 2019 08:09 AM

    Thanks Keith for your response. One more question i have if you can please help me.

     

    - I have project already setup for data generation and every time based on the request i have to generate data in same project, is there a way i can only download files which i have generated recently i.e. project is having 100 records and on demand i have generated 10 more records now (110 in total) i have to download only 10 JSON which i have generated recently, is it possible?

    Thanks

    Ashish



  • 4.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Broadcom Employee
    Posted Jan 16, 2019 08:24 AM

    Hi,

     

        The files created from the publish engine will be attached to the publish job which you can view in the submitted requests / Generator screen of the portal. If this attachment is what you need to download load you can use the following API to download the attachment TDMJobService/api/ca/v1/jobs/jobID/actions/downloadArtifact/ you just need the relevant job id.

     

    Regards

    Keith



  • 5.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 16, 2019 08:30 AM

    Hi Keith,

    currently i am able to download complete file, however i am looking for possibility to download last created records from the complete file i.e in case file is having 100 records and i only want to download last 10 records out of 100.

    is that possible?

    regards

    Ashish



  • 6.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 23, 2019 04:49 AM

    Hi,

     

    Get the file and use Javelin to export only last 10 records of it into seperate file.

     

    Best,

     

    Cihan



  • 7.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 24, 2019 06:24 AM

    Thanks Cihan, do you have any working sample, if yes can you please share as i am not good in Javelin ?



  • 8.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 24, 2019 06:31 AM

    If you can share the sample file, I can try to build a Javelin flow for you which can fetch the last 10 records.

     

    You can sen me the file on cihan.ankara@gunittech.com

     

    Best,



  • 9.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 24, 2019 08:02 AM

    Below is the API i found while doing export from TDM portal.

    1. {objectId: 17542, projectId: 8108, versionId: 8288, objectName: "TDM_SV_POC_CCA",…}
      1. columns: null
      2. explicitNamespaces: null
      3. fileConnProfId: 1
      4. fileConnectionProfileName: "TDMSQL"
      5. fileEncoding: "UTF-8"
      6. fileLocation: "C:\ProgramData\CA\CA Test Data Manager Portal\\objects\projects_8108\versions_8288\TDM_SV_POC_CCA\uploadedschema"
      7. fileName: "TDM_SV_POC_CCA,Combined TBAPI_Beligum.json"
      8. fileStatus: 4
      9. filecount: 1
      10. foreignKeys: null
      11. group: "FILE"
      12. jobFailureMessage: null
      13. jobId: 2281
      14. noNamespaceSchemaLocation: null
      15. objectId: 17542
      16. objectName: "TDM_SV_POC_CCA"
      17. objectType: "JSON"
      18. parentId: null
      19. programUpdated: "TDMApi"
      20. projectId: 8108
      21. relationships: null
      22. rootFilePath: null
      23. schemaLocation: null
      24. tableColumnCount: null
      25. tableForeignKeyCount: null
      26. tableIndexCount: null
      27. tableOrder: -1
      28. tableOwner: "TDMSVPOCCCA_17542"
      29. tablePrimaryKeyIndex: null
      30. tableRegisteredDBMS: null
      31. versionId: 8288

     

    for download exported file below is the call i have found

    http://ewn002639.prod.telenet.be:8080/TDMJobService/api/ca/v1/jobs/2281/actions/downloadArtifact/ 

     

    In case you can derive an API which will allow me to download specific records from the project i can configure that in another tool and give a try as we are using CA Devtest as well.

    thanks for your help.

    Ashish Rathore



  • 10.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 24, 2019 08:50 AM

    Hi Ashish,

     

    The above link that you have provided is not working. I think link belongs the local TDM instance and it is not possible to access from outside of the network. Please download it by yourself and send to me.

     

    Best,

     

    Cihan



  • 11.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Jan 24, 2019 09:34 AM

    Hi,

    i am able to download the file however not able to attach the same in this ticket, that file contains the JSON files which i have generated so far into this project and it has complete list and i am looking for API which can help me download only last 10 files.

    if you can help me please

    Thanks 

    Ashish Rathore



  • 12.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Feb 05, 2019 07:05 AM

    Hi Ashish, 

    I have never tried to generate data for API's but I am sure whenever you register non-relational data sources, there are few audit fields created by CA TDM like Shred_ID(PK), shred_group_id(batch_id) and one more FK column. So to get the data for recent job what you can do is where ever you see SHRED_GROUP_ID column use variable ~PUBJOBID~. This will assign the current job id and will make sure everytime you generate the data new id is assigned and hence whenever you publish the data note the job id and use this job id to fetch the data for particular publish.



  • 13.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Feb 12, 2019 05:32 AM

    Thanks for your time Raj solution seems to me really helpful. i have assign the variable ~PUBJOBID~ for all the SHRED_GROUP_ID of an object and publish the data however while export data i am not getting option to specify the Jobid in variable and hence still all the files are getting downloaded. can you please suggest where/how can i download the data with recently submitted job number from TDM portal.

    i need to have data in JSON format and hence i am using TDM portal for data creation in the registered object and from below screenshot you can see 117 files in total under the object however i have created 5 files at the moment following your procedure and looking to download only recently created 5 files.



  • 14.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed

    Posted Feb 12, 2019 05:41 AM

    Yes its working, i have mentioned the JOBID in document group id column from the above screenshot and i am able to download the recently created 5 records. please correct me if my understanding is wrong.

    Thanks for your help Raj.

     

    Regards,

    Ashish Rathore



  • 15.  Re: Dear All, I am trying to hit data generation PUBLISH job with REST API however job is getting failed
    Best Answer

    Posted Feb 12, 2019 06:35 AM

    Yes Ashish you are correct "Document Group ID" is the Shred Group ID aka Batch ID in the ETL world.