I am currently writing a script and have 2 questons regarding folders:
Is it possible to get the size of a folder via API (I mean complete size of all files and this folder)
And is there an elegant way to just check if an folder exists
(Currently I make an try catch arround a GET request, but this looks nasty to me)
Best regards, Marius
Please consider moving this question as-is (no need to recreate) to the proper forum for maximum visibility. Questions written to the users' own "Discussions" space don't get the same amount of attention and questions can go unanswered for a long time.
You can do so by selecting "Move" under ACTIONS along the upper-right. Then search for and select: "Isilon" which would be the most relevant for this question.
Have you fooled around with the latest API (7.2)?
For a directory /ifs/data/matt:
ma-visi-72-1# curl -u root:a -k 'https://184.108.40.206:8080/namespace/ifs/data/matt?detail=size'
"name" : "thisisifsdatamatt.txt",
"size" : 29
"name" : "foo",
"size" : 58
This gives you the size of the files contained within. Though it looks like you'll have to programmatically sum them.
I haven't seen an elegant way of determining if a folder exists...
If you need the size of the directory and all of it's content ( subdirectories included) you can query the sqlite3 database that FSanalize job creates. I'm not sure if you need InsightIQ to be able to schedule the FSanalyze jobs :
ptc-3# sqlite3 /ifs/.ifsvar/modules/fsa/pub/latest/results.db 'select system_squash_map.path , disk_usage.phys_size_sum /1024 from system_squash_map join disk_usage on system_squash_map.lin = disk_usage.lin where system_squash_map.path like "%big%" ;'
the answer of mattashon seems to ge the right direction, the only thing missing is some recursive function I did not find yet.
The answer from bhalilov@un is nice as well, but I search for a clientsside solution without ssh access
So, did anyone find an legant way to do so via api or via python backend?