Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Learner1
Contributor III
Contributor III

Qlik Rest api call to reload all tables in a replication task

Hello Team,

Could you please help with qlik rest api call to reload all tables in a given replication task in one call.

Labels (1)
1 Solution

Accepted Solutions
john_wang
Support
Support

Hello @Learner1 ,

Thanks for reaching out to Qlik Community!

I think you are looking for Reload target.

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

11 Replies
john_wang
Support
Support

Hello @Learner1 ,

Thanks for reaching out to Qlik Community!

I think you are looking for Reload target.

Hope this helps.

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
Heinvandenheuvel
Specialist III
Specialist III

The only way to reload all tables for a task in one call is to stop the task and run it with reload option as John's reply. The call is to "RunTask" with the reload option.

There is also a ReloadTable Api which takes 1 table in 1 task as argument. That task needs to be full-load enabled. in order to load all tables with that API you would first need to call "GetTableList" and loop over the results. Note, "GetTableList" can be provided filters by name and state and such.

Hein.

Learner1
Contributor III
Contributor III
Author

Hello, I tried using reload_target option. From QEM server logs, it shows message as task executing and full load completed as well. But when we check tables' wise last loaded date, it's not updated. So, not sure if this is working ok and also if you can suggest how can I verify if this call is successful.

Right now i was trying to make the rest call to check task status and verify last full load time,.

aarun_arasu
Support
Support

Hello @Learner1 ,

Thanks for your response.

Can you please reverify? I reloaded a task through an API command and was able to see that the last load date on the task is updated with the recent date. Additionally, you could check the history.

Monitor --> Tools --> History

It should show you when the table was last reloaded.

Regards

Arun



Learner1
Contributor III
Contributor III
Author

Thank you. Can you please paste your command, in case I am doing some mistake.

aarun_arasu
Support
Support

Hello @Learner1 ,

Pease find the below API 

https://<hostname >/attunityenterprisemanager/api/v1/servers/localhost/tasks/dvdrental?action=run&option=RELOAD_TARGET

Note : Localhost is the server name I defined in the QEM
dvdrental --> Its my task name 

Regards
Arun

Learner1
Contributor III
Contributor III
Author

Hello, Thanks for prompt reply. My call is ignoring the "option". QEM version is 2023.5.0.285.

curl -i -k -X POST --header "EnterpriseManager.APISessionID: x1234" --header "Content-Length: 0" https://***/attunityenterprisemanager/api/v1/servers/***/tasks/taskName?action=run&option=RELOAD_TARGET

{"state":"STOPPED","error_message":""}'option' is not recognized as an internal or external command,
operable program or batch file.

 

 

Heinvandenheuvel
Specialist III
Specialist III

"'option' is not recognized as an internal or external command"

Duh!  That's a standard windows command line error.

Clearly 'option' was passed as a fresh command, not as part of the curl.

You need to quote the whole command line or escape the ampersand with a caret '^' symbol.

Windows scripting 101.

btw.. what is the underlying problem/mission? Taks reload calls are often part of a schedule. Can the replicate build-n scheduler solve the core issue? More power to you for trying to use the API, but if the scheduler and handle it, then why not.

Hein

 

Learner1
Contributor III
Contributor III
Author

Thanks a lot to you and everyone in this conversation for your patience and help. It works now 😅.

Actually we want to control this load programmatically because the load should happen only after some other thing has completed not simply on a schedule.