Variables in Rest API TdmJobService

book

Article ID: 106315

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction



We are trying to use the RESTful API to publish some synthetic data in an Oracle Database, using the /TDMJobService/api/ca/v1/jobs End Point. We need to pass a value to a variable we use in that generator. However, the variable always returns the default value, and not the value you wish to pass. We read over the API documentation, but could not find anything to help us get around this issue, or a recommendation for doing what we need in this situation.

What is the best way to accomplish this?

Environment

Release:
Component: TDMWBP

Resolution

The best way to get the payload will be to publish the generator using chrome and then copying the payload from developer console (F12).

For example:
Generator with variables

<Please see attached file for image>

User-added image

Publish to target

<Please see attached file for image>

User-added image
Capture the traffic

<Please see attached file for image>

User-added image

Below is the Payload for the request

{
               "name": "Publish_TEST_GEN1",
               "description": "Publish to TEST using GEN1",
               "projectId": 2352,
               "versionId": 2353,
               "type": "PUBLISHJOB",
               "origin": "generation",
               "scheduledTime": 1531496360001,
               "jobs": [],
               "parameters": {
                              "variableDefaults": [{
                                             "name": "ADD",
                                             "value": "ADD"
                              },
                              {
                                             "name": "CITY",
                                             "value": "CITY"
                              },
                              {
                                             "name": "FIRSTNAME",
                                             "value": "FIRSTNAME"
                              },
                              {
                                             "name": "ID",
                                             "value": "10"
                              },
                              {
                                             "name": "LASTNAME",
                                             "value": "LASTNAME"
                              }],
                              "generatorId": 2357,
                              "jobType": "PUBLISH",
                              "title": "Publish to TEST using GEN1",
                              "publishTo": "TGT",
                              "repeatCount": "1",
                              "tables": [{
                                             "tableNo": 1,
                                             "tableName": "Persons",
                                             "status": 1,
                                             "fileId": null
                              }],
                              "actionOnDuplicate": "exit",
                              "actionOnGenDuplicate": "exit",
                              "target": "dbo",
                              "dataTargetProfile": "TEST",
                              "dataSourceProfile": ""
               }
}

 

Attachments

1558691542745000106315_sktwi1f5rjvs16gmw.png get_app
1558691541084000106315_sktwi1f5rjvs16gmv.png get_app
1558691538334000106315_sktwi1f5rjvs16gmu.png get_app