Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rbk_tal
Contributor
Contributor

How to pass context variables, Context Groups while triggering Talend jobs using API ?

Hi All,

We are having a few generic jobs which we used to call using the metaservlet api in Talend 7.2.1.

We recently have moved to Talend Cloud Real-Time Big Data Platform and are trying to utilize the API calls to trigger tasks in TMC.

We are using below links as reference.

https://api.us-west.cloud.talend.com/tmc/swagger/swagger-ui.html# !/executions/execute

Is there a way to pass

  1. Context Variables - outside context groups
  2. Context Groups
  3. Connections - Initialized in TMC ?

The generic jobs receive these values from a parent job. Kindly let me know for any other details.

Thank you in advance.

Labels (6)
3 Replies
MS5
Contributor III
Contributor III

Hello,

 

You can pass context variables values using API call with execute function by using "parameters" tag. Example :

{

 "executable": <executable_ID>,

 "logLevel": "WARN",

 "parameters": {

                              "my_context_variable": "hello",

                              "my_context_variable2": "hello"

               }

}

 

For Connection, you have to initialized the connection in TMC. Context variable used in the studio need to be named correctly to work.

You have example in this documentation :

https://help.talend.com/r/en-US/Cloud/management-console-user-guide/creating-custom-connection

(There's an example with Amazon RDS)

rbk_tal
Contributor
Contributor
Author

Thank you very much for your response.

I have been trying to get the API to work and facing some issues.

Connections and Parameters work, but have issues with the context groups...

I am looking for any way to pass the value which the context groups should pick up and pass it on to child jobs as well.

 

In 7.2.1, we had the option to choose in TAC

 

0695b00000HB0SFAA1.jpg 

What would be the equivalent value in TMC - Public API

Basically to pass DEV in DEV environment and PRD in Prod environment which would get passed to the child jobs as well....

 

Thanks for all the help.

MS5
Contributor III
Contributor III

Hello,

I'm not sure that you can manage that using the API, but you can have a look to this link :

https://community.talend.com/s/article/Talend-Cloud-Contextualization-cQjcP?language=en_US

I think that the paragraph Context group name as environment name describe what you want to do.