Managing ArcGIS applications

ArcGIS administrators can leverage the gis.admin module of ArcGIS API for Python to assist with and automate their administrative tasks. These tasks can include anything from checking the status of servers, assigning licenses to named user accounts to modifying the GIS's look and feel.

ArcGIS Online Organizations (AGOL) and ArcGIS Enterprise instances vary on the amount of customization you can make. Enterprise organizations can be customized much more than ArcGIS Online organizations as Enterprise allows administrations full access. No matter what your organization is, the API and usage is identical. The table below illustrates the extent to which each can be customized and administered.

Organizational differences

Function

ArcGIS Online

ArcGIS Enterprise

collaborations

X

X

credits

X

federation

X

license

X

X

logs

X

machines

X

metadata

X

X

password_policy

X

X

security

X

server

X

site

X

system

X

ux

X

X

Most properties on ArcGIS Online are available on ArcGIS Enterprise except 'credit reporting' because ArcGIS Enterprise does not consume credits.

Note: You need to log in using a named user account with administrator privileges. When you login, the API detects if you are an organizational administrator, then, the GIS object will ensure you gain access to the admin module.

ArcGIS Online and Enterprise support assigning licenses for Esri premium apps such as ArcGIS Pro, Navigator for ArcGIS, AppStudio for ArcGIS Standard, Drone2Map for ArcGIS, ArcGIS Business Analyst web app, ArcGIS Community Analyst, GeoPlanner for ArcGIS, and other apps sold through ArcGIS Marketplace that use a per-member license type.

As an administrator, you use the gis.admin.license class of Python API to view, manage and specify which members have licenses for these apps. To learn more about named user licensing model visit manage licenses help.

If your GIS is an organization on ArcGIS Online, you would notice a credits property exposed on your admin object. You can use this to view, allocate credits to your users, set a default limit etc. To learn more about credits refer here.

Note: ArcGIS Enterprises do not support the concept of credits. Hence if your GIS is an instance of Enterprise, you would not see the `credits` property.

The credit budgeting feature of ArcGIS Online allows administrators to view, limit and allocate credits to its users. Learn more about credit budgeting here.

You can use the enable() method to turn on credit budgeting.

In [ ]:

gis.admin.credits.enable()

Out[ ]:

True

You can use the is_enabled() property to verify if credit budgeting is turned on.

In [ ]:

gis.admin.credits.is_enabled

Out[ ]:

True

Once you turn on credit budgeting, you can set a default limit for the number of credits for each user. In addition to this, you can set custom limits to users as well. Default limit applies when you create a new user and do not set a custom limit.

When you turn on credit budgeting (using the enable() method), the User object gets additional properties to indicate the assignedCredits and remaining avialableCredits. Thus, you can verify as shown below:

In [ ]:

api_acc.assignedCredits

Out[ ]:

8039.734

In [ ]:

api_acc.availableCredits

Out[ ]:

8039.734

As the user continues to use the 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.

If your GIS is an instance of ArcGIS Enterprise, you can build it up by federating (attaching) ArcGIS Server sites to your Enterprise. During this step, you can assign a role to your server - such as Hosting or Federated. You can also assign a function such as 'Raster Analysis', 'GeoAnalytics' etc. to designate it a purpose. Federating and maintaining your server bank is an important administrative task. To learn more about this topic and the implications of federation, refer here.

Note: Federation only applies to ArcGIS Enterprise orgs. If your GIS is an org on ArcGIS Online, you cannot perform these tasks

The Federation class of the admin module allows GIS administrators to script and automate tasks such as listing the serves in a GIS, identifying their role and function, federating new servers, unfederating servers under maintenance, validating the list of servers etc.

Portal for ArcGIS records events that occur, and any errors associated with those events, to logs. Logs are an important tool for monitoring and troubleshooting problems with your portal. Information in the logs will help you identify errors and provide context on how to address problems. The logs also comprise a history of the events that occur over time.

For example, the following events are recorded in the logs:

Installation and upgrade events, such as authorizing the software and creating the portal website

Publishing of services and items, such as hosted services, web maps, and data items

Security events, such as users logging in to the portal, creating, deleting, and disabling users, creating and changing user roles, updating HTTP and HTTPS settings, import and export of security certificates, and updating the portal's identity store

Organization management events, such as adding and configuring groups, adding or removing users from a group, configuration of the gallery, basemaps, utility services, and federated servers, and configuring log settings and deleting logs

General events, such as updating the portal's search index and restarting the portal

Understanding log messages is important to maintain your GIS. Refer here to learn more about logging in general and here to understand what gets logged and what the messages mean.

Using the Logs class of the admin module, administrators can query and work with Portal log messages. You can query the logging level and other settings from the settings property:

One of the important tasks you carry out as an administrator is managing the security settings of your GIS. With the admin module, you can accomplish tasks such as setting the password policy, managing security certificates etc.

The SSLCertificates class provides you with a set of methods to search for certificates, import new certificates and update existing ones. The SSLCertificate object that you get when you call the get() or list() methods on this class allows you to inspect, update or export individual certificates. To learn about all the tasks that can be accomplished, refer to the API REF doc.

In [ ]:

gis.admin.security.ssl.list()

Out[ ]:

[<SSLCertificate at https://dev005223.esri.com/portal/portaladmin/security/sslCertificates/portal>,
<SSLCertificate at https://dev005223.esri.com/portal/portaladmin/security/sslCertificates/samlcert>,
<SSLCertificate at https://dev005223.esri.com/portal/portaladmin/security/sslCertificates/dev005219>]

If your GIS uses an enterprise identity store instead of the built-in, you can use the EnterpriseUsers class and EnterpriseGroups class to search for users and user groups in the enterprise user database.

As an administrator, you can manage the licenses of the Enterprise and all the apps licensed through your Enterprise using the system.licenses class of the admin sub module. This functionality is different from managing named user licenses and entitlements mentioned in the beginning of this guide. This section shows you how to import and remove entitlements for different apps, the number of named user accounts that you are licensed to create and the number remaining etc.

Calling system.licenses.properties will return a dictionary containing information about your license for using Portal for ArcGIS application. The dictionary below reveals the license is current, 12 is the number of named user accounts created so far and the 75 is the max licensed. The features dictionary reveals the details on number of level 1 and 2 users that can be created.

If a user checks out an ArcGIS Pro license for offline or disconnected use, and is unable to check it back in, you can release the license for the specified account by calling release_license() method. Learn more about offline licenses in ArcGIS Pro.

You can query the web adaptors serving the Portal for ArcGIS application using the system.web_adaptors.list() method. This returns you a list of WebAdaptor objects. You can use this object to query the properties such as IP address, version and also unregister the adaptor for maintenance.

In [ ]:

gis.admin.system.web_adaptors.list()

Out[ ]:

[<WebAdaptor at https://dev005223.esri.com/portal/portaladmin/system/webadaptors/2f3a93d7-f50b-4ce6-8244-335fbfe1dfba>]