Size of data stored

1848
3
08-23-2017 01:45 PM
StephenBarbie
New Contributor

Is there an easier way to find out the size of data stored in ArcGIS Online with out having to open each entry separately? We are trying to clean up some of our old entries that are eating up a lot of our credits but opening over 300 different entries is taking a long time. Then when you click the back button that does not help because you have to go figure out where you left off. 

It would be nice if the size was listed in the contents view along with the name, type, shared and date modified info.

3 Replies
SethLewis1
Occasional Contributor III

I don't know if there's a GUI-based method for pulling the size information from multiple items, but you can do this using the Python API. The pseudo code below will output a CSV listing every Hosted Service, its itemId and the size of the item in bytes.

from arcgis.gis import *
import csv

gis = GIS('Portal URL', 'admin', 'password')

hosted_layers = gis.content.search('typekeywords: "Hosted Service"', max_items=1000)

print('Hosted Service Count: ' + str(len(hosted_layers)))

fields = ['id', 'title', 'size']

with open(r'file location', 'w', newline='') as outfile:
    csvfile = csv.writer(outfile)
    csvfile.writerow(fields)
    for layer in hosted_layers:
        row = [layer.id, layer.title, layer.size]
        csvfile.writerow(row)
        
    print(outfile.name)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
AdamZiegler1
Esri Contributor

Hi Stephen - I believe you can do what you're looking for. Logged in as an administrator, click on 'Organization' --> View Status --> Scroll down to Aggregation by Type and select Storage --> then choose a sub type --> Table appears with Size and Credits --> Choose an item in the table --> View item details --> Opens a window of Details which can be downloaded.

Adam Z

KellyGerrow
Esri Frequent Contributor

Check out this blog that outlines how to download the feature storage report:

Understanding Feature Storage Reports (December 2016) | ArcGIS Blog 

-Kelly

0 Kudos