diff --git a/guide/01-getting-started/system-requirements.ipynb b/guide/01-getting-started/system-requirements.ipynb index ed8f63abe..df03602f4 100644 --- a/guide/01-getting-started/system-requirements.ipynb +++ b/guide/01-getting-started/system-requirements.ipynb @@ -22,10 +22,10 @@ "metadata": {}, "source": [ "## Operating System \n", - "The ArcGIS API for Python 2.3.1 is compatible with 64-bit versions of Windows, macOS, and Linux.\n", + "The ArcGIS API for Python 2.4.0 release is compatible with 64-bit versions of Windows, macOS, and Linux.\n", "\n", "## Python Version\n", - "Python 3.9.x to 3.11.x is required to use the ArcGIS API for Python 2.3.1.\n", + "Python 3.10.x to 3.12.x is required to use the ArcGIS API for Python 2.3.1.\n", "\n", "## Dependencies\n", "The full power of the ArcGIS API for Python is best experienced when all its dependencies are installed. However, specific tasks such as GIS administration and content management can be accomplished with a subset of dependencies installed. See [Install with minimum Dependencies](../install-and-set-up#install-with-minimum-dependencies) to install the `arcgis` package in this manner.\n", diff --git a/guide/02-api-overview/overview24.ipynb b/guide/02-api-overview/overview24.ipynb index 0aed8b827..80469e418 100644 --- a/guide/02-api-overview/overview24.ipynb +++ b/guide/02-api-overview/overview24.ipynb @@ -107,7 +107,7 @@ "* The functionality of the _Symbology_ class has been refactored into the [`Symbols`](/python/latest/api-reference/arcgis.map.toc.html#symbols) module.\n", "* The functionality for generating renderers has been refactored into the [_SmartMappingManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.SmartMappingManager) and [_RendererManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.renderers.RendererManager) classes.\n", " * See [Smart mapping](../smart-mapping), [Advanced cartography 1](../advanced-cartography-part1) and [Advanced cartography 2](../advanced-cartography-part2) for examples.\n", - "* The functionality for exporting and printing has been refactored into the [print()](/python//api-reference/arcgis.map.toc.html#arcgis.map.Map.print) and [export_to_html()](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.export_to_html) methods of the _Map_ class." + "* The functionality for exporting and printing has been refactored into the [print()](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.print) and [export_to_html()](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.export_to_html) methods of the _Map_ class." ] }, { diff --git a/samples/03_org_administrators/manage_and_allocate_credits.ipynb b/samples/03_org_administrators/manage_and_allocate_credits.ipynb new file mode 100644 index 000000000..d1efed72f --- /dev/null +++ b/samples/03_org_administrators/manage_and_allocate_credits.ipynb @@ -0,0 +1,415 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "toc": true + }, + "source": [ + "

Table of Contents

\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Administration: Manage and Allocate Credits\n", + "\n", + "* 👟 Ready To Run!\n", + "* 🗄️ Administration\n", + "* 💰 Credit Management\n", + "\n", + "__Requirements__\n", + "* 🔒 Administrator Privileges\n", + "\n", + "Service credits are the currency used across ArcGIS and are consumed for specific transactions and types of storage such as storing features, performing analytics, and using premium content. Any ArcGIS software that interacts with ArcGIS Online can use credits. Managing credit expenditures is an important component of administering our organization.\n", + "\n", + "To get started managing our credits, let's connect to our organization:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from arcgis.gis import GIS\n", + "gis = GIS(\"home\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "There is a [CreditManager](https://developers.arcgis.com/python/api-reference/arcgis.gis.admin.html#creditmanager) instance exposed on our `gis` via `gis.admin.credits`. We can use this to view, allocate credits to our users, set a default limit etc. Run the below cell to view the total amount of credits in our organization:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "80404.89" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gis.admin.credits.credits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Managing credits through credit budgeting\n", + "The credit budgeting feature of ArcGIS Online allows administrators to view, limit and allocate credits to its users. Learn more about [credit budgeting here](http://doc.arcgis.com/en/arcgis-online/administer/configure-credits.htm).\n", + "\n", + "We can use the `enable()` method to turn on credit budgeting." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gis.admin.credits.enable()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can use the `is_enabled` property to verify if credit budgeting is turned on." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gis.admin.credits.is_enabled" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once we turn on credit budgeting, we can set a default limit for the number of credits for each user. In addition to this, we can set custom limits to users as well. Default limit applies when we create a new user and do not set a custom limit." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8000" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gis.admin.credits.default_limit" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "> __Note__: If credit budgetting is not enabled/not configured for the organization, the above value will show up as `-1`, and `some_user.assignedCredits` will also show up as `-1`. This means that there is no limit, any user can use up to the number of credits in the org." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Allocating credits to a user\n", + "We can use the `allocate()` and `deallocate()` methods to allocate custom number of credits or remove credits from any user in an organization. Let's apply this logic to ourselves. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + "
\n", + "\n", + "
\n", + "

Bio: \n", + "
First Name: Demo\n", + "
Last Name: Account\n", + "
Username:
Joined:\n", + "\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": null, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "me = gis.users.me\n", + "me" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Run the below cell to allocate 1/10th of our organization's credits to us:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "credits_alloc = gis.admin.credits.credits / 10\n", + "gis.admin.credits.allocate(username=me.username,\n", + " credits=credits_alloc)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Checking credits assigned and available to a user" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When we turn on credit budgeting, the `User` object gets additional properties to indicate the `assignedCredits` and remaining `avialableCredits`. Run the below cells to view our assigned credits and available credits:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8039.734" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "me.assignedCredits" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8039.734" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "me.availableCredits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As users in our organization continue to use credits, the `availableCredits` property can be used to check how much is available for that account. If a user does not have a limit set, then the total available credits in the org become their available credits. The account shown below as not custom limit, hence, it inherits the org's total limit. Run the below cell to check the amount of credits for an arbitrary user:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8039.734" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "some_user = gis.users.search(\"some_user\")[0]\n", + "some_user.assignedCredits" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "8039.734" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "some_user.availableCredits" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Disable credit budgeting\n", + "We can disable credit budgetting by calling the `disable()` method." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gis.admin.credits.disable()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Additional Resources\n", + "\n", + "To learn more about credit management in ArcGIS Online, see these resources:\n", + "\n", + "- http://doc.arcgis.com/en/arcgis-online/reference/credits.htm\n", + "\n", + "- https://www.esri.com/en-us/arcgis/products/arcgis-online/pricing/credits\n" + ] + } + ], + "metadata": { + "esriNotebookRuntime": { + "notebookRuntimeName": "ArcGIS Notebook Python 3 Standard", + "notebookRuntimeVersion": "7.0" + }, + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.11" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": true, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": true, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": true + } + }, + "nbformat": 4, + "nbformat_minor": 1 +}