Test Data Manager

  • 1.  Variables in Rest API TdmJobService

    Posted Jun 26, 2018 08:21 AM

    Hello;

     

    We are trying to use the API TdmJobService, to publish some sinthetic Data in a Oracle Database, using the /TDMJobService/api/ca/v1/jobs End Point.

    But, we are having some troubles here, because we need to pass a value to a variable we use in that generator.

    We didn´t find a way to pass it... It always returning the Default Value...

     

    Here are some examples, of the content we tried to pass... (Variable name is NumPro, numeric)

     

    1.

    {

    "name":"Teste_Generator",

    "description":"Publish via Web Services",

    "projectId":2695,

    "type":"PUBLISHJOB",

    "origin":"generation",

    "scheduledTime":"2018-06-22T12:12:00Z",

    "email":"TTT@XX.com.br",

    "parameters":{

    "NumPro":"2",

    "generatorId":2876,

    "jobType":"PUBLISH",

    "title":"Publish via Web Services",

    "publishTo":"TGT",

    "target":"GREL",

    "dataTargetProfile":"ORADES5A_TARGET",

    "repeatCount":1,

    "email":"TTT@XX.com.br"

    }

    }

     

    2.

    {

    "name":"Teste_Generator",

    "description":"Publish via Web Services",

    "projectId":2695,

    "type":"PUBLISHJOB",

    "origin":"generation",

    "scheduledTime":"2018-06-22T12:12:00Z",

    "email":"TTT@XX.com.br",

    "parameters":{

    "generatorId":2876,

    "jobType":"PUBLISH",

    "title":"Publish via Web Services",

    "publishTo":"TGT",

    "target":"GREL",

    "dataTargetProfile":"ORADES5A_TARGET",

    "repeatCount":1,

    "email":"TTT@XX.com.br"

    },

    "jobParams": [

        {

          "paramKey": "NumPro",

          "paramValue": "2"

        }

      ]

    }

     

    3.

    {

    "name":"Teste_Generator",

    "description":"Publish via Web Services",

    "projectId":2695,

    "type":"PUBLISHJOB",

    "origin":"generation",

    "scheduledTime":"2018-06-22T12:12:00Z",

    "email":"TTT@XX.com.br",

    "parameters":{

    "generatorId":2876,

    "jobType":"PUBLISH",

    "title":"Publish via Web Services",

    "publishTo":"TGT",

    "target":"GREL",

    "dataTargetProfile":"ORADES5A_TARGET",

    "repeatCount":1,

    "email":"TTT@XX.com.br"

    },

      "variableDefaults": [

        {

          "name": "NumPro",

          "value": "2"

        }

      ]

    }



  • 2.  Re: Variables in Rest API TdmJobService
    Best Answer

    Posted Jul 04, 2018 01:34 AM

    Hi Danilo,

     

    I would suggest that first update the required variable using the CA TDM Projects Service API or CA TDM Generator Service API. And then call the Job API to publish.

     

    You can set the desired value as the "defaultValue".

    Depending upon the variable scope (Project / Generator), the API has to be chosen.

    Regards,
    Srini



  • 3.  Re: Variables in Rest API TdmJobService

    Posted Jul 05, 2018 08:52 AM

    Hello Srini,

     

    Thx for the help...

    We will try that!

     

    Just a question...

    As i see, it just change the "default value"... 

    If somebody, at the same time run the same thing updating the default value of the variable, it will not override the value of the other execution?

     

    Thx



  • 4.  Re: Variables in Rest API TdmJobService

    Posted Jul 06, 2018 08:40 AM

    Hi Danilo,

     

    Welcome ... Let me know whether it works as expected

     

    Yes, since the default value is updated, it will have impact on further executions. Hence every execution may need to update the default value as required.

     

    It would have been nice to simply pass the variable value as a parameter, rather than updating it's default value. I'm unaware of any such option exists.

     

    Regards,

    Srini



  • 5.  Re: Variables in Rest API TdmJobService

    Broadcom Employee
    Posted Jul 09, 2018 12:05 PM

    Hi Danilo,

    Did Srini's suggestion work for your use case ?



  • 6.  Re: Variables in Rest API TdmJobService

    Posted Jul 30, 2018 03:01 AM

    Hi Danilo,

     

    It seems the variable values should be passed within the nested parameters {} element. Your example three may be modified as below. This would allow to pass the required value for the variable NumPro. This will not affect the default value.

     

    {
    "name":"Teste_Generator",
    "description":"Publish via Web Services",
    "projectId":2695,
    "type":"PUBLISHJOB",
    "origin":"generation",
    "scheduledTime":"2018-06-22T12:12:00Z",
    "email":"TTT@XX.com.br",
    "parameters":{
    "generatorId":2876,
    "jobType":"PUBLISH",
    "title":"Publish via Web Services",
    "publishTo":"TGT",
    "target":"GREL",
    "dataTargetProfile":"ORADES5A_TARGET",
    "repeatCount":1,
    "email":"TTT@XX.com.br",
    "variableDefaults": [{"name": "NumPro","value": "2"}]
    }
    }



  • 7.  Re: Variables in Rest API TdmJobService

    Posted Jul 30, 2018 05:25 AM

    Assuming this is the correct syntax, it would be great to see it in the DocOps documentation, or at least in the samples shown in https://localhost:8443/TDMJobService/swagger-ui.html.

     

    The current examples are lacking this detail, which is probably the root of why the OP has asked the question…

     

    Thanks



  • 8.  Re: Variables in Rest API TdmJobService

    Posted Jul 30, 2018 05:55 AM

    Yes, I agree with you.

    I couldn't find any specific documentation explaining the syntax or examples for the Job Info Data that needs to be passed while calling the API. It would be very helpful, if CA can update the relevant document(s).