Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I generated (for testing purposes) many files inside SaaS DataFiles folder, about 7,000 qvds. I wanna delete them using a batch command or action, but wihtin SaaS only can delete them one-by-one.
How can I delete about 7.000 files from my tenant?
P.S. I seek a solution in QLIK-CLI, but i didn´t found any command to do that.
Tks,
Pedro
Hi @pablolabbe
See my github at https://github.com/pbergo/qlik-saas-utils and use the qlik_saas_delete.ps1 to remove these files.
You can pass the name of Space and file using wildcards to do that.
If you have any doubt, just can call me on WP.
[]
Pedro
You rock Pedro ! thank you !
Thanks Pedro
Hello, I want to know if there is a command to copy QVD's between tenants or spaces.
Thanks
As do I - you cannot even delete the space and start over (Not ideal tbh) due to the dependencies.
I tried to doctor the script above, but to no avail. unsure if there is a permissions issue deleting Managed folder files.
Hello @pedrobergo
There is an idea to do it through script natively. Maybe that can interest you to vote for
https://community.qlik.com/t5/Suggest-an-Idea/Delete-Files-from-a-lib/idi-p/1689857
Best regards,
Simon
Did this API endpoint for CLI ever get released or documented? Can't see anything on Qlik.Dev 😞 be cool if app automations could do this...
For the file name, you can try "findstr -c:ABC".
I slightly modified @Levi_Turner scripts above.
For dated 3 months and above, I am not sure yet, maybe date -gt from createdDate will work but need to parse the date from createdDate.
Hope this help.
$files = qlik raw get v1/qix-datafiles | ConvertFrom-Json | findstr -c:name | findstr -c:ABC
while ($($files.Length) -gt 1) {
foreach ($file in $files) {
Write-Host "Deleting $($file.name)"
qlik raw delete v1/qix-datafiles/$($file.id) | Out-Null
}
$files = qlik raw get v1/qix-datafiles | ConvertFrom-Json
Write-Host 'Next page'
}
Sample:
id : 9a8f8f48-4574-cba51320a453
name : ABC.qvd
size : 1470407
createdDate : 2022-10-17T04:48:10.964Z
modifiedDate : 2022-10-17T04:48:11.262Z
ownerId : 64226107810cefd90c
Thank you @pedrobergo. In your github, I see upload and delete files. Is that possible to download files to local computer using these utilities? I spent hours yesterday trying to figure this out. Let me know. Thanks.