Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
lmit
Creator II
Creator II

Task list in TMC

Hi All,

am using talend data fabric and using TMC

i want to collect the list of tasks deployed in qa and prod environments in TMC and compare the list so that I can be sure that what I deployed in qa matches with prod

is there a way where I can do this ?

Thanks,

lmit

Labels (2)
7 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @none none​ 

 

Yes, you can do it using the TMC API. The tasks/getAvailableTasks resource seems to return what you want and you can filter by environment, workspace and so on.

 

For details about the API, please take a look at the link below with its swagger documentation:

 

https://api.us.cloud.talend.com/tmc/swagger/swagger-ui.html#/tasks/getAvailableTasks

 

 

lmit
Creator II
Creator II
Author

Thanks @Anselmo Peixoto​ for the reply , I tried with the api you shared but I have to manually paste the runtime id for the task and I have more than 200 tasks

 

is there any other way where I can get all the task present in the qa environment

 

thanks,

lmit

anselmopeixoto
Partner - Creator III
Partner - Creator III

It should work if you use the environmentId to list all the tasks present in the qa environment. The runtimeId is an optional parameter.

 

You will be able to find out the environment id on the URL when you browse on TMC.

 

This link below should provide further help about the mandatory/optional parameters:

 

https://api.talend.com/apis/orchestration/2021-03/#operation_get-available-tasks

lmit
Creator II
Creator II
Author

Thanks @Anselmo Peixoto​ 

 

now am able to get the list but am getting only 100 records

 

am guessing it’s because of the limit option , is it correct ?

 

if I want to get more than 100 records what is the option I should keep ?

 

thanks,

lmit

anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @none none​ 

 

This is the maximum number of items to return. It is set by the "limit" parameter and it "Must be in range [1, 100]. Default value - 100".

 

To get all the items, you'll need to create a loop and use the "offset" parameter as a step.

lmit
Creator II
Creator II
Author

Hi @Anselmo Peixoto​ ,

 

I tried giving various numbers in offset column but the result is not coming more than 100

 

I tried various combinations found while browsing. Can you please help me with a example to how to create a loop and get all the tasks

 

the parameters am passing are environment id and runtime

thanks,

lmit

anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @none none​ 

 

The result won't come over 100, that's the maximum limit and why you'll need to use a loop and use offset to get the other "page results".

 

You can try using a tLoop component and iterate over tRestClient to get the results.

 

For each response from the API you can store the "total" element returned in a global variable.

 

Then you use this same variable to control the loop on the tLoop component, so you can iterate until there's no remaining tasks to be returned.