Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jesper_bagge
Contributor III
Contributor III

Looking for an API endpoint to drop data from stale applications

Hi community!

I'm looking for insights regarding size management on a Qlik Sense Enterprise for Windows solution.

On our plattform we've got about 30 developers happily creating apps, wrangling data and testing stuff out. A problem that has begun to surface is that we didn't have any thought about setting up app retention policys back in 2017 when we opened up the doors. 
Right now I'm looking at over  1000 apps, where about 800 haven't even been touched this year. I'm not the one to decide whether to delete them or not, but the (probably stale) data residing in them is starting to take a toll on our disks. 

Theoretically, I probably wouldn't cause an uproar if I could just drop the data from the apps via an API - since they could just be rerun to get the data back.

Now to my question. Is there such an API? I'm quite well versed with the repository API but haven't found what I'm after. But perhaps someone else has had similar experiences?

UPDATE 20210528: link to solution here

Kind regards,
Jesper Bagge

Labels (1)
1 Solution

Accepted Solutions
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @jesper_bagge, with the Engine JSON API you have the OpenDoc method with the parameter qNoData. If you open an application with no data and save it (method DoSave), you will get an empty app with a size of some Kb or a couple of Mb in the disk.

But take into account the developers will not be able to work with the app until it gets reloaded again, as the objects become unusable with no data.

JG

View solution in original post

7 Replies
rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Hey @jesper_bagge ,

it's not straight-forward, but a possible solution is using Repository APIs:

  • you can export the application without data
  • ... and then replace the same application that you exported with the copy without data

 

This way you'll keep all script, sheets, master items, ... and will remove all the data
Personally, I would suggest to try doing so using powershell and Qlik-CLI (link)

Let me know if this helps,
Riccardo

JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @jesper_bagge, with the Engine JSON API you have the OpenDoc method with the parameter qNoData. If you open an application with no data and save it (method DoSave), you will get an empty app with a size of some Kb or a couple of Mb in the disk.

But take into account the developers will not be able to work with the app until it gets reloaded again, as the objects become unusable with no data.

JG

jesper_bagge
Contributor III
Contributor III
Author

Hi Riccardo,

Thanks! Will probably end up with a different app GUID, this way. But that might not pose a problem since I'm only targeting stuff in developers' My Work-stream. 

I'd rather not go near powershell but the same can be done in Python since we're only talking REST here.

Cheers!

jesper_bagge
Contributor III
Contributor III
Author

Wonderful, Juan!

This is most likely precisely what I'm after! Same app, id, script and objects but with no data. 

My only concern is that if I'm allowed to open apps in other users My Work-stream using the Engine JSON API.

Cheers!

rzenere_avvale
Partner - Specialist II
Partner - Specialist II

Actually yes and no: if you import a separate app then yes, you'll generate a new app (so the new app will have a new GUID)
If you just import and replace at the same time the exported application, the source application will keep the same GUID

I confirm that, if you're a RootAdmin, you can perform this action for all apps in your environment (yours or not, published or not)

Riccardo

JuanGerardo
Partner - Specialist
Partner - Specialist

An option is to authenticate using Qlik Sense certificates, so you will be able to access everything.

JG

jesper_bagge
Contributor III
Contributor III
Author

Hi again,

I ended up using the Engine API as you suggested. And using certificates for authentication did the trick!

Thought I'd share my solution in this thread for anyone curious. It's a CLI-ish python app that can be CRON:d for continuous duty.

Link to my repo here.

Thanks again!