Select to view content in your preferred language

reset agol user credits

2211
5
Jump to solution
10-07-2020 09:38 AM
RonaldVanderpool
Frequent Contributor

Greetings!

Very new to the API for Python and Python in general. I have had some success using Jupyter Notebooks to run some feature layer downloading and cloning of various items.

I wish to be able to use the same environment to admin my AGOL and not have to use the GeoJobe Admin Tools Pro.

My big need right now is help resetting AGOL user credits back to the allotted amount they had when they joined the organization; Creator 500, Field Worker 250.

Our AGOL has renewed the credits based upon the users and types currently in the Org but it is up to me to change the credits back so they start fresh again this license year.

Using the ArcGIS API for Python | ArcGIS for Developers has helped but it is cumbersome for the novice and I learn by experience as much or more than reading.

Time is also constraint for many of my workflows and the GeoNet assistance I receive has helped my learning and time usage.

Any rate, anyone have a code snippet I can incorporate in Jupyter to achieve the credit resetting of the users?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Hi Ronald Vanderpool‌,

Would you please mark it as answered if it answered your question?

Thank you.

View solution in original post

5 Replies
MehdiPira1
Esri Contributor

Hi Ronald Vanderpool‌,

The following script can bring the default limit for any user (e.g. user1) in AGOL:

cm = gis.admin.credits
defaultLimit = gis.admin.credits.default_limit
cm.allocate("user1", defaultLimit)‍‍‍

or you can reallocate any credit, in this case 100 credits is allocated to user1:

cm = gis.admin.credits
cm.allocate("user1", 100)
RonaldVanderpool
Frequent Contributor

Thank you Mehdi!

I will give it a whirl. I looked through the arcgis.gis module and never discovered gis.admin.credits. Is there another resource I should be referencing?

0 Kudos
MehdiPira1
Esri Contributor

Not a problem Ronald Vanderpool‌,

Here's the api reference link:

arcgis.gis.admin module — arcgis 1.8.2 documentation 

RonaldVanderpool
Frequent Contributor

Way cool!!

Thanks again! 🙂

0 Kudos
MehdiPira1
Esri Contributor

Hi Ronald Vanderpool‌,

Would you please mark it as answered if it answered your question?

Thank you.