I want to query the number of ArcGIS Online credits that a user has consumed in the past 24 hours. As things stand with the CreditManager, you can only query the entire organization. Could an additional parameter be added to the credit_usage method whereby you can specify a specific user or list of users?
Michael,
It doesn't look like it's possible to query credit usage per user at this time using the ArcGIS API for Python. However, I definitely see how this could be useful. Please create a new post under ArcGIS Ideas requesting this functionality.
https://community.esri.com/community/arcgis-ideas
-Josh
I tried using the code mentioned below that use this: gis.admin.usage_reports.users()
However, that was returning some bizarre results - the list was only about half of what our total user count was and it included quite a few users that were not a part of our organization. What is this used for? What is this usage report?
This is by design since the usage report tracks all the usernames who used services, including non-organization users who used publicly shared services.
Also, just to clarify, the usage_reports tool reports "usage" for users, if you need to create a credit report for users in your org, you can use gis.admin.usage_reports.credit.
For more details, please see our documentation:
https://developers.arcgis.com/python/api-reference/arcgis.gis.admin.html#agolusagereports
Best,
MJ
Michael,
You can query individual users credit consumption using gis.admin.usage_reports.users(). I have attached a simple sample.
Thanks for the example