Isolate AGOL Items Added by Specific Date

225
1
06-27-2018 08:54 AM
Lake_Worth_BeachAdmin
Occasional Contributor III

I noticed on a certain date a large influx of my storage credits started being consumed.

Is there a way so isolate all the items that were added that date as a report or something similar?

Tags (1)
0 Kudos
1 Reply
JonathanQuinn
Esri Notable Contributor

You can use the Python API to loop through all users within your organization and then all of the content for each user, then find the created and modified properties of each item. They're stored in epoch time so you'll just need to convert the time that the influx started to epoch time to make the comparison.

The "clone" sample has some of what you need:

clone_portal_users_groups_and_content | ArcGIS for Developers 

It generates a list of all users, and then loops through each users content. Instead of moving things or generating a mapping, you just need to get the created date:

 

for item in user_content:
  print("epoch time of created timestamp: {}".format(item['created']))

would give you the epoch. You can take this a step further to give you a formatted string:

for item in user_content:
print("item created: {}".format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(
item['created']/1000))))