arcgis.gis.admin module
Classes for administering your GIS.
The gis.admin property is dynamically set at runtime based on what kind of GIS (ArcGIS Enterprise or ArcGIS Online) anadministrator connects to.For ArcGIS Online GIS, administrators will get an instance of AGOLAdminManager from the gis.admin property.For ArcGIS Enterprise GIS , administrators will get an instance of PortalAdminManager from the gis.admin property.
AGOLAdminManager
- classarcgis.gis.admin.AGOLAdminManager(gis,ux=None,metadata=None,collaborations=None)
Bases:
object
This is the root resource for administering your online GIS. Starting fromthis root, all of the GIS’s environment is organized into ahierarchy of resources and operations.
Parameter::param gis: GIS object containing Administrative credentials:param ux: the UX object (optional):param metadata: the metadata manager object (optional):param collaborations: the CollaborationManager object (optional)
- propertycategory_schema
This resource allows for the setting and manipulating of categoryschemas.
- Returns:
CategoryManager
object
- propertycertificates
Provides access to managing the organization’s certificates.
- Returns:
CertificateManager
object
- propertycollaborations
The collaborations resource lists all collaborations in which aportal participates
- Returns:
CollaborationManager
object
- content(item_type:'ItemTypeEnum'|None=None,sort_field:str|None='created',order:str|None='asc')→Iterator[dict[str,Any]]
The portal content operation allows an administrator to return alist of all items in the organization. Only available toadministrators with a privilege to view all items in theorganization.
Parameter
Description
item_type
Optional ItemTypeEnum. The item type to filter by.
sort_field
Optional String. Field to sort by.
order
Optional String. The sort order of the return data.
- propertycredits
Manages the credits on a ArcGIS Online
- Returns:
CreditManager
object
- propertydatastore_metrics:DataStoreMetricsManager
Provides administrators information about the datastore on ArcGIS Online.
- return:
DataStoreMetricsManager
object
- history(start_date:datetime,to_date:datetime|None=None,num:int=100,all_events:bool=True,event_ids:str|None=None,event_types:str|None=None,actors:str|None=None,owners:str|None=None,actions:str|None=None,ips:str|None=None,sort_order:str='asc',data_format:str='csv',save_folder:str|None=None)
Returns a CSV file or Pandas’s DataFrame containing the login history from a start_date to the present.
Parameter
Description
start_date
Required datetime.datetime object. The beginning date to start with.
to_date
Optional datetime.datetime object. The ending date. If not provided, the querywill attempt to obtain all records till the current date.
num
Optional Integer. The maximum number of records to return. The maximum valueis 10,000 set by the ArcGIS REST API. If the value of -1 is provided it willattempt to get all records for the date range. The default is100.
all_events
Optional Boolean. IfTrue, all types of events are included. IfFalse, onlyactions targeted by the organization are included. When exporting ascsv thisparameter isTrue.
event_id
Optional String. Filter events by specific target user name or target ID in a batch result set.It can be the ID of an item, a group, a role, a collaboration, an identityprovider, and so on.
event_types
Optional String. Filter events by a comma-separated list of target types in abatch result set.
- Values: a (organization), c (collaboration), cp (collaboration participate),
cpg (collaboration participate group), cw (collaboration workspace),cwp (collaboration workspace participate), g (group), i (item),idp (identity provider), inv (invitation), r (role), u (user)
actors
Optional String. Comma separated list of usernames.
owners
Optional String. Filter events by a comma-separated list of user names who ownthe action targets in a batch result set.
actions
Optional String. Comma separated list of actions to query for.
Values:add,addusers,create,delete,removeusers,share,unshare,update,failedlogin,login, andupdateUsers.
ips
Optional String. Filter events by a comma-separated list of IP addresses in a batch result set.
sort_order
Optional String. Describes whether the results return in ascending ordescending chronological order. The default is ascending.
Values:asc ordesc
data_format
Optional String. The default ‘csv’ value returns a comma-separate file of theresults. It is the only currently available format.
Values:csv
save_folder
Optional String. The save location of the CSV file.
- Returns:
A string representing the file path of the csv file results.
- propertyidp
This resource allows for the setting and configuration of the identity provider
- Returns:
IdentityProviderManager
object
- propertylocation_tracking
The manager for Location Tracking. See
LocationTrackingManager
- Returns:
LocationTrackingManager
object
- propertymetadata
resources to work with metadata on GIS
- Returns:
MetadataManager
object
- propertyorg_recyclebin:OrgRecycleBin
Returns the organization’s recyclebin, which will allow administratorsto manage recycled content for the whole organization.
- Returns:
OrgRecycleBin
object.
- propertypartnered_collaboration:PartneredCollabManager
Returns a manager to work with partnered collaborations
- Returns:
- scheduled_tasks(item:Item|None=None,active:bool|None=None,user:User|None=None,types:str|None=None)
This property allowsorg_admins to be able to see all scheduled tasks on the enterprise
Parameter
Description
item
Optional Item. The item to query tasks about.
active
Optional Bool. Queries tasks based on active status.
user
Optional User. Search for tasks for a single user.
types
Optional String. The type of notebook execution for the item. This can beExecuteNotebook, orUpdateInsightsWorkbook.
- Yields:
Task
- propertysocial_providers
This resource allows for the setting and configuration of the social providersfor a GIS.
- Returns:
SocialProviders
object
- propertyusage_reports
provides access to the usage reports of the ArcGIS Online organization
- Returns:
AGOLUsageReports
object
PortalAdminManager
- classarcgis.gis.admin.PortalAdminManager(url,gis=None,**kwargs)
Bases:
BasePortalAdmin
This is the root resource for administering your portal. Starting fromthis root, all of the portal’s environment is organized into ahierarchy of resources and operations. A version number is returned asa part of this resource. After installation, the portal can beconfigured using the Create Site operation. Once initialized, theportal environment is available through System and Security resources.
Parameter
Description
url
web address to portaladmin rest API (ends with: portal//sharing/rest/)
gis
GIS object containing Administrative credentials
initialize
Optional if True, properties of REST endpoint are loaded on creation of object.False (default) means they are loaded when needed.
- propertycategory_schema
This resource allows for the setting and manipulating of category schemas.
- Returns:
CategoryManager
object
- propertyclassification:ClassificationManager
Provides access to the functionality for managing the ArcGIS Enterpriseclassification schema if it has been configured.
- Returns:
An instance of the
ClassificationManager
.
- propertycollaborations
The collaborations resource lists all collaborations in which aportal participates
- Returns:
CollaborationManager
object
- content(item_type:'ItemTypeEnum'|None=None,sort_field:str='created',order:str='asc')
The portal content operation allows an administrator to return alist of all items in the organization. Only available toadministrators with a privilege to view all items in theorganization.
Parameter
Description
item_type
Optional ItemTypeEnum. The item type to filter by.
sort_field
Optional String. Field to sort by.
order
Optional String. The sort order of the return data.
- propertyfederation
provides access into the federation settings of a server.
- Returns:
Federation
object
- history(start_date:datetime,num:int=100,save_folder:str|None=None)
Returns a CSV file containing the login history from a start_date to the present.
Parameter
Description
start_date
Required datetime.datetime object. The beginning date.
num
Optional Integer. The maximum number of records to return.
save_folder
Optional String. The save location of the CSV file.
- Returns:
string
- propertyidp
This resource allows for the setting and configuration of the identity provider
- Returns:
IdentityProviderManager
object
- propertylicense
provides a set of tools to access and manage user licenses andentitlements.
- Returns:
LicenseManager
object
- propertyliving_atlas
provides a set of tools to manage and setup Living Atlas content.
- Returns:
LivingAtlas
object
- propertylocation_tracking
The manager for Location Tracking. See
LocationTrackingManager
.- Returns:
LocationTrackingManager
object
- propertylogs
returns a class to work with the portal logs
- Returns:
Logs
object
- propertymachines
This resource lists all the portal machines in a site. Each portalmachine has a status that indicates whether the machine is readyto accept requests.
- Returns:
Machines
object
- propertymetadata
returns a set of tools to work with ArcGIS Enterprise metadatasettings.
- Returns:
MetadataManager
object
- propertymode:dict
Gets/Set the mode of the ArcGIS Enterprise deployment. When obtainingthe mode, it returns information about the current state of the system.
Key
Description
read_only
Required Boolean. A boolean that specifies whether the Enterprise portal isin read-only mode. Read-only mode will block requests to modify or create anydata, including content, users, groups, or site settings.The default value is false.
message
Optional String. Sets a custom message to be displayed whenever an attempt tomodify or update content or site settings is made through the API.
>>>gis.admin.mode={'read_only':False}>>>assertgis.admin.mode['isReadOnly']==False
- propertypassword_policy
tools to manage a Site’s password policy
- Returns:
PasswordPolicy
object
- scheduled_tasks(item:Item|None=None,active:bool|None=None,user:User|None=None,types:str|None=None)
This property allowsorg_admins to be able to see all scheduled tasks on the enterprise
Parameter
Description
item
Optional Item. The item to query tasks about.
active
Optional Bool. Queries tasks based on active status.
user
Optional User. Search for tasks for a single user.
types
Optional String. The type of notebook execution for the item. This can beExecuteNotebook, orUpdateInsightsWorkbook.
- Yields:
Task
- propertysecurity
accesses the controls for the security of a local portal site
- Returns:
Security
object
- propertysite
Site is the root resources used after a local GIS is installed. Hereadministrators can create, export, import, and join sites.
- Returns:
Site
object
- propertysocial_providers
This resource allows for the setting and configuration of the social providersfor a GIS.
- Returns:
SocialProviders
object
- propertysystem
This resource provides access to the ArcGIS Web Adaptorconfiguration, portal directories, database management server,indexing capabilities, license information, and the properties ofyour portal.
- Returns:
System
object
- propertyux
returns a UX/UI manager with properties such as description, featured_content, name, etc.
- Returns:
UX
object
- propertywebhooks
Provides access to Portal’s WebHook Manager
- Returns:
WebhookManager
object
Kubernetes
KubernetesAdmin
- classarcgis.gis.kubernetes.KubernetesAdmin(url,gis)
Bases:
_BaseKube
Kubernetes Administration Class. This class is not meant to be initializeddirectly, but instead is returned by the _admin_ property on the
gis
object when logged in as an administrator.#Usage Example:>>>gis=GIS(profile="your_kubernetes_admin_profile")>>>kube_admin=gis.admin>>>kube_admin<KubernetesAdminathttps://kubenetes.example.com/arcgis/admin>
- propertycategory_schema
This resource allows for the setting and manipulating of catagory schemas.
- Returns:
CategoryManager
object
- propertyclassification:ClassificationManager
Provides access to the functionality for managing the ArcGIS Enterpriseclassification schema if it has been configured.
- Returns:
An instance of the
ClassificationManager
.
- propertycollaborations
The collaborations resource lists all collaborations in which aportal participates
- content(item_type:'ItemTypeEnum'|None=None,sort_field:str='created',order:str='asc')
The portal content operation allows an administrator to return alist of all items in the organization. Only available toadministrators with a privilege to view all items in theorganization.
Parameter
Description
item_type
Optional ItemTypeEnum. The item type to filter by.
sort_field
Optional String. Field to sort by.
order
Optional String. The sort order of the return data.
- propertydatastores:DataStores
Provides access to the _DatastoreManager_, allowing the administratorto manage registered datastores.
- Returns:
A Kubernetes
DataStores
object.
- propertyjobs:JobManager
This resource is a collection of the asynchronous
jobs
created in yourdeployment. When operations that support asynchronous executions arerun with the async option enabled, a new job entry is created thatcan be queried for its current status and messages.
- propertylicense:LicenseManager
Provides access to the
LicenseManager
,and its set of tools to access and manage user licenses andentitlements.
- propertylogs:LogManager
Accesses a
LogManager
object tomanage and query the Kubernetes logs.
- propertymetadata
Accesses the
MetadataManager
whichprovides a set of tools to work with the organization’s metadatasettings.
- propertymode:Mode
Provides access to a
Mode
objectto help manageservice deployment modes.
- propertyorganizations
Provides access to the
KubeOrganizations
object to work with the organization’s settings.
- propertyoverview:Overview
Provides access to the
overview
resource to access persisted cache or real-time information.- Returns:
Overview
object
- scheduled_tasks(item:Item|None=None,active:bool|None=None,user:User|None=None,types:str|None=None)
This method allows organization admins to see all scheduled taskson the organization.
Parameter
Description
item
Optional Item. The item to query tasks about.
active
Optional Bool. Queries tasks based on active status.
user
Optional User. Search for tasks for a single user.
types
Optional String. The type of notebook execution for the item:
ExecuteNotebook
UpdateInsightsWorkbook
- Returns:
List of
Tasks
.
- propertysecurity:KubeSecurity
Gets a
KubeSecurity
object to workwith the site’s security settings- Returns:
KubeSecurity
object.
- propertyservices
Provides access to the Kubernetes
ServicesManager
object for the site
- propertyservices_catalog
Provides access to the kubernetes
KubeServiceDirectory
work with theservices on the site.
- propertysocial_providers
Accesses the
SocialProviders
resource toallow for the setting and configuration of the social providersfor the organization.
- propertysystem:SystemManager
This is a collection of system-wide resources for your deploymentsuch as the configuration store, licenses, and deployment-widesecurity.
- Returns:
SystemManager
object.
- propertyuploads
Gets the
Uploads
object to workwith the site uploads.
- propertyusage:UsageStatistics
Provides access to the metrics viewer and metrics API tools.
- Returns:
An
UsageStatistics
object.
KbertnetesPy
- classarcgis.gis.kubernetes.KbertnetesPy(url:str,username:str=None,password:str=None,key_file:str=None,cert_file:str=None,expiration:float=60,referer:str=None,proxy_host:str=None,proxy_port:str=None,connection:Connection=None,workdir:str='/tmp',tokenurl:str=None,verify_cert:bool=True,client_id:str=None,custom_auth:requests.AuthBase=None,token:str=None,api_key:str=None,**kwargs)
Bases:
object
Kubernetes Sharing API Implementation
- add_group_users(user_names:list[str],group_id:str,admin_names:list[str])
Adds users to the group specified.
Note
This method will only work if the user for thePortal object is either an administrator for the entirePortal or the owner of the group.
- Returns:
A dictionary with a key of “not_added” which contains the users that were notadded to the group.
- add_item(item_properties:dict[str,Any],data:str|None=None,thumbnail:str|None=None,metadata:str|None=None,owner:str|None=None,folder:str|None=None)
Adds content to a Portal.
Note
That content can be a file (such as a layer package, geoprocessing package,map package) or it can be a URL (to an ArcGIS Server service, WMS service,or an application).
If you are uploading a package or other file, provide a path or URLto the file in the data argument.
From a technical perspective, none of the item properties below are required. However,it is strongly recommended that title, type, typeKeywords, tags, snippet, and descriptionbe provided.
Parameter
Description
item_properties
Required dictionary, see below for the keys and values
data
Optional string, either a path or URL to the data
thumbnail
Optional string, either a path or URL to an image
metadata
Optional string, either a path or URL to metadata.
owner
Optional string, defaults to logged in user.
folder
Optional string, content folder where placing item
Key
Value
type
Optional string, indicates type of item. See URL 1 below for valid values.
typeKeywords
Optional string list. Lists all sub-types. See URL 1 for valid values.
description
Optional string. Description of the item.
title
Optional string. Name of the item.
url
Optional string. URL to item that are based on URLs.
tags
Optional string of comma-separated values. Used for searches on items.
snippet
Optional string. Provides a very short summary of the what the item is.
extent
Optional string with comma separated values for min x, min y, max x, max y.
spatialReference
Optional string. Coordinate system that the item is in.
accessInformation
Optional string. Information on the source of the content.
licenseInfo
Optional string, any license information or restrictions regarding the content.
culture
Optional string. Locale, country and language information.
access
Optional string. Valid values: private, shared, org, or public.
commentsEnabled
Optional boolean. Default is true. Controls whether comments are allowed.
culture
Optional string. Language and country information.
overwrite
Optional boolean. Default isfalse. Controls whether item can be overwritten.
URL 1:http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000ms000000
- Returns:
The item id of the uploaded item if successful, None if unsuccessful.
- can_delete(item_id:str,owner:str,folder:str|None=None)
checks if you can delete the item.
Parameter
Description
item_id
required string, unique identifier for the item
owner
required string, owner of the item currently
folder
optional string, folder containing the item. Defaults to the root folder.
- Returns:
a tuple containing a boolean and a dict with details
- create_folder(owner:str,title:str)
Creates a folder for the given user with the given title.
Parameter
Description
owner
required string, the name of the user
title
required string, the name of the folder to create for the owner
- Returns:
a json object like the following:{“username” : “portaladmin”,”id” : “bff13218991c4485a62c81db3512396f”,”title” : “testcreate”}
- create_group(title:str,tags:list[str]|str,description:str|None=None,snippet:str|None=None,access:str='public',thumbnail:str|None=None,is_invitation_only:bool=False,sort_field:str='avgRating',sort_order:str='desc',is_view_only:bool=False,auto_join:bool=False,provider_group_name:str|None=None,provider:str|None=None,max_file_size:int|None=None,users_update_items:bool=False,display_settings:str|None=None,is_open_data:bool=False,leaving_disallowed:bool=False)
Creates a group with the values for any particular arguments that are specified.Only title and tags are required.
Parameter
Description
title
Required string. The name of the group.
tags
Required string. A comma-delimited list of tags, orlist of tags as strings.
description
Optional string. A detailed description of the group.
snippet
Optional string. A short snippet (<250 characters)that summarizes the group.
access
Optional string. Choices are private, public, or org.
thumbnail
Optional string. URL or file location to a group image.
is_invitation_only
Optional boolean. Defines whether users can join byrequest. Default is False meaning users can ask to joinby request or join by invitation.
sort_field
Optional string. Specifies how shared items withthe group are sorted.
sort_order
Optional string. Choices are asc or desc for ascendingor descending, respectively.
is_view_only
Optional boolean. Defines whether the group is searchable.Default is False meaning the group is searchable.
auto_join
Optional boolean. Only applies to org accounts. If True,this group will allow joining without requestingmembership approval. Default is False.
provider_group_name
Optional string. The name of the domain group.
provider
Optional string. Name of the provider.
max_file_size
Optional integer. This is the maximum file size allowedbe uploaded/shared to a group. Default value is: 1024000
users_update_items
Optional boolean. Members can update all items in thisgroup. Updates to an item can include changes to theitem’s description, tags, metadata, as well as content.This option can’t be disabled once the group hasbeen created. Default is False.
display_settings
Optional String. Defines the default display for thegroup page to show a certain type of items. The allowedvalues are:apps, all, files, maps, layers, scenes, tools.The default value isall.
is_open_data
Optional Boolean. Defines whether the group can be usedin the Open Data capabilities of ArcGIS Hub. The defaultis False.
leaving_disallowed
Optional boolean. Defines whether users are restrictedfrom choosing to leave the group. If True, only anadministrator can remove them from the group. The defaultis False.
- Returns:
a dict containing group properties
- create_group_from_dict(group:dict[str,Any],thumbnail:str|None=None)
Creates a group and returns a group id if successful.
Note
Use create_group in most cases. This method is useful for taking a groupdict returned from another PortalPy call and copying it.
Example
create_group({'title':'Test','access':'public'})
- create_role(name:str,description:str)
Creates a custom role with specified name and description
- Returns:
role_id if role is created, else None
- create_service(name:str,service_description:str='',has_static_data:bool=False,max_record_count:int=1000,supported_query_formats:str='JSON',capabilities:str|None=None,description:str='',copyright_text:str='',wkid:int=102100,service_type:int='imageService',create_params:dict|None=None,owner:str|None=None,folder:str|None=None,common_params:str|None=None,is_view:bool=False,item_id:str|None=None,tags:list[str]|str|None=None,snippet:str|None=None)
- Creates service.
#”Create,Delete,Query,Update,Editing”,
- Returns:
The item id of the created service item if successful, None if unsuccessful.
- delete_folder(owner:str,folder:str)
Deletes folder owned by owner with the given folder name.
Parameter
Description
owner
required string, the name of the user
folder
required string, the folder name
- Returns:
a boolean if succeeded.
- delete_group(group_id:str)
Deletes a group.
Parameter
Description
group_id
string containing the id for the group to be deleted.
- Returns
a boolean indicating whether it was successful.
- delete_item(item_id:str,owner:str,folder:str|None=None,force:bool=False,permanent:bool=False)
Deletes an item.
Parameter
Description
item_id
Required string, unique identifier for the item
owner
Required string, owner of the item currently
folder
Optional string, folder containing the item. Defaultsto the root folder.
force
Optional bool. If True, will force delete orphaned items
permanent
Optional bool. If True, item will not be sent to recycle bin.
- Returns:
a boolean, indicating success
- delete_user(username:str,reassign_to:str|None=None)
Deletes a user from the portal, optionally deleting or reassigning groups and items.
Note
You can not delete a user in Portal if that user owns groups or items. If youspecify someone in the reassign_to argument then items and groups will betransferred to that user. If that argument is not set then the methodwill fail if the user has items or groups that need to be reassigned.
Parameter
Description
username
Required string, the name of the user
reassign_to
Optional string, new owner of items and groups
- Returns:
a boolean indicating whether the operation succeeded or failed.
- generate_token(username:str,password:str,expiration:int=60)
Generates and returns a new token, but doesn’t re-login.
Note
This method is not needed when using the Portal classto make calls into Portal. It’s provided for the benefitof making calls into Portal outside of the Portal class.
Portal uses a token-based authentication mechanism wherea user provides their credentials and a short-term tokenis used for calls. Most calls made to the Portal REST APIrequire a token and this can be appended to those requests.
Parameter
Description
username
required string, name of the user
password
required password, name of the user
expiration
optional integer, number of minutes until the token expires
- Returns:
a string with the token
- get_folder_id(owner:str,folder_name:str)
Finds the folder for a particular owner and returns its id.
Parameter
Description
owner
required string, the name of the user
folder_name
required string, the name of the folder to search for
- Returns:
a boolean if succeeded.
- get_group(group_id:str)
Returns group information for the specified group group_id.
- Arguments
group_id : required string, indicating group.
- Returns:
a dictionary object with the group’s information. The keys inthe dictionary object will often include:
Key
Value
title:
the name of the group
isInvitationOnly
if set to true, users can’t apply to join the group.
owner:
the owner username of the group
description:
explains the group
snippet:
a short summary of the group
tags:
user-defined tags that describe the group
phone:
contact information for group.
thumbnail:
File name relative tohttp://<community-url>/groups/<groupId>/info
created:
When group created, ms since 1 Jan 1970
modified:
When group last modified. ms since 1 Jan 1970
access:
Can be private, org, or public.
userMembership:
A dict with keys username and memberType.
memberType:
provides the calling user’s access (owner, admin, member, none).
- get_group_content(group_id:str,max_items:int=10)
Returns members of the specified group.
- Arguments
group_id: required string, specifies the group
- Returns
a dictionary with keys: owner, admins, and users.
Key
Value
owner
string value, the group’s owner
admins
list of strings, typically this is the same as the owner.
users
list of strings, the members of the group
Example (to print items in a group)
response=portal.get_group_content("67e1761068b7453693a0c68c92a62e2e")foriinresponse["items"]:print(i)
- get_group_members(group_id:str)
Returns members of the specified group.
- Arguments
group_id: required string, specifies the group
- Returns
a dictionary with keys: owner, admins, and users.
Key
Value
owner
string value, the group’s owner
admins
list of strings, typically this is the same as the owner.
users
list of strings, the members of the group
Example (to print users in a group)
response=portal.get_group_members("67e1761068b7453693a0c68c92a62e2e")foruserinresponse['users']:printuser
- get_group_thumbnail(group_id:str)
Returns the bytes that make up the thumbnail for the specified group group_id.
- Arguments
group_id: required string, specifies the group’s thumbnail
- Returns
bytes that represent he image.
Example
response=portal.get_group_thumbnail("67e1761068b7453693a0c68c92a62e2e")f=open(filename,'wb')f.write(response)
- get_item(itemid:str)
Returns the item information for the specified item.
- Arguments
itemid required string, the item-id whose information you want.
- Returns:
None if the item is not found and returns a dictionary object if the item is foundthe dictionary has the following keys:
- get_org_roles(max_roles:int=1000)
Returns all roles within the portal organization.
- Arguments
max_roles : optional int, the maximum number of users to return.
- Returns:
a list of dicts. Each dict has the following keys:
- get_org_users(max_users:int=1000,exclude_system:bool=True,user_type:str|None=None,role:str|None=None)
Returns all users within the portal organization.
- Arguments
max_users : optional int, the maximum number of users to return.
- Returns:
a list of dicts. Each dict has the following keys:
Key
Value
username :
string
storageUsage:
int
storageQuota:
int
description:
string
tags:
list of strings
region:
string
created:
int, when account created, ms since 1 Jan 1970
modified:
int, when account last modified, ms since 1 Jan 1970
email:
string
culture:
string
orgId:
string
preferredView:
string
groups:
list of strings
role:
string (org_user, org_publisher, org_admin)
fullName:
string
thumbnail:
string
idpUsername:
string
Example (print all usernames in portal):
resp=portalAdmin.get_org_users()foruserinresp:printuser['username']
- get_user(username:str)
Returns the user information for the specified username.
- Arguments
username required string, the username whose information you want.
- Returns:
None if the user is not found and returns a dictionary object if the user is foundthe dictionary has the following keys:
Key
Value
access
string
created
time (int)
culture
string, two-letter language code (‘en’)
description
string
email
string
fullName
string
idpUsername
string, name of the user in the enterprise system
groups
list of dictionaries. For dictionary keys, see get_group doc.
modified
time (int)
orgId
string, the organization id
preferredView
string, value is either Web, GIS, or null
region
string, None or two letter country code
role
string, value is either org_user, org_publisher, org_admin
storageUsage
int
storageQuota
int
tags
list of strings
thumbnail
string, name of file
username
string, name of user
- get_version(force:bool=False)
Returns the portal version (using cache unless force=True).
Note
The version information is retrieved when you create thePortal object and then cached for future requests. If youwant to make a request to the Portal and not rely on thecache then you can set the force argument to True.
- Arguments:
force boolean, true=make a request, false=use cache
- Returns:
a string with the version. The version is an internal numberthat may not match the version of the product purchased. So2.3 is returned from Portal 10.2.1 for instance.
- invite_group_users(user_names:list[str],group_id:str,role:str='group_member',expiration:int=10080)
Invites users to a group.
Note
A user who is invited to a group will see a list of invitationsin the “Groups” tab of portal listing invitations. The usercan either accept or reject the invitation.
- Requires
The user executing the command must be group owner
Parameter
Description
user_names:
a required string list of users to invite
group_id :
required string, specifies the group you are inviting users to.
role:
an optional string, either group_member or group_admin
expiration:
an optional int, specifies how long the invitation is valid for in minutes.
- Returns:
a boolean that indicates whether the call succeeded.
- leave_group(group_id:str)
Removes the logged in user from the specified group.
- Requires:
User must be logged in.
- Arguments:
group_id: required string, specifies the group id
- Returns:
a boolean indicating whether the operation was successful.
- logged_in_user()
Returns information about the logged in user.
- Returns:
a dict with the following keys:
Key
Value
username
string
storageUsage
int
description
string
tags
comma-separated string
created
int, when group created (ms since 1 Jan 1970)
modified
int, when group last modified (ms since 1 Jan 1970)
fullName
string
email
string
idpUsername
string, name of the user in their identity provider
- login(username:str,password:str,expiration:int=60)
Logs into the portal using username/password.
Note
You can log into a portal when you construct a portalobject or you can login later. This function isfor the situation when you need to log in later.
Parameter
Description
username
required string
password
required string
expiration
optional int, how long the token generated should last.
- Returns:
a string, the token
- logout()
Logs out of the portal.
Note
The portal will forget any existing tokens it was using, allsubsequent portal calls will be anonymous until another logincall occurs.
- Returns:
No return value.
- protect_item(item_id:str,owner:str,folder:str|None=None,enable:bool=True)
Enable or disable delete protection on the item
Parameter
Description
item_id
required string, unique identifier for the item
owner
required string, owner of the item currently
folder
optional string, folder containing the item. Defaults to the root folder.
enable
optional boolean, True to enable delete protection, False toto disable it
- Returns:
dict with key “success” containing boolean whether process completed or not
- publish_item(itemid:str,data:str|None=None,text:str|None=None,fileType:str='serviceDefinition',publishParameters:dict[str,Any]|None=None,outputType:str|None=None,overwrite:bool=False,owner:str|None=None,folder:str|None=None,buildInitialCache:bool=False,item_id:str|None=None)
Publishes a hosted service based on an existing source item.Publishers can create feature services as well as tiled map services.Feature services can be created using input files of type csv, shapefile, serviceDefinition, featureCollection, and fileGeodatabase.CSV files that contain location fields, (ie.address fields or X, Y fields) are spatially enabled during the process of publishing.Shapefiles and file geodatabases should be packaged as.zip files.Tiled map services can be created from service definition (.sd) files, tile packages, and existing feature services.Service definitions are authored in ArcGIS for Desktop and contain both the cartographic definition for a map as well as its packaged data together with the definition of the geo-service to be created.Use the Analyze operation to generate the default publishing parameters for CSVs.Seehttp://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Publish_Item/02r300000080000000/
- reassign_group(group_id:str,target_owner:str)
Reassigns a group to another owner.
Parameter
Description
group_id
required string, unique identifier for the group
target_owner
required string, username of new group owner
- Returns:
a boolean, indicating success
- reassign_item(item_id:str,current_owner:str,target_owner:str,current_folder:str|None=None,target_folder:str|None=None)
Allows the administrator to reassign a single item from one user to another.
Note
If you wish to move all of a user’s items (and groups) to another user then use thereassign_user method. This method only moves one item at a time.
Parameter
Description
item_id
required string, unique identifier for the item
current_owner
required string, owner of the item currently
current_folder
optional string, folder containing the item. Defaults to the root folder.
target_owner
required string, desired owner of the item
target_folder
optional string, folder to move the item to.
- Returns:
a boolean, indicating success
- reassign_user(username:str,target_username:str)
Reassigns all of a user’s items and groups to another user.
Items are transferred to the target user into a folder named<user>_<folder> where user corresponds to the user whose items weremoved and folder corresponds to the folder that was moved.
Note
This method must be executed as an administrator. This method alsocan not be undone. The changes are immediately made and permanent.
Parameter
Description
username
Required string, user who will have items/groups transferred
target_username
Required string, user who will own items/groups after this.
- Returns:
a boolean indicating success
- remove_group_users(user_names:list[str],group_id:str)
Remove users from a group.
Parameter
Description
user_names
required string, comma-separated list of users
group_id
required string, the id for a group.
- Returns:
a dictionary with a key notRemoved that is a list of users not removed.
- reset_user(username:str,password:str,new_password:str|None=None,new_security_question:int|None=None,new_security_answer:str|None=None)
Resets a user’s password, security question, and/or security answer.
Note
This function does not apply to those using enterprise accountsthat come from an enterprise such as ActiveDirectory, LDAP, or SAML.It only has an effect on built-in users.
If a new security question is specified, a new security answer shouldbe provided.
Parameter
Description
username
Required string, account being reset
password
Required string, current password
new_password
Optional string, new password if resetting password
new_security_question
Optional int, new security question if desired
new_security_answer
Optional string, new security question answer if desired
- Returns:
a boolean, indicating success
- search(q:str,bbox=None,sort_field:str='title',sort_order:str='asc',max_results:int=1000,outside_org:bool=False,categories:str|None=None,category_filters:str|None=None)
- search_groups(q:str,sort_field:str='title',sort_order:str='asc',max_groups:int=1000,outside_org:bool=False,categories:int|None=None,filter:str|None=None)
Searches for portal groups.
Note
A few things that will be helpful to know.
The query syntax has quite a few features that can’tbe adequately described here. The query syntax isavailable in ArcGIS help. A short version of that URLishttp://bitly.com/1fJ8q31.
Most of the time when searching groups you want tosearch within your organization in ArcGIS Onlineor within your Portal. As a convenience, the methodautomatically appends your organization id to the query bydefault. If you don’t want the API to append to your queryset outside_org to True.
Parameter
Description
q
required string, query string. See notes.
sort_field
optional string, valid values can be title, owner, created
sort_order
optional string, valid values are asc or desc
max_groups
optional int, maximum number of groups returned
outside_org
optional boolean, controls whether to search outside your org
categories
optional string.
filter
optional string.
- Returns:
A list of dictionaries. Each dictionary has the following keys.
Key
Value
access
string, values=private, org, public
created
int, ms since 1 Jan 1970
description
string
id
string, unique id for group
isInvitationOnly
boolean
isViewOnly
boolean
modified
int, ms since 1 Jan 1970
owner
string, user name of owner
phone
string
snippet
string, short summary of group
sortField
string, how shared items are sorted
sortOrder
string, asc or desc
tags
string list, user supplied tags for searching
thumbnail
string, name of file. Append tohttp://<community url>/groups/<group id>/info/
title
string, name of group as shown to users
- search_users(q:str,sort_field:str='username',sort_order:str='asc',max_users:int=1000,outside_org:bool=False,exclude_system:bool=True,user_type:str|None=None,role:str|None=None)
Searches portal users.
This gives you a list of users and some basic informationabout those users. To get more detailed information (such as role), youmay need to call get_user on each user.
Note
A few things that will be helpful to know.
The query syntax has quite a few features that can’tbe adequately described here. The query syntax isavailable in ArcGIS help. A short version of that URLishttp://bitly.com/1fJ8q31.
Most of the time when searching groups you want tosearch within your organization in ArcGIS Onlineor within your Portal. As a convenience, the methodautomatically appends your organization id to the query bydefault. If you don’t want the API to append to your queryset outside_org to True. If you use this feature with anOR clause such as field=x or field=y you should put thisinto parenthesis when using outside_org.
Parameter
Description
q
required string, query string. See notes.
sort_field
optional string, valid values can be username or created
sort_order
optional string, valid values are asc or desc
max_users
optional int, maximum number of users returned
outside_org
optional boolean, controls whether to search outsideyour org
exclude_system
Optional boolean. Controls if built-in system accounts arereturned or not. True means built-in account are notreturned, where as False means that they are.
user_type
Optional String. Ability to filter users by the assignedtype of user account.
role
Optional String. Filters user by assigned role.
- Returns:
A a list of dictionary objects with the following keys:
Key
Value
created
time (int), when user created
culture
string, two-letter language code
description
string, user supplied description
fullName
string, name of the user
modified
time (int), when user last modified
region
string, may be None
tags
string list, of user tags
thumbnail
string, name of file
username
string, name of the user
- share_item(item_id:str,owner:str,folder:str|None=None,everyone:bool=False,org:bool=False,groups:str='',allow_members_to_edit:bool=False)
Shares an item with the specified list of groups
Parameter
Description
item_id
Required string, unique identifier for the item
owner
Required string, owner of the item currently
folder
Optional string, folder containing the item.Defaults to the root folder.
everyone
Optional boolean, share with everyone
org
Optional boolean, share with the organization
groups
Optional string,Comma-separated list of group IDs with which the item willbe shared.
allow_members_to_edit
Optional boolean to allow item to be shared with groupsthat allow shared update
- Returns:
Dictionary with key “notSharedWith” containing array of groups with which the item could not be shared.
- share_item_as_group_admin(item_id:str,groups:str='',allow_members_to_edit:bool=False)
Shares public item with the specified list of groups belonging to caller
- Returns:
dict with key “notSharedWith” containing array of groups with which the item could not be shared.
- signup(username:str,password:str,fullname:str,email:str)
Signs up users to an instance of Portal for ArcGIS.
Note
This method only applies to Portal and not ArcGISOnline. This method can be called anonymously, butkeep in mind that self-signup can also be disabledin a Portal. It also only creates built-inaccounts, it does not work with enterpriseaccounts coming from ActiveDirectory or yourLDAP.
There is another method called createUser thatrequires administrator access that can alwaysbe used against 10.2.1 portals or later thatcan create users whether they are builtin orenterprise accounts.
Parameter
Description
username
required string, must be unique in the Portal, >4 characters
password
required string, must be >= 8 characters.
fullname
required string, name of the user
email
required string, must be an email address
- Returns:
a boolean indicating success
- unshare_item(item_id:str,owner:str,folder:str|None=None,groups:str='')
Stops sharing the item with the specified list of groups
Parameter
Description
item_id
Required string, unique identifier for the item
owner
Required string, owner of the item currently
folder
Optional string, folder containing the item. Defaults to the root folder.
groups
Optional string,comma-separated list of group IDs with which the item will be unshared.
- Returns:
dict with key “notUnsharedFrom” containing array of groups from which the item could not be unshared.
- unshare_item_as_group_admin(item_id:str,groups:str='')
Stops sharing public item with the specified list of groups belonging to caller
Parameter
Description
item_id
required string, unique identifier for the item
groups
optional string,comma-separated list of group IDs with which the item will be unshared.
- Returns:
dict with key “notUnsharedFrom” containing array of groups from which the item could not be unshared.
- update_group(group_id:str,title:str|None=None,tags:list[str]|str|None=None,description:str|None=None,snippet:str|None=None,access:str|None=None,is_invitation_only:bool|None=None,sort_field:str|None=None,sort_order:str|None=None,is_view_only:bool|None=None,thumbnail:str|None=None,max_file_size:int|None=None,users_update_items:str|None=None,clear_empty_fields:bool=False,display_settings:str|None=None,is_open_data:bool=False,leaving_disallowed:bool=False,hidden_members:bool=False,membership_access:str|None=None,autojoin:bool=False)
Updates a group.
Note
Only provide the values for the arguments you wish to update.
- Returns:
a boolean indicating success
- update_item(itemid:str,item_properties:dict[str,Any]|None=None,data:str|None=None,thumbnail:str|None=None,metadata:str|None=None,owner:str|None=None,folder:str|None=None,large_thumbnail:str|None=None)
Updates an item in a Portal.
Note
That content can be a file (such as a layer package, geoprocessing package,map package) or it can be a URL (to an ArcGIS Server service, WMS service,or an application).
If you are uploading a package or other file, provide a path or URLto the file in the data argument.
Only pass in arguments for properties you want to update.All other properties will be left as they are. If youwant to update description, then only providethe description argument in item_properties.
Parameter
Description
item_properties
Optional dictionary, see below for the keys and values
data
Optional string, either a path or URL to the data
thumbnail
Optional string, either a path or URL to an image
metadata
Optional string, either a path or URL to metadata.
owner
Optional string, defaults to logged in user.
folder
Optional string, content folder where placing item
large_thumbnail
Optional string, either a path or URL to an image
Key
Value
type
Optional string, indicates type of item. See URL 1 below for valid values.
typeKeywords
Optional string list. Lists all sub-types. See URL 1 for valid values.
description
Optional string. Description of the item.
title
Optional string. Name of the item.
url
Optional string. URL to item that are based on URLs.
tags
Optional string of comma-separated values. Used for searches on items.
snippet
Optional string. Provides a very short summary of the what the item is.
extent
Optional string with comma separated values for min x, min y, max x, max y.
spatialReference
Optional string. Coordinate system that the item is in.
accessInformation
Optional string. Information on the source of the content.
licenseInfo
Optional string, any license information or restrictions regarding the content.
culture
Optional string. Locale, country and language information.
access
Optional string. Valid values: private, shared, org, or public.
commentsEnabled
Optional boolean. Default is true. Controls whether comments are allowed.
culture
Optional string. Language and country information.
URL 1:http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000ms000000
- Returns:
a boolean, that indicates success.
- update_user(username:str,access:str|None=None,preferred_view:str|None=None,description:str|None=None,tags:list[str]|str|None=None,thumbnail:str|None=None,fullname:str|None=None,email:str|None=None,culture:str|None=None,region:str|None=None,user_type:str|None=None)
Updates a user’s properties.
Note
Only pass in arguments for properties you want to update.All other properties will be left as they are. If youwant to update description, then only providethe description argument.
Parameter
Description
username
Required string, name of the user to be updated.
access
Optional string, values: private, org, public
preferred_view
Optional string, values: Web, GIS, null
description
Optional string, a description of the user.
tags
Optional string, comma-separated tags for searching
thumbnail
- Optional string, path or url to a file. can be PNG, GIF,
JPEG, max size 1 MB
fullname
Optional string, name of the user, only for built-in users
email
Optional string, email address, only for built-in users
culture
Optional string, two-letter language code, fr for example
region
Optional string, two-letter country code, FR for example
- Returns:
a boolean indicating success
- update_user_role(username:str,role:str)
Updates a user’s role.
Note
There are three types of roles in Portal - user, publisher, and administrator.A user can share items, create maps, create groups, etc. A publisher cando everything a user can do and create hosted services. An administrator cando everything that is possible in Portal.
Parameter
Description
username
required string, the name of the user whose role will change
role
required string, one of these values org_user, org_publisher, org_admin
- Returns:
a boolean, that indicates success
KubeServiceDirectory
- classarcgis.gis.kubernetes._server.KubeServiceDirectory(url:str,gis:GIS)
Bases:
_BaseKube
A representation of the Kubernetes Hosting Service Directory.
This is a private method and should not be created by a user.
- publish_sd(sd_file:str,folder:str|None=None,service_config:dict|None=None)
Publishes a service definition file to ArcGIS Server.
Parameter
Description
sd_file
Required string. The service definition file to be uploaded and published.
folder
Optional string. The folder in which to publish the service definitionfile to. If this folder is not present, it will be created. Thedefault is None in which case the service definition will be publishedto the System folder.
service_config
Optional Dict[str, Any]. A set of configuration overwrites that overrides the service definitions defaults.
- Returns:
A boolean indicating success (True) or failure (False).
WebAdaptorManager
- classarcgis.gis.kubernetes.WebAdaptorManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides access to the web adaptor resources defined on the ArcGISEnterprise.
- propertyconfiguration
This resource is a collection of configuration properties that applyto the ArcGIS Enterprise on Kubernetes Web Adaptor configured with your deployment.The only supported property is sharedKey, which represents credentialsthat are shared with the web adaptor. The web adaptor will use these credentialsto communicate with your deployment.
- unregister_adaptor(adaptor_id:str)
This operation unregisters an ArcGIS Enterprise on Kubernetes Web Adaptorfrom your deployment. Once a web adaptor has been unregistered, theweb adaptor will no longer be trusted and its credentials will not beaccepted. This operation is typically used when you want to registera new ArcGIS Enterprise on Kubernetes Web Adaptor or when the previousone needs to be updated.
Parameter
Description
adaptor_id
Required string. The web adaptor to unregister.
ArchitectureManager
- classarcgis.gis.kubernetes.ArchitectureManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides access to the architecture resources defined on the ArcGISEnterprise.
- propertydevelopment:dict[str,Any]
The development architecture profile is designed for use innonproduction environments, including those for testing andevaluation, and requires the least amount of hardware andresources. This profile prioritizes replicated pods for publishingtools and the private ingress controller, setting replicas forboth pods at 2. All other pod replicas are set as 1.
- Returns:
Dict[str, Any]
- propertyenhanced:dict[str,Any]
The enhanced-availability architecture profile is designed for usein business or mission-critical production environments. Thisprofile is designed for the highest level of availability, as itincludes increased and expanded redundancy across critical pods. Asa high-availability profile, enhanced-availability provides continueduse and availability in the event of a failure. However, of theavailable profiles, the hardware requirements are the highest.
- Returns:
Dict[str, Any]
- propertystandard:dict[str,Any]
The standard-availability architecture profile is designed for usein production environments and those wanting to minimize unplanneddowntime with redundancy across many pods. As a high-availabilitypod, standard-availability provides continued use and availabilityin the even of a failure, and requires less hardware thanenhanced-availability.
- Returns:
Dict[str, Any]
ExternalContentManager
- classarcgis.gis.kubernetes.ExternalContentManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides management of the external content resources.
- propertyexternal_content:dict[str,Any]
The external_content resource returns whether access to externalcontent has been enabled or disabled for an organization. If theresource returns true, an organization’s Esri content will containexternal URLs that reference sites and resources hosted outside ofthe organization. If the resource returns false, Esri contentcontaining external URLs will be removed from the organization. AnyEsri content remaining after external content is disabled will notcontain external URLs. If you are configuring ArcGIS Enterprise onKubernetes in an environment in which no internet connection isavailable, or internet access is prohibited, access to externalcontent should be disabled to avoid discovering content containinginaccessible URLs to external sites.
- Returns:
dict[str,Any]
LanguageManager
- classarcgis.gis.kubernetes.LanguageManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides management of the language resources. The languages resourceprovides a list of current languages for an organization.
- propertylanguages:Dict[str,bool]
This resource returns a list of all Esri supported languages andtheir associated language codes, as well as the current status ofthe language, either enabled (true) or disabled (false). After yourorganization has been configured, English (language code en) willbe the only enabled language by default. Additional languages canbe enabled using the Add operation. Once enabled, the Esri providedcontent for these languages will be searchable and accessible tousers in your organization. Enabled languages can be disabled usingthe Remove operation, which will remove their Esri provided contentfrom the organization. Note that at least one language must alwaysbe enabled for your organization.
- Returns:
Dict[str, bool]
DataStores
- classarcgis.gis.kubernetes.DataStores(url,gis,initialize=False)
Bases:
_BaseKube
- add(item:str|Item,options:dict[str,Any]|None=None,sync:bool|None=None)→dict[str,Any]|None
Registers a new data item with the data store.
Parameter
Description
item
Required string. The dictionary representing the data item.Seehttp://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000001s9000000
- Returns:
The data item if registered successfully, None otherwise.
- propertyconfig
Gets/Sets information on the data store’s configuration propertiesthat affect the behavior of the data holdings of the server.
Parameter
Description
config
Required string. A JSON string containing the data store configuration.
- Returns:
dict
- search(parent_path=None,ancestor_path=None,types=None,id=None,is_managed=None,json=False,**kwargs)
Use this operation to search through the various data items that are registered in the server’s data store.
Parameter
Description
parent_path
Optional string. The path of the parent under which to find items.
ancestor_path
Optional string. The path of the ancestor under which to find items.
types
Optional string. A filter for the type of the items (for example, fgdb or folder or egdb).
id
Optional string. A filter to search by the ID of the item.
is_managed
Optional Boolean. Specifies if the data store is system managed.
json
Optional Boolean. IfTrue, the results will be returned as the rawJSON response.False, the response will be a list ofDataStoreobjects. The default isFalse.
- Returns:
A list of the items found matching the search criteria.
- validate(item:Dict[str,Any])→bool
Validates that the path (for file shares) or connection string (fordatabases) for a specific data item is accessible to every servernode in the site by checking against the JSON representing the dataitem, ensuring that the data item can be registered and usedsuccessfully within the server’s data store.
Validating a data item does not automatically register it for you.You need to explicitly register your data item by invoking theregister operation.
Parameter
Description
item
Required string. The JSON representing the data item.Seehttp://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000001s9000000
DataStore
Deployment
- classarcgis.gis.kubernetes.Deployment(url:str,gis:GIS)
Bases:
object
This represents a single deployment microservice.
- edit(props:Dict[str,Any])→bool
edit allows you to edit the scaling (replicas) and resourceallocation (resources) for a specific microservice within yourdeployment.
Parameter
Description
props
Required Dict[str, Any]. he microservice properties, represented as a dictionary.
- Returns:
Boolean. True if successful else False.
Job
- classarcgis.gis.kubernetes.Job(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
A Kubernetes asynchronous opertion
JobManager
- classarcgis.gis.kubernetes.JobManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides access to the jobs resources defined on the ArcGISEnterprise.
Backup
- classarcgis.gis.kubernetes.Backup(url:str,gis:GIS)
Bases:
_BaseKube
- restore(store_name:str,passcode:str)→bool
Restores the organization to the state it was in when the backupwas created. Once completed, any existing content and data will bereplaced with what was contained in the backup.
Parameter
Description
store_name
Required String. The name of the store the backup was copied to.
passcode
Required String. The passcode used to encrypted the backup. Thispasscode must be the same as the one used when creating the backup.
- Returns:
Boolean. True if successful else False.
BackupStoresManager
- classarcgis.gis.kubernetes.BackupStoresManager(url:str,gis:GIS)
Bases:
object
Manages the backup stores with the deployments
BackupStore
- classarcgis.gis.kubernetes.BackupStore(url:str,gis:GIS)
Bases:
_BaseKube
- update(settings:dict[str,Any])→bool
Update only supports setting the backup store as the default store for your deployment {“default”: true}.
Parameter
Description
settings
Required dict[str, Any]. A JSON object of backup store settings.At 10.9.1, the only supported setting is the default property.Setting the default property as true will mark the backup store asthe default store for your deployment.
- Returns:
bool
RecoveryManager
- classarcgis.gis.kubernetes.RecoveryManager(url:str,gis:GIS)
Bases:
_BaseKube
Allows an administrator the ability to manage disaster recovery settings
- backup(name:str,store_name:str,passcode:str,description:str|None=None)→Dict[str,Any]
Creates a backup that can be restored in the event of data loss,data corruption, or deployment failures. Backups are stored in adesignated backup store.
Parameter
Description
name
Required String. The unique name of the backup.
store_name
Required String. The name of the backup store to save in.
passcode
Required String. A passcode that will be used to encrypt the contentof the backup. When restoring a backup, this passcode must be passedin. The passcode must be at least eight characters in length.
description
Optional String. A description of the backup.
- Returns:
Dict[str, Any]
- propertybackup_status:Dict[str,Any]
This resource returns the status of a current, or previouslyexecuted, backup.
- Returns:
Dict[str, Any]
- propertybackups:List[Backup]
Returns the backups that have been created of an organization.
- Returns:
List[Backup]
- propertybackupstores:BackupStoresManager
Manages the backup stores registered with the deployment
- Returns:
BackupStoresManager
- register(name:str,credentials:Dict[str,str],root:str,storage_config:Dict[str,str],is_default:bool|None=False)→BackupStore
This method registers a backup store.
Parameter
Description
name
Required String. The unique name of the backup store.
credentials
Required Dict[str, str]. The credentials of the configuration store.
root
Required String. The root directory of the store.
storage_config
Required Dictionary. A dictionary describing the storageconfiguration for the backup store.
is_default
Optional Bool. Determines if the store will be the default backupstore. The default isFalse.
- Returns:
BackupStore
- propertysettings:Dict[str,Any]
Gets/Sets the currently configured disaster recovery settings.
Parameter
Description
value
Required Dict[str, Any]. Dictionary describing disaster recoverysettings.
- Returns:
Dict[str, Any]
- propertystores:List[BackupStore]
Returns the backup stores that are registered with your deployment.
- Returns:
List[BackupStore]
LicenseManager
- classarcgis.gis.kubernetes.LicenseManager(url:str,gis:GIS)
Bases:
_BaseKube
The license manager for the Kubernetes deployment.
- load(license_file:str,overwrite:bool)→bool
load imports and applies an ArcGIS Server authorization file. Bydefault, this operation will append authorizations from theimported license file to the current authorizations. Optionally,you can select the overwrite option to fully replace the currentauthorizations with those from the imported license file.
Parameter
Description
license_file
Required string. The ArcGIS Server authorization file (either in.epc or .prvc file format).
overwrite
Required bool. Specifies whether the authorizations in the importedlicense file will fully replace or be appended to the currentauthorizations. If true, the authorizations from the importedlicense file will replace the current authorizations. If false, theauthorizations from the imported license file will be appended tothe current authorizations.
- Returns:
Boolean. True if successful else False.
LogManager
- classarcgis.gis.kubernetes.LogManager(url,gis,initialize=False)
Bases:
_BaseKube
Helper class for the management of Kubernetes logs by administrators.
Logs are the transaction records written by the various componentsof ArcGIS Server. You can query the logs, change various log settings,and check error messages for helping to determine the nature of an issue.
- clean(start_time=None,end_time=None,level=None)
Deletes all the log files on all server machines in the site. This is an irreversibleoperation.
This operation forces the server to clean the logs, which has the effect of freeing up disk space. However, it is not required that you invoke this operation because the server periodically purges old logs.
Parameter
Description
start_time
Optional String. The date associated with a log, in timestamp format(yyyy-mm-ddThh:mm:ss). If specified, logs created after this timewill be deleted. When the endTime parameter is also defined, onlylogs created between the date range will be deleted. Whenlog_levelis added to the request with a date range specified, only logs thatmatch the selected level and were created within the defined daterange will be deleted.
end_time
Optional String. The date associated with a log, in timestampformat (yyyy-mm-ddThh:mm:ss). If specified, logs created before thistime will be deleted. When the startTime parameter is also defined,only logs created between the date range will be deleted. Whenlog_level is added to the request with a date range specified,only logs that match the selected level and were created within thedefined date range will be deleted.
level
Optional String. The level of logs that will be deleted. If nooption is selected, all log messages will be deleted.
Values: SEVERE | WARNING | INFO | FINE | VERBOSE | DEBUG
- Returns:
A boolean indicating success (True) or failure (False).
- edit(level='WARNING')
Provides log editing capabilities for the entire site.
Parameter
Description
level
Optional string. The log level. Can be one of (in severity order):OFF, DEBUG, VERBOSE, FINE, INFO, WARNING, SEVERE. The default is WARNING.
- Returns:
Boolean. True if successful else False.
- export(query:str|None=None,start_time:datetime|None=None,end_time:datetime|None=None,level:str='WARNING',log_code:str|None=None,users:list[str]|None=None,request_ids:str|None=None,service_types:str|None=None,source:str|None=None,stack_traces:bool=False,out_folder:str|None=None)→str
The export operation exports organization logs based on either queryor search parameters. Using the query filter parameters, you canaggregate and filter through logs for your deployment. Using thesearch parameters, you can search for specific log records. Oncecompleted, a .zip file of the exported logs is uploaded to theuploads directory, which can be downloaded from the URL providedwith the success response. If necessary, the export operation canbe invoked multiple times to acquire additional logs.
Parameter
Description
query
Optional string. The search terms used to query your organization’slogs. This parameter supports keywords (for example, completed) andphrases (for example, completed successfully).
start_time
Optional datetime. The oldest time to query logs against, formatted aseither a timestamp (yyyy-mm-ddThh:mm:ss) or milliseconds from epoch.The default is the beginning of all recorded logs.
end_time
Optional datetime. The most recent time to query against, formatted aseither a timestamp (yyyy-mm-ddThh:mm:ss) or milliseconds from epoch.The default is the current date.
level
Optional string. Gets only the records with a log level at or moresevere than the level declared here. Can be one of (in severityorder): DEBUG, VERBOSE, FINE, INFO, WARNING, SEVERE. Thedefault is WARNING.
log_code
Optional String. Specifies the log codes assigned to the logs. Whenspecified, query will return logs associated with those codes.
users
Optional list[str]. The username(s) of a user within the organizationthat can be used to further filter log results.
example:>>> users = [“user1”, “user2”]>>> logs.export(users=users)
request_ids
Optional String. An ID assigned to a specific server event.
service_types
Optional String. The service type of a service within theorganization that can be used to further filter query results.
- Note: Currently, only MapServer, GPServer, and FeatureServer are the
only supported service types.
source
Optional String. The source of logged events.
stack_traces
Optional Boolean. IfTrue the stack trace is returned.
out_folder
Optional string. The save folder location.
- query(start_time=None,end_time=None,level='WARNING',log_code=None,users=None,request_ids=None,service_types=None,source=None,show_stack_traces=True,num=1000)
The query operation on the logs resource provides a way toaggregate, filter, and page through logs across the entire site.
Parameter
Description
start_time
Optional string. The oldest time to query logs against, formatted aseither a timestamp (yyyy-mm-ddThh:mm:ss) or milliseconds from epoch.The default is the beginning of all recorded logs.
end_time
Optional string. The most recent time to query against, formatted aseither a timestamp (yyyy-mm-ddThh:mm:ss) or milliseconds from epoch.The default is the current date.
level
Optional string. Gets only the records with a log level at or moresevere than the level declared here. Can be one of (in severityorder): DEBUG, VERBOSE, FINE, INFO, WARNING, SEVERE. Thedefault is WARNING.
log_code
Optional String. Specifies the log codes assigned to the logs. Whenspecified, query will return logs associated with those codes.
users
Optional String. The username of a user within the organization thatcan be used to further filter log results.
request_ids
Optional String. An ID assigned to a specific server event.
service_types
Optional String. The service type of a service within theorganization that can be used to further filter query results.
- Note: Currently, only MapServer, GPServer, and FeatureServer are the
only supported service types.
source
Optional String. The source of logged events.
show_stack_traces
Optional Boolean. IfTrue the stack trace is returned.
num
Optional Int. The maximum number of log records to be returned bythis query. The default messages per page is 1000. The limit forthis parameter is 10000 records.
- Returns:
A JSON of the log items that match the query. If export option is set to True, theoutput log file path is returned.
- refresh_index()→bool
Recreates the log indexes and can be used to troubleshoot issuesrelated to accessing logs, such as if new logs are not beinggenerated or if existing logs are unavailable.
- Returns:
Boolean. True if successful else False.
- search(query:str,sort_by:str='bestMatch',sort_order:str='desc',show_stack:bool=False,return_count:bool=False)→int|List[Dict[str,Any]]
Allows after to search your organization’s logs for specific log records.
Parameter
Description
query
Required String. The search terms used to query your organization’slogs. This parameter supports keywords (for example, completed) andphrases (for example, completed successfully).
sort_by
Optional String. Specifies the way in which search results aresorted. Sorting bybestMatch returns the results that best matchthequery values. Sorting bytime sorts the search results bythe time information recorded in the log’s time stamp, the orderof which is determined by thesort_order parameter.
Values:bestMatch ortime
sort_order
Optional String. The sort order for the results, either descendingor ascending. This parameter is ignored if sort_by is set tobestMatch.
Values:desc orasc
show_stack
Optional Boolean. Specifies whether stack traces are included in thesearch results. The default is false.
return_count
Optional Boolean. If true, only returns a count of the logs thatwould be returned by the search operation. If false, the responseincludes the search results in full. The default is false.
- Returns:
If return_count==False, the messages as a list are returned, else an Integer
Mode
- classarcgis.gis.kubernetes.Mode(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
- update(read_only:bool,description:str|None=None)→Dict[str,str]
Updates the site’s mode to set it in read only
Parameter
Description
read_only
Required Boolean. If True, the organization will be in read only mode. False it is in write mode.
description
Optional String. Sets a custom message to be displayed whenever an attempt to modify or update content or site settings is made through the API. If no custom message is provided, a default response is used.
- Returns:
Boolean. True if successful else False.
Overview
- classarcgis.gis.kubernetes.Overview(url:str,gis:GIS)
Bases:
_BaseKube
- propertyconfig:Dict[str,Any]
Gets/sets a dictionary of resource types that correspond with theOverview class. It contains the update interval for eachproperty.
Parameter
Description
resource
Required Dictionary. A dictionary object containing theid,type,andupdateIntervalMin for an overview resource type, returned bythe config resource. The accepted values forupdateIntervalMin(0-60) can be modified to update the interval (in minutes) of whichthe resource type will have it’s information pulled and cached. Ifset to 0, information for the resource type will not be cached andwill, instead, have it’s real-time information returned when theoverview resource is called. The default values for each resourcetype are listed below:
criticalLogs: 0
systemServices: 1
utilityServices: 1
dataStores: 2
- Returns:
Dict[str, Any]
- get(resource:str|None=None)→Dict[str,Any]
Theget returns the persisted cache or real-timeinformation, such as health or status information, for the overviewresource types, and is what is called when the Overview page of theEnterprise Manager is updated. Whether the information is cached orreturned in real-time depends on the updateIntervalMin propertyreturned by the config resource, which specifies the interval (inminutes) from which information for each resource type is pulledand cached.
Resource types that have an updateIntervalMin value of 0 will nothave their information cached and, instead, will have real-timeinformation returned when the resource is called. The updateinterval can me modified through the update operation.
Parameter
Description
resource
Optional String. Specifies the resource type (criticalLogs,dataStores, systemServices, utilityServices) that will have theirinformation returned. Using all as the input value will returninformation for all resource types.
The default isNone. WhenNone, all resources will be returned.
- Returns:
Dict[str, Any]
KubeEnterpriseGroups
- classarcgis.gis.kubernetes.KubeEnterpriseGroups(url:str,gis:GIS)
Bases:
object
This resource is an umbrella for operations that inventory yourorganization’s groups, such as retrieving a list of users within aspecific group or listing which groups a specific user is assigned to.The groups resource returns the total number of enterprise groups inthe system.
- find_within_groups(name:str,query:str=None,max_count:int=1000)
This operation returns a list of users that are currently assigned to the enterprise group within the enterprise user and group stores.
Parameter
Description
name
Required String. The name of the group.
query
Optional String. Text to narrow down the user search.
max_count
Optional Integer. The maximum number of recrods that the client will accept.
- get_user_groups(username:str,query:str=None,max_count:int=1000)→dict
This operation searches groups in the configured role store. You can narrow down the search using thequery parameter.
Parameter
Description
username
Required String. The username to examine.
query
Optional String. Text to narrow down the user search.
max_count
Optional Integer. The maximum number of recrods that the client will accept.
- Returns:
dict
- refresh_membership(groups:List[str])→bool
This operation iterates over every enterprise account configured inyour organization and determines whether the user account is partof the input enterprise group. If there are any changes inmembership, the database and indexes are updated for each group.
Parameter
Description
groups
Required List[str]. The name of the groups to refresh.
- Returns:
bool
KubeEnterpriseUser
- classarcgis.gis.kubernetes.KubeEnterpriseUser(url,gis)
Bases:
object
TheKubeEnterpriseUser resource houses operations used to managemembers in your organization.
- create_user(username:str,password:str,first_name:str,last_name:str,email:str,user_license:str,role:str='org_user',provider:str='arcgis',idp_username:str|None=None,description:str|None=None)→bool
This operation is used to pre-create built-in or enterpriseaccounts within the portal. The provider parameter is used toindicate the type of user account.
Parameter
Description
username
Required string. The name of the user account
password
Required string. The password of the user account
first_name
Required string. The first name for the account
last_name
Required string. The last name for the account
email
Required string. The email for the account
user_license
Optional string. The user type for the account.
- Values before Enterprise 11.4: creator, editor, advanced (GIS Advanced),
basic (GIS Basic), standard (GIS Standard), viewer,fieldworker
- Values for Enterprise 11.4+: creator, contributor, fieldworker, viewer,
professionalplus, professional
role
Optional string. The role for the user account. The default value isorg_user.Values org_admin | org_publisher | org_user | org_editor (Data Editor) | viewer
provider
Optional string. The provider for the account. The default value isarcgis. Values arcgis | enterprise
idp_username
Optional string. The name of the user as stored by the enterpriseuser store. This parameter is only required if the providerparameter is enterprise.
description
Optional string. A user description
- Returns:
boolean
- refresh_membership(users:list[str])→dict
This operation iterates over every enterprise group configured inyour organization and determines whether the input user accountsbelong to any of the configured enterprise groups. If there is anychange in membership, the database and the indexes are updated foreach user account. While the portal automatically refreshes thememberships during a user login and during a periodic refresh(configured through the Update Identity Store operation), thisoperation allows an administrator to force a refresh.
Parameter
Description
users
Optional list[str]. The comma-separated list of usernames forwhom the memberships need to be refreshed.
- Returns:
dict
KubeOrganization
- classarcgis.gis.kubernetes.KubeOrganization(url,gis:GIS,**kwargs)
Bases:
object
A single organization within your deployment, allowing you to manageand update it’s licensing and security information, as well as manageit’s federated servers.
- propertyfederation:KubeOrgFederations
Returns manager to work with server federation.
- Returns:
KubeOrgFederations
- propertylicense:KubeOrgLicense
The Licenses resource returns high-level licensing details.
- Returns:
KubeOrgLicense
KubeOrganizations
- classarcgis.gis.kubernetes.KubeOrganizations(url:str,gis:GIS,initialize:bool=True)
Bases:
object
Allows for the management of organizations within the ArcGIS Enterpriseon Kubernetes deployment.
KubeOrgFederations
- classarcgis.gis.kubernetes.KubeOrgFederations(url:str,gis:GIS)
Bases:
object
Provides access to the federation of ArcGIS Server and the ability tofederate them with the organization.
- federate(url:str,admin_url:str,username:str,password:str)→bool
This operation federates either a GIS Server or ArcGIS Image Serverwith an organization. The federate operation performs a validationcheck to determine whether the provided service anddministrative URLs are accessible. If the resulting validation checkfails, a warning is returned. A SEVERE log type is also returned inthe organization’s logs. After federation, administrators will beunable to set a server role for the federated server.
Once a server has been federated with an organization, servicesthat exist on the ArcGIS Server site at the time of federation areautomatically added to the portal as items. The administrator whoperforms this operation will be assigned as the imported service’sowner and, once the operation is complete, can reassign ownershipto other members in the organization. Any subsequent itemspublished to the federated server are automatically added as itemson the portal and are owned by the user who publishes them.
Parameter
Description
url
Required string. The URL of the GIS or image server used by externalusers when accessing the server site. If you’ve added the server toyour organization’s reverse proxy server, the URL is the reverseproxy server address.
admin_url
Required string. The URL used to access the server when performingadministrative operations on the internal network. The URL must beable to be used by the organization to communicate with all serversin the site, even when one of them is unavailable.
username
Required string. The username of the primary administrator accountfor the server. If this account is disabled, you’ll need toreenable it.
password
Required string. The password of the primary administrator accountfor the server.
- Returns:
bool
- propertyservers
This resource returns detailed information about the ArcGIS Serversfederated with ArcGIS on Kubernetes. Information such as the ID andname of the server, ArcGIS Web Adaptor URL, administration URL, androle of the server.
- unfederate(server_id:str)→bool
This operation unfederates a currently federated ArcGIS Server fromyour organization. Before performing this operation, the federatedserver should be taken out of read-only mode if it was already inthat state. This operation is not applicable to the hosting serverconfigured as part of the base deployment of ArcGIS Enterprise onKubernetes.
- Returns:
Bool
- validate(server_id:str)→dict
The validate operation performs validation checks against allfederated GIS Server and ArcGIS Image Server types within yourorganization, including the hosting server that is built in with anArcGIS Enterprise on Kubernetes deployment. On completion, thisoperation returns status and accessibility information for allorganization servers. This response also includes any failuremessages from failed validation checks.
Parameter
Description
server_id
Optional String. When present the validation will occur on thatsingle server. If noserver_id is given, then all servers arevalidated.
- Returns:
dict
KubeOrgLicense
- classarcgis.gis.kubernetes.KubeOrgLicense(url:str,gis:GIS)
Bases:
object
The Licenses resource returns high-level licensing details, such as thetotal number of registered members that can be added, the currentnumber of members in the organization, the Enterprise portal version,and license manager information. This API endpoint also provides accessto various operations that allow you to manage your portal licenses foryour organization.
- export_gdb_license(out_folder:str=None)→str
The operation downloads a geodatabaseLicense.ecp file thatrepresents the authorization file needed when enabling, creating,and updating an enterprise geodatabase in ArcGIS Pro for ArcGISEnterprise on Kubernetes deployments. Accessing this operationautomatically downloads the .ecp file; no parameters are requiredand no JSON Response is returned for this operation.
Parameter
Description
out_folder
Optional string. The folder where the license file will be saved.
- Returns:
str
- import_license(license_file:str)
Applies a new license file to a specific organization, which contains the portal’s user type and add-on licenses.
Parameter
Description
license_file
Required String. The kubernetes license file. For deployments usingArcGIS Enterprise on Kubernetes 10.9.1 or earlier, this file is anArcGIS Enterprise portal license file. For deployments using ArcGISEnterprise on Kubernetes 11.0 or later, this is an ArcGIS Enterpriseon Kubernetes license file.
- Returns:
Boolean
- update_license_manager(config:dict)→bool
This operation allows you to change the license server connectioninformation for your portal, as well as register a backup licensemanager for high availability. After changing the license managerproperties, Portal for ArcGIS automatically restarts to registerchanges and set up connections with the backup license manager.
Parameter
Description
config
Required Dict. The JSON representation of the license serverconnection information.
Example:
`{"hostname":"licensemanager.domain.com,backuplicensemanager.domain.com","port":27000}`
- Returns:
Boolean
- validate(file,list_ut=False)
Thevalidate operation is used to validate an input license file.Only valid license files can be imported into the Enterpriseportal. If the provided file is valid, the operation will returnuser type, app bundle, and app information from the license file.If the file is invalid, the operation will fail and return an errormessage.
Parameter
Description
file
Required String. The kubernetes license file. For deployments usingArcGIS Enterprise on Kubernetes 10.9.1 or earlier, this file is anArcGIS Enterprise portal license file. For deployments using ArcGISEnterprise on Kubernetes 11.0 or later, this is an ArcGIS Enterpriseon Kubernetes license file.
list_ut
Optional Boolean. Returns a list of user types that are compatiblewith the Administrator role. This identifies the user type(s) thatcan be assigned to the Initial Administrator Account when creatinga portal.
- Returns:
Dict
KubeOrgSecurity
- classarcgis.gis.kubernetes.KubeOrgSecurity(url:str,gis:GIS)
Bases:
object
Allows the for the management of the security of the settings.
KubeSecurity
- classarcgis.gis.kubernetes.KubeSecurity(url:str,gis:GIS)
Bases:
object
Allows users to configure the Security settings on the kubernetes infrastructure
- propertycertificates:KubeSecurityCert
Provides access to the certificate manager for the Kubernetes infrastructure
- Returns:
A KubeSecurityCert object.
- propertyconfiguration:KubeSecurityConfig
Returns the currently active security configuration for an ArcGIS Enterprise for Kubernetes deployment
- propertyingress:KubeSecurityIngress
Returns a manager to configure the ingress settings.
- Returns:
A KubeSecurityIngress object.
- propertysaml:KubeSecuritySAML
Returns a manager to work with the SAML settings for the organization
- Returns:
KubeSecuritySAML
KubeSecurityCert
- classarcgis.gis.kubernetes.KubeSecurityCert(url:str,gis:GIS)
Bases:
object
The certificates resource provides access to child operations andresources that can be used to manage all the security certificatesconfigured with an organization.
- get_cert(cert_type:str,cert_id:str)→dict
Obtains a single certificate for a given type and ID
Parameter
Description
cert_type
Required String. The type of certificate to search for. This can be ‘trust’ or ‘identity’.
cert_id
Required String. The unique identifier of the certificate.
- Returns:
Dict
- propertyidentity_certs:list
Lists all the certificates currently configured with the organization
- Returns:
List
- load_identity_cert(pfx:str,password:str,name:str)→bool
Imports an existing identity certificate in PKCS #12 (.pfx) formatinto the keystore. An imported certificate can be assigned to theIngress controller by setting the certificate name property via theupdate operation.
- Returns:
bool
- load_trust_cert(cert:str,name:str)→bool
This operation imports a trust certificate, in either PEM(.cer or .crt files) or a binary (.der) format. Once a trustcertificate is imported, the corresponding pods that will use thecertificate are automatically restarted.
- Returns:
bool
- remove_identity_cert(cert_id:str)→bool
Deletes an Identity Certificate by ID
Parameter
Description
cert_id
Required String. The unique identifier of the certificate.
- remove_trust_cert(cert_id:str)→bool
Deletes an Identity Certificate by ID
Parameter
Description
cert_id
Required String. The unique identifier of the certificate.
KubeSecurityConfig
- classarcgis.gis.kubernetes.KubeSecurityConfig(url:str,gis:GIS)
Bases:
object
Allows the user to manage the security configuration for an ArcGIS Enterprise for Kubernetes deployment.
- test(user_store:dict=None,role_store:dict=None)→bool
Users can test the connection to a user or role (group) store.
Parameter
Description
user_store
Optional dict. Specifies the user store properties. This parameteraccepts as input all the properties as defined in theuser_store androle_store section of the Kubernetes helpdocumentation.
role_store
Optional dict. pecifies the role (group) store properties. This parameteraccepts as input all the properties as defined in theuser_store androle_store section of the Kubernetes helpdocumentation.
- Returns:
boolean
- update_stores(user_store:dict=None,role_store:dict=None)→bool
Users can modify the user or role (group) identity stores.
Parameter
Description
user_store
Optional dict. Specifies the user store properties. This parameter accepts as input all the properties as defined in the userStoreConfig and roleStoreConfig section of the Kubernetes help doctumentation.
role_store
Optional dict. pecifies the role (group) store properties. This parameter accepts as input all the properties as defined in the ArcGIS for Kubernetes help doctumentation.
- Returns:
boolean
KubeSecurityIngress
- classarcgis.gis.kubernetes.KubeSecurityIngress(url:str,gis:GIS)
Bases:
object
The ingress resource returns the currently configured securityinformation for the Ingress controller. You can update ingress securityconfiguration properties using the update operation. The updateoperation must be used when adding an imported wildcard certificate forthe Ingress controller.
KubeSecuritySAML
- classarcgis.gis.kubernetes.KubeSecuritySAML(url:str,gis:GIS)
Bases:
object
The saml resource returns information about the SAML configuration foran organization. If SAML is configured, the enabled property willreturn as true andidentityCertificateName will show the name of theimported identity certificate.
KubeService
- classarcgis.gis.kubernetes.KubeService(url,gis)
Bases:
object
A service exposes GIS resources like maps, rasters, locators,geodatabases, and so forth through REST and SOAP interfaces. The typeof the service is often dictated by the type of resources beingpublished. In addition to accessing the underlying resource, a GISservice can expose additional capabilities called extensions (or serverobject extensions). Extensions are packages of custom functionality thatcan perform business logic or expose the service through additionalformats or protocols.
- change_provider(provider:str)→bool
This operation is used to update an individual service to use eithera dedicated or shared instance type. When a qualified service ispublished, the service is automatically set to use shared instances.
When using this operation, services may populate other provider typesas values for the provider parameter, such as ArcObjects and SDS.While these are valid provider types, this operation does not supportchanging the provider of such services to either ArcObjects11 orDMaps. Services with either ArcObjects or SDS as their provider willnot be able to change their instance type.
Parameter
Description
provider
Required String. Specifies the service instance as either a shared(DMaps) or dedicated (ArcObjects11) instance type. These values are case-sensitive.
values: DMaps, ArcObjects11
- Returns:
boolean
- propertyjobs:GPJobManager|None
The jobs resource provides access to operations that locate andmonitor current asynchronous jobs being run by a geoprocessingservice. From the jobs resource, you can query for jobs usingfilters such as the start and end time for the job, the job’sstatus, or the username of the user who submitted the job.
- Returns:
JobManager
- propertyproperties:PropertyMap
To edit a service, you need to submit the complete JSON representation ofthe service, which includes the updates to the service properties. Editinga service can cause the service to be restarted with updated properties.
The edit settings of a service contains the following four sections:
Service Description Properties - Common properties that are shared by all services. These properties typically identify a specific service.
Service Framework Properties - Properties targets towards the framework that hosts the GIS service. They define the life cycle and load balancing of the service.
Service Type Properties - Properties targeted towards the core service type as seen by the server administrator. Since these properties are associated with a server object, they vary across the service types.
Extension Properties - Represent the extensions that are enabled on the service.
- Returns:
dict
- propertyscaling:Dict[str,Any]
This resource returns the scaling and resource allocation for aspecific GIS service microservice. When used to update the service,it updates the scaling (replicas min and max) and resource allocation(cpuMin, cpuMax, memoryMin, memoryMax).
Parameter
Description
value
Required Dict[str, Any]. The service scaling properties.
- Returns:
Dict[str, Any]
- propertystatus:dict
This resource provides the configured and current status of a GISservice. The configured status represents the state of the resourceas you have configured it to be. For example, starting a servicewould set its configured status to be STARTED. However, it ispossible that the configured state may not match the actual stateof the resource. The realTimeState property represents the actualstate of a service.
GPJobManager
- classarcgis.gis.kubernetes.GPJobManager(url:str,gis:GIS)
Bases:
object
The jobs resource provides access to operations that locate and monitorcurrent asynchronous jobs being run by a geoprocessing service. Fromthe jobs resource, you can query for jobs using filters such as thestart and end time for the job, the job’s status, or the username ofthe user who submitted the job.
- get_job(job_id:str)→dict
An individual job resource returns information about an asynchronousjob, either currently running or completed, for a geoprocessing service.
- query(status:list[str],start_time:datetime|None=None,end_time:datetime|None=None,username:str|None=None,number:int=10)→dict
The query operation allows you to query jobs pertaining to a geoprocessing service.
Parameter
Description
status
Required List[String]. The current status of a job. The value set withthis parameter will be used to filter the jobs by that set jobstatus.
Values:esriJobNew,esriJobSubmitted,esriJobExecuting,esriJobSucceeded,esriJobFailed,esriJobCancelling,esriJobCancelled,esriJobWaiting
start_time
Optional datetime.datetime. The earliest time to query.
end_time
Optional datetime.datetime. The most recent time to query. If unspecified, the current time will be used. If you specify a value for this parameter, you must also specify a startTime value.
username
Optional String. The name of the user who submitted the job.
number
Optional Integer. The number of jobs to display in the response. The default value is 10.
- Returns:
dict
ServicesManager
- classarcgis.gis.kubernetes.ServicesManager(url:str,gis:GIS)
Bases:
object
TheServicesManager acts as the root folder and container for allsub-folders and GIS services for your deployment. You can create anew sub-folder by using the Create Folder operation as well as a newGIS service by using the Create Service method.
- can_create(service_type:str,*,folder:str=None,service:dict=None,options:dict=None)→bool
Checks if a service can be generated. It is recommended that the usercheck if the service can be created before callingcreate_service.
Parameter
Description
service_type
Required String. The type of service to create.
folder
Optional String. The location to create the service in. If thefolderif set on theServicesManager, thefolder parameter will overridethe save location. The folder must exist before calling this method.
service
Optional Dict. The service configuration in JSON format.
options
Optional Dict. Provides additional information about the service, such as whether it is a hosted service.
- create_folder(folder:str)→bool
Creates a folder on the hosting server
Parameter
Description
folder
Required string. Name of the folder.
- Returns:
boolean
- create_service(service_json:dict=None,*,input_upload_id:str=None,folder:str=None,scaling_spec:dict=None)→bool
Creates a new GIS service in a folder (either the root or a sub-folder) bysubmitting a JSON representation of the service to this operation.
Parameter
Description
service_json
Required dict. The JSON representation of the service being created.
folder
Optional String. The location to create the service in. If thefolderif set on theServicesManager, thefolder parameter will overridethe save location. The folder must exist before calling this method.
input_upload_id
Optional String. The upload ID for a service definition thatcontains information about service properties, capabilities, and theservice type.
scaling_spec
Optional dict. The service scaling properties, represented as a JSONobject. See:https://developers.arcgis.com/rest/enterprise-administration/enterprise/create-service.htm for more information.
- Returns:
Bool
- exists(*,service_name:str=None,folder:str=None,service_type:str=None)→dict
This operation checks if a folder or service exists on the server.
- Returns:
dict
- propertyextensions:dict
Returns a collection of all the custom server object extensions that have been uploadedand registered with the deployment. A .soe file is a container of one or more server objectextensions.
- Returns:
Dict
- propertyproviders:dict
returns the supported provider types for the GIS services in your organization.
- refresh_auto_deployment(future:bool=False)→bool
This operation auto-deploys the System or Utility services if they failed to be deployedduring site creation. This operation should only be performed if either the System orUtility service fails to be created with the site.
- Returns:
Boolean
- propertyservices_properties:dict
This resource is used to provide default settings for new serviceswhen they are published to the server. You can use the updateoperation to change the default settings. However, updating thedefault properties for services won’t change the properties of anypre-existing services in your organization. To update these services,you must edit the individual service’s properties.
- Returns:
dict
Container
- classarcgis.gis.kubernetes.Container(url:str,gis:GIS)
Bases:
object
A single representation of a registered container.
Indexer
- classarcgis.gis.kubernetes.Indexer(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
This resource contains connection information to the default indexing service.
- reconfigure()→bool
This operation recreates the index service metadata, schema, and data in the event it becomes corrupted.
- Returns:
Boolean
- reindex(mode,includes=None)
The operation allows you to generate or update the indexes for content, such as users, groups, and items stored in the database store.
Parameter
Description
mode
Required String. The mode in which the indexer should run.Values: USER_MODE, GROUP_MODE, SEARCH_MODE, or FULL_MODE
includes
Optional String. A comma separated list of elements to include inthe index. This is useful if you want to only index certain itemsor user accounts.
- Returns:
Boolean
- propertystatus
status allows you to view the status of the indexing service. Youcan view the number of users, groups, and search items in both thedatabase (store) and the index. If the database and index do notmatch, indexing is either in progress or there is a problem withthe index. It is recommended that you reindex to correct anyissues. If indexing is in progress, you can monitor the status byrefreshing the page.
- Returns:
dict
Server
- classarcgis.gis.kubernetes.Server(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
Represents a single kubernetes service
ServerDefaults
- classarcgis.gis.kubernetes.ServerDefaults(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
Represents the server default values
ServerManager
- classarcgis.gis.kubernetes.ServerManager(url:str,gis:GIS|None=None,initialize:bool|None=True,**kwargs:Any|None)
Bases:
_BaseKube
Manages the Registered Servers
SystemManager
- classarcgis.gis.kubernetes.SystemManager(url,gis,initialize=False)
Bases:
object
The system resource is a collection of system-wide resources for adeployment, such as the configuration store and deployment-widesecurity.
- propertyarchitecture_profiles:ArchitectureManager
This resource returns the architecture profile that is set when an organization is configured and provides access to all three architectureprofile resources: development, standard-availability, and enhanced-availability.
- propertyexternal_content:ExternalContentManager
- propertylanguage:LanguageManager
The content resource provides access to the languages resource.The languages resource provides a list of current languages for anorganization.
- Returns:
LanguageManager
- propertylicenses:List[Dict[str,Any]]
The licenses resource lists the current license level of ArcGIS Server and all authorized extensions.
- Returns:
List[Dict[str, Any]]
- propertyliving_atlas:LivingAtlas
provides functionality to manage living atlas content
- propertyproperties:dict
Gets/Sets the system properties resource list system propertiesthat have been modified to control the portal’s environment.
Parameter
Description
value
Required dict. A dictionary of registry properties.
Allowed Key/Value:
Parameter
Description
versionManifestURL
The URL to the version manifest used in the upgrade process. This property should not be modified.
containerStartUpTimeoutSeconds
The timeout (in seconds) for the start-up of containers during the upgrade process. The default value is 900.
allowGPAndExtensionPublishingToPublishers
Introduced at 11.0. When set as true, this property allows administrators and publishers to publish geoprocessing services and extensions. By default, only administrators can publish extensions and geoprocessing services.
- Returns:
dict
- propertyrecovery:RecoveryManager
This resource allows an administrator the ability to managedisaster recovery settings.
- Returns:
RecoveryManager
- propertyservers:ServerManager
Returns a manager to work with ArcGIS Servers registerd with Kubernetes
- propertytasks:TaskManager
This resource returns a list of tasks (CleanGPJobs, BackupRetentionCleaner, CreateBackup) that exist within your deployment.
- propertyupgrades:UpgradeManager
The upgrades resource provides access to child operations andresources that are used to manage the release and patch updates thatcan be applied to an ArcGIS Enterprise on Kubernetes deployment.During the upgrade process, this resource returns detailed,real-time messages regarding the status and progress of theupgrade. While an upgrade is in progress, child operations andresources for this resource will be inaccessible. Once completed,all child endpoints will be operational, and the JSON view of theresource will contain a log of the job messages and the completionstatus.
- propertyweb_adaptors:WebAdaptorManager
The webadaptors resource lists the ArcGIS Enterprise on Kubernetes Web Adaptor configured your deployment. The web adaptor can be configured using the config operation.
TaskManager
- classarcgis.gis.kubernetes.TaskManager(url:str,gis:GIS)
Bases:
_BaseKube
Provides access to the tasks resources defined on the ArcGISEnterprise.
- create_task(item:Item,cron:str,task_type:str,occurences:int=10,start_date:datetime=None,end_date:datetime=None,title:str=None,parameters:dict=None)→Task
This operation creates scheduled tasks for your deployment that runautomatically. Once the task has been created, it can be updated usingthe Update operation. In addition, scheduled tasks can be disabled, reenabled,and deleted through other operations in the ArcGIS Enterprise Administrator API.
Parameter
Description
item
Required Item. The item to schedule a task on.
cron
Required String. The CRON statement. This should be in the from of:
<minute> <hour> <day of month> <month> <day of week>
Example to run a task weekly, use:0 0 * * 0
task_type
Required String. The type of task, either executing a notebook orupdating an Insights workbook, that will be executed against thespecified item. For notebook server tasks use:ExecuteNotebook,for Insights notebook use:UpdateInsightsWorkbook. UseExecuteSceneCook to cook scene tiles. UseExecuteWorkflowManagerto run workflow manager tasks. For data pipelines, useRunDataPipeline.
occurences
Optional Integer. The total number of instance that can run at a single time.
start_date
Optional Datetime. The begin date for the task to run.
start_date
Optional Datetime. The end date for the task to run.
title
Optional String. The title of the scheduled task.
parameters
Optional Dict. Optional collection of Key/Values that will be givento the task. The dictionary will be added to the task runrequest. This parameter is required forExecuteSceneCook tasks.
Example
```{
“service_url”: <scene service URL>,“num_of_caching_service_instances”: 2, //2 instances are required“layer”: “{<list of scene layers to cook>}”, //The default is all layers“update_mode”: “PARTIAL_UPDATE_NODES”
- Returns:
Task
- delete_run(task_id:str,run_id:str)
The delete operation removes a specified run for a scheduled task.Deleting a run also deletes corresponding resource files associated with the run.
Parameter
Description
task_id
Required string. The task to delete the run on.
run_id
Required string. The run to delete.
- delete_task(task_id:str)
This operation deletes a task. Once the task is deleted, all associated runs andresources are deleted as well.
Parameter
Description
task_id
Required string. The task to delete
- diable_task(task_id:str)
This operation disables a specific task and suspends anyupcoming runs scheduled for the task.
Parameter
Description
task_id
Required string. The task to disable
- edit_run(task_id:str,run_id:str,status:str,results)
This operation updates an existing run for a scheduled task.
Parameter
Description
task_id
Required string. The task to edit the run on.
run_id
Required string. The run to edit.
status
Required string. Set the status of the run.
- Values: “scheduled” | “executing” | “succeeded” | “skipped” | “failed”
- “submitfailed”
results
Required string. A result string for this run.
- edit_task(task_id:str,item:Item,cron:str,task_type:str,occurences:int=10,start_date:datetime=None,end_date:datetime=None,title:str=None,parameters:dict=None)
This operation allows you to edit and update the properties of a preexisting task(CleanGPJobs, BackupRetentionCleaner at 10.9.1, and CreateBackup at 10.9.1).Updates that have been made to a task will go into effect during its next scheduled execution.
Parameter
Description
task_id
Required String. The task to edit.
item
Required Item. The item to schedule a task on.
cron
Required String. The CRON statement. This should be in the from of:
<minute> <hour> <day of month> <month> <day of week>
Example to run a task weekly, use:0 0 * * 0
task_type
Required String. The type of task, either executing a notebook orupdating an Insights workbook, that will be executed against thespecified item. For notebook server tasks use:ExecuteNotebook,for Insights notebook use:UpdateInsightsWorkbook. UseExecuteSceneCook to cook scene tiles. UseExecuteWorkflowManagerto run workflow manager tasks.
occurences
Optional Integer. The total number of instance that can run at a single time.
start_date
Optional Datetime. The begin date for the task to run.
start_date
Optional Datetime. The end date for the task to run.
title
Optional String. The title of the scheduled task.
parameters
Optional Dict. Optional collection of Key/Values that will be givento the task. The dictionary will be added to the task runrequest. This parameter is required forExecuteSceneCook tasks.
Example
```{
“service_url”: <scene service URL>,“num_of_caching_service_instances”: 2, //2 instances are required“layer”: “{<list of scene layers to cook>}”, //The default is all layers“update_mode”: “PARTIAL_UPDATE_NODES”
- enable_task(task_id:str)
This operation enables a previously disabled task,setting its taskState to active.
Parameter
Description
task_id
Required string. The task to enable
- run(task_id:str,run_id:str)
This resource returns information on a specific run for a task.
Parameter
Description
task_id
Required string. The task to get the run from.
run_id
Required string. The run to get.
UpgradeManager
- classarcgis.gis.kubernetes.UpgradeManager(url:str,gis:GIS)
Bases:
_BaseKube
- available()→Dict[str,List]
This operation returns the version manifest, a cumulative list ofrelease and patch versions that have been made available to anArcGIS Enterprise organization.
- Returns:
Dict[str, List]
- propertyhistory:Dict[str,Any]
Returns the transaction history for all upgrade and rollback jobs.
- Returns:
Dict[str, Any]
- import_manifest(manifest:str)→dict
The importManifest operation allows organization administrators toimport the version manifest into a disconnected environment thatcan be used to discover available updates and releases and upgradean ArcGIS Enterprise on Kubernetes deployment. The version manifestmust be downloaded from My Esri, which requires an initial internetconnection.
Parameter
Description
manifest
Required String. The file containing the version manifest (.datfile), used to discover available updates or releases for an ArcGISEnterprise on Kubernetes deployment.
- Returns:
dict
- propertyinstalled_updates:List[Dict[str,Any]]
Returns a cumulative list of patches and releases that are installed in the deployment
- Returns:
List[Dict[str, Any]]
- rollback(version:Dict[str,Any],settings:Dict[str,str]|None=None)→Dict[str,Any]
This operation uninstalls a patch, removing the updates and fixesthat had been applied to specific containers, and restoring thedeployment to a previous, user-specified version of the software.The rollback operation cannot be performed for release-basedupdates.
Parameter
Description
version
Required Dict[str, str]. The version of the deployment the operationwill rollback towards. This value can be retrieved from therollback_options.
settings
Optional Dict[str, str]. A configuration for patch settings.This is only available at 10.9.1+.
- Returns:
Dict[str, Any]
- propertyrollback_options:List[Dict[str,Any]]
Returns a list of possible rollback options for the site, dependingon the patch that is installed. The ID for the specific rollbackversion is passed as input for therollback operation.
- Returns:
List[Dict[str, Any]]
- upgrade_settings(upgrade_id:str)→dict
The getUpgradeSettings operation returns the required upgradesettings, and their expected formats, needed for a specificrelease, applicable to ArcGIS Enterprise on Kubernetes versions11.0 and later. These settings must be passed through as values forthe upgradeSettings parameter to successfully upgrade an ArcGISEnterprise on Kubernetes deployment. Some upgrade settings mayrequire their value property to be modified before being submittedas part of the upgrade operation. For example, when upgrading anArcGIS Enterprise on Kubernetes deployment from version 10.9.1 to11.0, you will need to modify the value property for thelicenseUpload JSON object.
- upgrades(version_manifest:str,settings:dict,manifest_file:str|None=None)
The upgrade operation upgrades, through either a patch or arelease, an ArcGIS Enterprise on Kubernetes deployment to thecurrent version.
Before performing an upgrade, the unique ID associated with thepatch or release must be retrieved from the version manifest usingthe available operation. The version manifest is a JSON array ofversion objects that contain update-specific information, includinga JSON array of container objects that specify affected containersand include their name, checksum, and image values.
Once the ID has been retrieved, you must also retrieve the requiredupgrade settings that will be passed through as part of the upgradeoperation. Some settings will require user input before they can beused during an upgrade. For more information about current upgradesettings, see the Upgrade settings section below.
Once the upgrade job request has been submitted, the deploymentwill either install a new patch on the base version or upgrade theentire deployment to the latest release. While the job is running,the upgrades resource will return detailed, real-time job messagesand status information. The upgrades resource’s child operationsand resources will remain inaccessible for the duration of theupgrade.
Parameter
Description
version_manifest
Optional Dict[str, str]. The unique ID associated with a patch orrelease. You can get the version manifest ID for a patch or releasefrom the JSON view of the available operation.
settings
Optional Dict[str, str]. A JSON object containing details forrelease upgrade settings. These settings, retrieved from thegetUpgradeSettings operation, must be included in the request forthe upgrade to be successful. Currently, the object supports thefollowing three upgrade settings: updateToLatestPatch,licenseUpload, and volumesConfig. These settings are applicable toArcGIS Enterprise on Kubernetes versions 11.0 and later.
manifest_file
Optional String. The file containing the version manifest.
- Returns:
Dict[str, Any]
Uploads
- classarcgis.gis.kubernetes.Uploads(url,gis,initialize=False)
Bases:
_BaseKube
This resource is a collection of all the items that have been uploadedto the kubernetes site.
There are two ways to upload items. You can upload complete items usingthe Upload Item operation. If a particular item is made up of manychunks (parts), you need to first register the item and subsequentlyupload the individual parts using the Upload Part operation. Itemuploads are filtered by a whitelist of filename extensions. This is thedefault list: soe, sd, sde, odc, csv, txt, zshp, kmz. The default listcan be overridden by setting the uploadFileExtensionWhitelist propertywith the kubernetes site properties API.
- commit(item_id,parts=None)
Use this operation to complete the upload of all the parts thatmake an item. The parts parameter indicates to the kubernetes site all theparts that make up the item.
Parameter
Description
item_id
Required string. Item ID to commit.
parts
Optional list. An optional comma-separated ordered list of all theparts that make the item. If this parameter is not provided, thedefault order of the parts is used.
- Returns:
Boolean
- delete(item_id)
Deletes the uploaded item and its configuration.
Parameter
Description
item_id
Required string. unique ID of the item
- Returns:
boolean
- download(item_id:str)→str
Downloads a previously uploaded file.
Parameter
Description
item_id
Required string. unique ID of the item
- Returns:
str
- item(item_id)
This resource represents an item that has been uploaded to thekubernetes site. Various workflows upload items and then process them on thekubernetes site. For example, when publishing a GIS service from ArcGIS forDesktop or ArcGIS kubernetes site Manager, the application first uploads theservice definition (.SD) to the kubernetes site and then invokes thepublishing geoprocessing tool to publish the service.Each uploaded item is identified by a unique name (item_id). ThepathOnkubernetes site property locates the specific item in the ArcGISkubernetes site system directory.The committed parameter is set to true once the upload ofindividual parts is complete.
- Parameters:
- item_id:
uploaded id identifier
- upload(path,description=None)
Uploads a new item to the kubernetes site. Once the operation is completedsuccessfully, the JSON structure of the uploaded item is returned.
Parameter
Description
path
Required string. The file location to upload
description
Optional string. Description of the upload.
- Returns:
boolean
- upload_by_part(item_id,part_number,part)
Uploads a new item to the kubernetes site. Once the operation is completedsuccessfully, the JSON structure of the uploaded item is returned.
Parameter
Description
item_id
Required string. Item ID to upload to.
part_number
Required int. An integer value associated with the part.
part
Required string. File path to the part to upload.
- Returns:
dict
- propertyuploads
returns a collection of all the items that have been uploaded tothe kubernetes site.
There are two ways to upload items. You can upload complete itemsusing the Upload Item operation. If a particular item is made up ofmany chunks (parts), you need to first register the item andsubsequently upload the individual parts using the Upload Partoperation. Item uploads are filtered by a whitelist of filenameextensions. This is the default list: soe, sd, sde, odc, csv, txt,zshp, kmz. The default list can be overridden by setting theuploadFileExtensionWhitelist property with the kubernetes site properties API.
UsageStatistics
- classarcgis.gis.kubernetes.UsageStatistics(url:str,gis:GIS)
Bases:
object
Provides access to the metrics viewer and metrics API tools. As anadministrator, you can use these tools to monitor GIS service usage inyour organization for feature services, map services, tiled mapservices, geocode services, and geometry services. Information thatcan be gathered from service usage statistics include:
Historical service usage data
Peak and off-peak periods of service usage
Slowdown in response times or throughput
- update_credentials(resource:str,username:str,password:str)→bool
Updates the credentials for the metrics viewer and metrics API.
Parameter
Description
resource
Required String. Specifies whether the updated credentials will beapplied to the metrics viewer (grafana) or the metricsAPI (prometheus).
Values:grafana orprometheus
username
Required String. The new username for the specified metrics resource.
password
Required String. The new password for the metrics resource. The newpassword must be a minimum of eight characters and must contain atleast one letter (A-Z, a-z), one number (0-9), and one specialcharacter.
- Returns:
boolean
AGOLUsageReports
- classarcgis.gis.admin.AGOLUsageReports(url,gis=None,initialize=True,**kwargs)
Bases:
BasePortalAdmin
Simple Usage Reports from ArcGIS Online
Note
Usage reports can contain users outside your organization.
- applications(start_time:datetime|None=None,time_frame:str='week')
Creates a usage report for all registered application logins for agiven ArcGIS Online organization.
Note
Output can contain users outside your organizationthat used organization applications
Parameter
Description
start_time
optional datetime, the time to step back from. IfNone, the current time is used.
time_frame
optional string, is the timeframe report to create.Allowed values: today, week, 14days, 30days, 60days,90days, 6months, year
- Returns:
dictionary with the number of application logins grouped byapplication and username.
Results aggregated by:
hour if
time_frame
istodayday if
time_frame
isweek,7days,14days,30days,60days or90daysweek if
time_frame
is6monthsmonth if
time_frame
isyear
# Usage example:>>>importdatetimeasdt>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="my_organizational_profile)>>>jan2_23=dt.datetime(2023,1,2)>>>usage_reporter=gis.admin.usage_reports>>>usage_reporter.applications(start_time=jan2_23,time_frame="week"){'startTime':1672099200000,'endTime':1672704000000,'period':'1d','data':[{'etype':'svcusg','stype':'applogin','username':<username1>,'userOrgId':'JXwx ... Ok2o','appId':'arcgisnotebooks','appOrgId':'Ab3e ... q0o7i','num':[['1672099200000','0'],...['1672444800000','4'],['1672531200000','3'],['1672617600000','0']]},......{'etype':'svcusg','stype':'applogin','username':'external username2','userOrgId':'JLxMbZo4ex3kOa2o','appId':'arcgisonline','appOrgId':'Ab3e ... q0o7i','num':[['1672099200000','0'],...['1672444800000','62'],['1672531200000','10'],['1672617600000','0']]}]}
- credit(start_time:datetime|None=None,time_frame:str='week',export:bool=False)
Creates a Panda’s dataframe or CSV file reporting on credit consumptionwithin an ArcGIS Online organization.
Parameter
Description
start_time
optional datetime, the time to step back from. IfNone, the current time is used.
time_frame
optional string, is the timeframe report to create.Allowed values: today, week (default), 14days, 30days,60days, 90days, 6months, year
export
optional boolean, ifTrue, a csv is generated fromthe request. IfFalse, a Panda’s dataframe isreturned. Default isFalse
- Returns:
string path to csv file or Panda’s Dataframe (default) thatrecords the total number of credits consumed per:
hour if
time_frame
istodayday if
time_frame
isweek,7days,14days,30days,60days or90daysweek if
time_frame
is6monthsmonth if
time_frame
isyear
# Usage example>>>usage_reporter=gis.admin.usage_reports>>>usage_reporter.credit(start_time=jan2_23,time_frame="week")datecredits________________________________________02022-12-2616:00:00173.1696...62023-01-0116:00:00177.6483
- generate_report(focus:str='org',report_type:str='users',title:str|None=None,duration:str|None=None,start_time:datetime|None=None,notify:bool=False,future:bool=True,time_aggregate:str|None=None)
The reports operation generates reports, in CSV format, on the overallusage of the organizations. Reports define organization usage metrics inone place for a set time period (either a day, week, or month). Administratorscan generate reports that monitor which organization member is using certainservices, as well as how many credits and storage are used within acertain time period. Reports also include the current state of the organization,which includes the number of items, groups, users,user types, app license assignments, and public items.
Parameter
Description
focus
Optional String. The report type. Currently, onlythe organization (org) report type is supported.
report_type
Required String. The type of report to generate for the org.
- Values:
‘content’
‘users’
‘activity’
‘credits’
‘serviceUsages’
‘itemUsages’
title
deprecated Optional String. The output report item’s title.
duration
Optional String. Specifies the time duration for thereports. This parameter is required whenreport_typeis set tocredits,activity,serviceUsages, oritemUsages.
Note
Thedaily value is only available whenreport_type isset toactivity.Theyearly value is only available whenreport_typeis set toitemUsages.
- Values:
‘daily’
‘weekly’
‘monthly’
‘quarterly’
‘yearly’
start_time
Optional datetime.datetime. The start time of thetime duration. The time format is Unix time with millisecondprecision. Ifduration = ‘weekly’, the start_timevalue must be a time on Sunday or Monday GMT.Ifduration = ‘monthly, the start_time value mustbe on the first day of the month.
This parameter is required whenreport_type is set to‘activity’, ‘credits’, ‘serviceUsages’, or ‘itemUsages’.
notify
Optional Boolean. The Job will print a message upontask completion.
future
Optional Boolean. Returns an asynchronous Job whenTrue, whenFalse, returns an
Item
.time_aggregate
Optional String. This displays the time usage aggregatedby a specified value. This applies only when thereport type is set toitemUsages.
- Values:
‘day’
‘week’
‘month’
Note
Thetime_aggregate parameter must be one levellower than theduration parameter. For example,if theduration parameter is set tomonthly,thetime_aggregate parameter must be set today orweek.
- Returns:
Async Job Object or an
Item
.
- users(start_time:datetime|None=None,time_frame:str='week')
Creates a credit usage report for resources of an ArcGIS Onlineorganization with results aggregated by specificusername and user’sorganization id.
Note
Reports can contain users outside your organization.
Parameter
Description
start_time
optional datetime, the time to step back from. IfNone, the current time is used.
time_frame
optional string, is the timeframe report to create.Allowed values: today, week, 14days, 30days, 60days,90days, 6months, year
- Returns:
dictionary reporting the number of credits consumed by usersthrough this organization.
- Results are aggregated by:
hour if
time_frame
istodayday if
time_frame
isweek,7days,14days,30days,60days or90daysweek if
time_frame
is6monthsmonth if
time_frame
isyear
# Usage Example:>>>fromarcgis.gisimportGIS>>>importdatetimeasdt>>>gis=GIS(profile="my_organizational_profile")>>>usage_reporter=gis.admin.usage_reports>>>jan2_23=dt.datetime(2023,1,2)>>>user_usg=usage_reporter.users(start_time=jan2_23,time_frame="week")>>>list(user_usg.keys())['startTime','endTime','period','data']>>>type(user_usg["data"])list### The data key's value will be a list of### dictionaries. Each dictionary will have varying keys.### If the dictonary has no userOrgId key, that indicates### a public user account.>>>user_usg['data'][1]{'username':'<user_name1>','credits':[['1672099200000','0.0'],['1672185600000','0.0'],...['1672617600000','2.0E-4']]}>>>user_usg['data'][2]{'username':'<user_name2>','userOrgId':'JXrNeAy8ce1q2b4l''credits':[['1672099200000','0.0'],['1672185600000','0.0'],...['1672617600000','0.0']]}
Bundle
- classarcgis.gis.admin.Bundle(url,properties=None,gis=None)
Bases:
object
This represents a single instance of an application bundle
- assign(users:list)
Assigns the current application bundle to a list of users
Parameter
Description
users
Required List. A list of user names or User objectsto assign the current application bundle to.
- Returns:
Boolean. True if successful else False
CategoryManager
- classarcgis.gis.admin.CategoryManager(gis)
Bases:
object
This class allows for the addition, removal and viewing of categoryschema.
- add(items:list[Item],category:str)
Adds a category to an existing set of items
Parameter
Description
items
Required Items. The content within a GIS that will beupdated with a list of categories.
category
Required String. Assigns a category value to the items.
- Returns:
Dictionary indicating ‘success’ or ‘error’
>>>item=[gis.content.get("<item id 1>"), gis.content.get("<item id 2>")]>>>cs=gis.admin.category_schema>>>print(cs.add(items=[item],category="/Categories/TEST3"))[{'results': [{'itemId': '<item id 1>', 'success': True}]}, {'results': [{'itemId': '<item id 2>', 'success': True}]}]
- categorize_item(item:Item|str,categories:list[str])
Assigns or removes a category to a single item.
Parameter
Description
item
Required Item or Item ID (string). The content within a GISthat will be updated with a list of categories.
categories
Required list. Assigns a list of string values to the item’scategories
- Returns:
Boolean. True if successful else False
- remove(items:list[Item],category:str)
remove a category to an item or items
- replace(items:list[Item],old_category:str,new_catgory:str)
finds and replaces a category value with a new value one
- reset(items:list[Item])
deletes all the categories for a given set of items
- propertyschema
Get/Set the catagory schema for a GIS.
When schema is used as a getter, then operation returns the GIS’defined category schema is any.
When schema is used as a setter, the parameter:
Parameter
Description
value
optional list. The schema list.Syntax Example:[
- {
“title”: “Themes”,“categories”: [
- {
“title”: “Basemaps”,“categories”: [
{“title”: “Partner Basemap”},{
“title”: “Esri Basemaps”,“categories”: [
{“title”: “Esri Redlands Basemap”},{“title”: “Esri Highland Basemap”}
]
}
]
},
- {
“title”: “Region”,“categories”: [
{“title”: “US”},{“title”: “World”}
]
}]}]
ClassificationManager
- classarcgis.gis.admin.ClassificationManager(url:str,gis:GIS)
Bases:
object
This class provides properties for getting information about theclassification schema and methods for managing it. This class is notmeant to be initialized directly, but is accessed by using the
classification
property on theArcGIS Enterprise admin object.Note
ArcGIS Enterprise only.
>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>classification_mgr=gis.admin.classification>>>classification_mgrClassification Manager @ <enterprise_url>/portal/sharing/rest/portals/self/classification
- add(schema_file:str)→bool
Adds a schema definition from a file to the current enterprise
Note
For detailed instructions on creating a classification schema, aswell as example schemas, visit the ArcGIS/Classification GitHubrepository.
Parameter
Description
schema_file
Required string. Pathway to a text file containingthe JSON schema that defines the configurationoptions of the classification schema for the ArcGISEnterprise organization.
- Returns:
Boolean value indicating success or failure of the operation.
# Usage Example>>>fromarcgis.GISimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>classify_mgr=gis.admin.classification>>>classify_file_path=r"/path/on/system">>>classify_mgr.add(schema_file=classify_file_path)True
- delete()→bool
Operation to remove the currently defined classification schema of theorganization.
- Returns:
Boolean value indicating the success or failure of the operation.
# Usage Example>>>fromarcgis.GISimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>classify_mgr=gis.admin.classification>>>classify_mgr.delete()True
- gis:GIS
- propertyproperties:dict[str,Any]
Returns a Python dictionary with 2 keys whose values indicate thespecific version of the classification schema and whether theorganization has a scheme defined.
grammarVersion
hasClassificationSchema
# Example Usage:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>classify_mgr=gis.admin.classification>>>classify_mgr.properties{'grammarVersion':'2.0','hasClassificationSchema':True}
- propertyschema:dict|None
Property that returns a Python dictionary representation of the definedclassification schema of the organization.
- Returns:
Dictionary representation of the classification schema.
Note
The value of each key returned will vary by organization.See theEsri classificationrepo for more detailed information regarding the classificationschema.
- session:EsriSession
- validate_item_schema(classification:dict[str,Any]|None=None,classification_schema:str|None=None)→bool
Operation that would verify whether the classification that would begiven to an
Item
is in the correct format.Parameter
Description
classification
Optional dict. The classification payload for a given item.
classification_schema
Optional str. The classification payload represented as afile on the system.
- validate_schema_file(schema_file:str)→bool
Operation that determines whether the schema defined in a file adheresto the classification grammar included in the Portal for ArcGIScomponent of the ArcGIS Enterprise deployment.
Parameter
Description
schema_file
Required string. Path to a text file containingthe JSON schema to validate.
- Returns:
Boolean value indication success or failure of the operation.
CollaborationManager
- classarcgis.gis.admin.CollaborationManager(gis:GIS,portal_id:str=None)
Bases:
object
- accept_invitation(first_name:str,last_name:str,email:str,invitation_file:str|None=None,invitation_JSON:str|None=None,webauth_username:str|None=None,webauth_password:str|None=None,webauth_cert_file:str|None=None,webauth_cert_password:str|None=None)→dict
The accept_invitation operation allows a portal to accept acollaboration invitation. The invitation file received securelyfrom the collaboration host portal must be provided. Once a guestaccepts an invitation to a collaboration, it must link workspace(s)associated with the collaboration to local portal group(s). Theguest must export a collaboration invitation response file and sendit to the host. Once the host processes the response, content canbe shared between the host and guest(s).
Parameter
Description
first_name
Required string. The first name of the contact person for the guestportal.
last_name
Required string. The last name of the contact person.
email
Required string. The email of the contact person.
invitation_file
Optional string. The invite file to upload to portal. Use eitherthis parameter or invitation_JSON.
invitation_JSON
Optional string. The same contents as the invitation_file parameterbut passed as a string. Use either this parameter or invitation_file.
webauth_username
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication user name.
webauth_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication password.
webauth_cert_file
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate file.
webauth_cert_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate password.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- collaborate_with(guest_gis:GIS,collaboration_name:str,collaboration_description:str)→bool
A high level method to quickly establish a collaboration between two GIS. This method uses defaultswherever applicable and internally calls thecreate,accept_invitation andinvite_participant methods.This method will create a new group and a new workspace in both the host and guest GIS for this collaboration.Invitation and response files created during the collaborations will be downloaded to the current workingdirectory.
Use the other methods if you need fine-grained control over how the collaboration is set up.
Parameter
Description
guest_gis
Required GIS. GIS object of the guest org or Enterprise.
collaboration_name
Required string. A generic name for the collaboration. This name isused with prefixes such as wksp_<your_collab_name>,grp_<your_collab_name> to create the collaboration workspace andgroups.
collaboration_description
Optional string. A generic description for the collaboration.
- Returns:
boolean
- create(name:str,description:str,workspace_name:str,workspace_description:str,portal_group_id:str,host_contact_first_name:str,host_contact_last_name:str,host_contact_email_address:str,access_mode:str='sendAndReceive')
The create method creates a collaboration. The hostof the collaboration is the portal where it is created. The initialworkspace for the collaboration is also created. A portal group inthe host portal is linked to the workspace. The access mode for thehost portal is set. The contact information associated with thehost can be specified; otherwise, the contact information for theadministrator user performing the operation will be used.
Parameter
Description
name
Required string. Name of the collaboration
description
Required string. Description of the collaboration
workspace_name
Required string. The name of the initial workspace.
workspace_description
Required string. The description of the initial workspace.
portal_group_id
Required string. ID of group in the portal that will be linked withthe workspace.
host_contact_first_name
Required string. The first name of the contact person for thecollaboration host portal.
host_contact_last_name
Required string. The last name of the contact person for thecollaboration host portal.
host_contact_email_address
Required string. The email address of the contact person for thecollaboration host portal.
access_mode
Required string. The organization’s access mode to the workspace.Values: send | receive | sendAndReceive (default)
- Returns:
the data item is registered successfully, None otherwise
- list()→list[Collaboration]
gets all collaborations for a portal
- validate_invitation(first_name:str,last_name:str,email:str,invitation_file:str|None=None,invitation_JSON:str|None=None,webauth_username:str|None=None,webauth_password:str|None=None,webauth_cert_file:str|None=None,webauth_cert_password:str|None=None)→dict
The validate_invitation method allows a portal tovalidate a collaboration invitation. The invitation file receivedsecurely from the collaboration host portal must be provided.Validation checks include checking that the invitation is for theintended recipient.
Parameter
Description
first_name
Required string. The first name of the contact person for the guestportal.
last_name
Required string. The last name of the contact person.
email
Required string. The email of the contact person.
invitation_file
Optional string. The invite file to upload to portal. Use eitherthis parameter or invitation_JSON.
invitation_JSON
Optional string. The same contents as the invitation_file parameterbut passed as a string. Use either this parameter or invitation_file.
webauth_username
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication user name.
webauth_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication password.
webauth_cert_file
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate file.
webauth_cert_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate password.
- Returns:
Dictionary indicating ‘success’ or ‘error’
Collaboration
- classarcgis.gis.admin.Collaboration(collab_manager,collab_id,portal_id=None)
Bases:
dict
The collaboration resource returns information about the collaborationwith a specified ID.
- add_group_to_workspace(portal_group:str,workspace:str)→dict
- This operation adds a group to a workspace that participates in a portal-to-portal collaboration. Content shared
to the portal group is shared to other participants in the collaboration.
Parameter
Description
portal_group
Required Group of string. Group ID or object to add to the workspace.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- add_workspace(name:str,description:str,config:dict,portal_group_id:str)→dict
The add_workspace resource adds a new workspace to aportal-to-portal collaboration. Only collaboration hosts can createnew workspaces.
Parameter
Description
name
Required string. The name of the workspace.
description
Required string. Brief description of the workspace.
portal_group_id
Required string. The ID of the portal group linked with theworkspace.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- delete()→bool
The delete operation deletes a portal-to-portal collaboration fromthe host portal. This stops any sharing set up from thecollaboration. The collaboration will be removed on guest portalson the next refresh of their content based on the collaborationsharing schedule. Guests cannot delete collaborations, but they candiscontinue participation in a collaboration via theremoveParticipation endpoint.
- delete_schedule(workspace_id:str)→bool
Removes the scheduling job for synchronized items in a collaboration workspace.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
- Returns:
Boolean. True if successful else False.
- export_invitation(out_folder:str)→dict
The exportInvitationResponse operation exports a collaborationinvitation response file from a collaboration guest portal. Theexported response file must be sent via email or through othercommunication channels that are established in your organization tothe inviting portal’s administrator. The inviting portal’sadministrator will then import your response file to complete theestablishment of trust between your portals.It is important that the contents of this response file are notintercepted and tampered with by any unknown entity.
Parameter
Description
out_folder
Required string. Save location of the file.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- get_invitation(invitation_id:str)→dict
The get_invitation operation returns the information about aninvitation to participate in a portal-to-portal collaboration for aparticular invitation with the specified ID.
- get_participant(portal_id:str)→dict
The participant operation provides information about thecollaboration participant with a specified ID.
- get_workspace(workspace_id:str)→dict
The workspace resource provides information about the collaborationworkspace with a specified ID.
- import_invitation_response(response_file:str,webauth_username:str|None=None,webauth_password:str|None=None,webauth_cert_file:str|None=None,webauth_cert_password:str|None=None)→dict
The importInvitationResponse operation imports an invitationresponse file from a portal collaboration guest. The operation isperformed on the portal that serves as the collaboration host. Oncean invitation response is imported, trust between the host and theguest is established. Sharing of content between participants canproceed from this point.
Parameter
Description
response_file
Required string. File path to the response file.
webauth_username
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication user name.
webauth_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication password.
webauth_cert_file
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate file.
webauth_cert_password
Optional string. If the collaboration host requires web-tierauthentication, optionally use this parameter to provide the host’sweb-tier authentication certificate password.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- invalidate(invitation_id:str)→dict
The invalidate operation invalidates a previously generatedportal-to-portal collaboration invitation. If a guest accepts thisinvitation and sends an invitation response for it, the responsewill not import successfully on the collaboration host.
- propertyinvitations:list
The invitations operation returns the invitation information forall the invitations generated by a portal-to-portal collaborationhost.
- invite_participant(config_json:dict,expiration:int=24,guest_portal_url:str|None=None,guest_gis:GIS|None=None,save_path:str|None=None)→str
As a collaboration host, once you have set up a new collaboration,you are ready to invite other portals as participants in yourcollaboration. The inviteParticipant operation allows you to inviteother portals to your collaboration by creating an invitation file.You need to send this invitation file to the administrator of theportal you are inviting to your collaboration. This can be done viaemail or through other communication channels that are establishedin your organization. It is important that the contents of thisinvitation file are not intercepted and tampered with by anyunknown entity. The invitation file is in the formatcollaboration-<guestHostDomain>.invite.The administrator of the participant will accept the invitation byimporting the invitation file into their portal. Their acceptanceis returned to you as another file that you must import into yourportal using the import_invitation_response operation. This willestablish trust between your portal and that of your participant.
Parameter
Description
config_json
Required dict. A dict containing a map of access modes for theparticipant in each of the collaboration workspaces.Defined as: send | receive | sendAndReceive
- Example:
- config_json = [
{“workspace_id” : “send”},{“workspace_id2” : “receive”},{“workspace_id3” : “sendAndReceive”}
]
expiration
Optional integer. The time in UTC when the invitation to collaborateshould expire.
guest_portal_url
Optional string. The URL of the participating org or Enterprise thatyou want to invite to the collaboration.
guest_gis
Optional GIS. GIS object to the guest collaboration site.
save_path
Optional string. Path to download the invitation file to.
- Returns:
Contents of a file that contains the invitation information
- participants()→dict
The participants resource provides information about all of theparticipants in a portal-to-portal collaboration.
- pause_schedule(workspace_id:str)→bool
Suspends the scheduling job for synchronized items in a collaboration workspace.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
- Returns:
Boolean. True if successful else False
- refresh(invitation_id:str)→dict
The refresh operation refreshes a previously generatedportal-to-portal collaboration invitation. The new invitation fileis provided via a multipart POST response. The expiration for theinvitation is extended an additional 72 hours from the currenttime.
Parameter
Description
invitation_id
Required string. ID of the invitation to refresh
- Returns:
Dictionary indicating ‘success’ or ‘error’
- remove_participant(portal_id:str)→dict
The remove operation allows a collaboration host to remove aparticipant from a portal-to-portal collaboration.
Parameter
Description
portal_id
Required string. ID of the portal to remove.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- remove_participation()→dict
The removeParticipation operation removes collaborationparticipation by a guest from a collaboration, allowing a guest toexit a collaboration. This immediately disables furtherreplication of data to and from the portal and the othercollaboration participants.
- remove_portal_group_link(workspace_id:str)→dict
The remove_portal_group_link operation removes the link between acollaboration workspace and a portal group. Replication of contentdiscontinues when the link is removed.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- remove_workspace(workspace_id:str)→dict
The delete operation deletes a collaboration workspace. Thisimmediately disables further replication of data to and from theportal and the collaboration participants.
Parameter
Description
workspace_id
Optional string. UID of the workspace to remove from thecollaboration.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- resume_schedule(workspace_id:str)→bool
Resumes a paused scheduled synchronization.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
- Returns:
Boolean. True if successful else False.
- schedule(workspace_id:str)→dict
Collaboration guests can use the schedule resource to return a jobschedule for synchronized items in a collaboration workspace. Theresponse is a single JSON object that represents a job schedule.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
- Returns:
A dictionary of the job schedule
- sync(workspace_id:int,run_async:bool=False)→dict
The sync endpoint is provided to allow execution of a data sync ona particular workspace. The operation is allowed on the participantthat is designated to initiate sync operations as determined duringtrust establishment between the collaboration host and a guestparticipant. Typically, the guest participant is designated toinitiate sync operations. Note that if a scheduled sync operationis already in progress a new sync is not started unless the currentsync operation is finished.
When running sync in synchronous mode, the client will be blockeduntil the operation is completed. Invoking sync in synchronous modeis good for quickly syncing an item (that is not large) if theclient does not want to wait for the next scheduled sync.
Asynchronous mode allows a client to get response immediately so itdoes not have to wait and is not blocked from performing othertasks.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
run_async
Optional Boolean. When true, the job will run asynchronously.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- sync_details(workspace_id:str,sync_id:str)→dict
Provides a detailed description of status for a selected sync ID.
Parameter
Description
workspace_id
Required string. Workspace ID to examinesync jobs.
sync_id
Required String. When a sync is performed, an ID is generated totrack the status of the synchronization of the collaboration.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- sync_status(workspace_id:str)→list
Provides a status summary of each scheduled sync for items in a collaboration workspace.
Parameter
Description
workspace_id
Required string. Workspace ID to examinesync jobs.
- Returns:
List[Dict]
- update_access_modes(portal_id:str,workspace_access_json:str|dict)→dict
The update_access_modes operation updates the access mode for aspecific participant in a portal-to-portal collaboration.
Parameter
Description
portal_id
Required string. UID of the Portal
workspace_access_json
Required dict/string. JSON describing the participant’s access mode.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- update_collaboration(name:str|None=None,description:str|None=None,config:dict|None=None)→dict
The updateInfo operation updates certain properties of acollaboration, primarily its name, description, and configurationproperties. The updates are propagated to guests when the nextscheduled refresh of content occurs.
Parameter
Description
name
Optional string. Name of the collaboration
description
Optional string. The description of the collaboration
config
Optional dict. The configuration properties of the collaboration
- Returns:
Dictionary indicating ‘success’ or ‘error’
- update_item_delete_policy(participant_id:str,delete_contributed_items:bool=False,delete_received_items:bool=False)→dict
The participants resource provides information about all of theparticipants in a portal-to-portal collaboration.
Parameter
Description
participant_id
Required String. The participant unique id to update.
delete_contributed_items
Optional Boolean. When a participant leaves or deletes a collaboration, this property determines whether contributed items will be deleted or maintained.
delete_received_items
Optional Boolean. When a participant leaves or deletes a collaboration, this property determines whether received items will be deleted or maintained.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- update_portal_group_link(workspace_id:str,portal_id:str,enable_realtime_sync:bool=True,copy_feature_service_data:bool=True,copy_by_ref_on_fail:bool=True,enable_bidirectional_sync:bool=True)→dict
Theupdate_portal_group_link operation updates the group linked with aworkspace for a participant in a portal-to-portal collaboration.Content shared to the portal group is shared to other participantsin the collaboration.
Parameter
Description
workspace_id
Required string. UID of the workspace
portal_id
Required string. UID of the Portal
enable_realtime_sync
Optional boolean. Determines whether the content shared with thegroup is shared to other collaboration participants in real time,updating whenever changes are made, or whether the content isshared based on a schedule set by the collaboration host.
copy_feature_service_data
Optional boolean. Boolean value used when Feature Service data isshared in a group that is linked to a distributed collaborationworkspace. When set to “true” Feature Service data will be copiedto collaboration participants.
copy_by_ref_on_fail
Optional boolean. If the copy feature service data fails, and set toTrue, the enterprise will reference the data instead of copying it.This is supported on10.9+.
enable_bidirectional_sync
Optional boolean. When set to true, edits to shared feature servicescan be allowed two-way to eligible participants.This is supported on10.9+.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- update_schedule(workspace_id:str,start_time:int,interval:int=24,repeat_count:int=-1)→bool
Collaboration guests can use the schedule resource to return a jobschedule for synchronized items in a collaboration workspace. Theresponse is a single JSON object that represents a job schedule.
Parameter
Description
workspace_id
Required string. Workspace ID to remove from the link.
start_time
Required Integer. A job’s scheduled start time. The startTime is in Unix time in milliseconds. The default is the current time of the request call.
interval
Optional Integer. A positive integer that represents time (in hours) between each job trigger. The default interval is 24 hours.
repeat_count
Optional Integer. A positive integer or -1 which represents how many times to keep re-triggering this job after which it will be automatically deleted. The default is -1 which means repeat indefinitely.
- Returns:
Boolean. True if successful else False.
- update_workspace(workspace_id:str,name:str|None=None,description:str|None=None,config:dict|None=None,max_item_size:int|None=None,max_replication_size:int|None=None,copy_by_ref_on_fail:bool=False)→dict
The updateInfo operation updates certain collaboration workspaceproperties.
Parameter
Description
workspace_id
Required string. UID of the workspace
name
Optional string. The name of the workspace
description
Optional string. A brief set of texts that explains the workspace
config
Optional dict. The configuration details of the new workspace.Removed at 10.6.
max_item_size
Optional Integer. The maximum item size in MBs.
max_replication_size
Optional Integer. The maximum replication item size in MBs.
copy_by_ref_on_fail
Optional Boolean. Determines whether a failed attempt to copyshould revert to sharing by reference. For example, in cases wherethe imposed size limit has been exceeded.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- validate_invitation_response(response_file:str)→dict
Prior to importing a collaboration invitation response, theinvitation response file can be validated by using thevalidate_invitation_response operation to check for the existenceof the collaboration and validity of the invitation response file.
Parameter
Description
response_file
Required string. Path to the collaboration response file.
- Returns:
Dictionary indicating ‘success’ or ‘error’
CreditManager
- classarcgis.gis.admin.CreditManager(gis)
Bases:
object
Manages an ArcGIS Online organization’s credits for users and sites
Example Usage
>>>fromarcgis.gisimportGIS>>>gis=GIS(profile='your_online_admin_account')>>>cm=gis.admin.credits>>>cm<arcgis.gis.admin._creditmanagement.CreditManager object at 0x...>
- allocate(username:str,credits:float|None=None)
Allows organization administrators to allocate credits fororganizational users in ArcGIS Online
Parameter
Description
username
Required string.The name of the user to assign credits to.
credits
Optional float. The number of credits to assign to a user. If Noneis provided, it sets user to unlimited credits.
- Returns:
Boolean. True if successful else False
# Usage Example:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>credit_mgr=gis.admin.credits>>>credit_mgr.allocate("gis_editor",250)
- credit_usage(start_time:datetime|None=None,end_time:datetime|None=None,time_frame:str='week')
returns the total credit consumption for a given time period.
arguements
description
start_time
datetime.datetime object. This is the date tostart at.
end_time
datetime.datetime object. This is the stop timeto look for credit consumption. It needs to beat least 1 day previous than then start_time.
time_frame
Optional string. The time frame to create thereport for.
Allowed values:
today
week (default)
7days
14days
30days
60days
90days
6months
year
Note
Ifend_time is provided, this parameteris ignored.
returns: dictionary
# Usage Example:>>>importdatetimeasdt>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>credit_mgr=gis.admin.credits>>>start_date=dt.datetime(2024,1,4,9)>>>end_date=dt.datetime(2024,1,2,9)>>>usage_report_dict=credit_mgr.credit_usage(start_time=start_date,end_time=end_date)>>>usage_report_dict{'intnotebks':11.9,'schdnotebks':2.225,'geocode':167.67,'tiles':0.588,...'spanalysis':368.69302}
DataStoreMetricsManager
- classarcgis.gis.admin.DataStoreMetricsManager(gis:GIS)
Bases:
object
This class allows for ArcGIS Online administrators to query statistics about themanaged datastore. It is not meant to be initialized directly, but instead aninstance is returned from the
datastore_metrics
property.# Usage Example;>>>gis=GIS(profile="your_online_admin_profile")>>>ago_mgr=gis.admin>>>ds_mgr=ago_mgr.datastore_metrics
- propertyfeature_storage:list[dict[str,Any]]
Returns storage percentage of total storage used
- Returns:
list[dict[str,Any]]
- query(metric:DataStoreMetric,bin_size:float|int,bin_unit:DataStoreTimeUnit,aggregation:DataStoreAggregation=DataStoreAggregation.SUM,start_time:datetime|None=None,end_time:datetime|None=None,ago:int|None=None,ago_unit:DataStoreTimeUnit|None=None)→list[dict[str,Any]]
A query operation used to gather metrics about the ArcGIS Online Datastore
Parameter
Description
metric
Required DataStoreMetric. The statistical method to gather.
bin_size
Required Float or Int. The size of the bin to aggregate on.
bin_unit
Required DataStoreTimeUnit. The size of the bin.
aggregation
Required DataStoreAggregation. The type of aggregation to perform.
start_time
Optional datetime.datetime. The starting date point.
end_time
Optional datetime.datetime. The ending date point.
ago
Optional Int. The time to look back from today.
ago_unit
Optional DataStoreTimeUnit. The time unit to look back.
- Returns:
list[dict[str,Any]]
- query_resource_usage(query_period:str)→dict[str,list]
Allows administrators to view the average and max CPU usage for theorganization’s datastore.
Parameter
Description
query_period
Required String. The time period to query. The allowedvalues are: day, week, or hour.
- Returns:
dictionary containing the average and max usage.
DataStoreAggregation
DataStoreTimeUnit
DataStoreMetric
License
- classarcgis.gis.admin.License(gis,info)
Bases:
object
Represents a single entitlement for a given organization.
Parameter
Description
gis
Required GIS, the gis connection object
info
Required dictionary, the information provided bythe organization’s site containing the provisionand listing information.
- Returns:
License
object
- assign(username:str,entitlements:list[str]|str,suppress_email:bool=True,overwrite:bool=True)
grants a user an entitlement.
Parameter
Description
username
Required string, the name of the user you wish toassign an entitlement to.
entitlements
Required list of strings or strings, of entitlements values.
suppress_email
Optional boolean, if True, the org will not notifya user that their entitlements has changed (default)If False, the org will send an email notifying auser that their entitlements have changed.
overwrite
Optional boolean, if True, existing entitlementsfor the user are dropped
- Returns:
Boolean. True if successful else False.
- check(user:str)→list
Checks if the entitlement is assigned or not.
Parameter
Description
user
Required string, the name of the user you want toexamine the entitlements for.
- Returns:
list
- propertyoffline_report
Return a DataFrame that shows the usernames and whether they have taken a license offline
- Returns:
pd.DataFrame
- revoke(username:str,entitlements:list[str]|str,suppress_email:bool=True)
removes a specific license from a given entitlement
Parameter
Description
username
Required string, the name of the user you wish toassign an entitlement to.
entitlments
Required list of strings or string, a list of entitlements values,if * is given, all entitlements will be revoked
suppress_email
Optional boolean, if True, the org will not notifya user that their entitlements has changed (default)If False, the org will send an email notifying auser that their entitlements have changed.
- Returns:
boolean
LicenseManager
- classarcgis.gis.admin.LicenseManager(url,gis=None,initialize=True,**kwargs)
Bases:
BasePortalAdmin
Provides tools to work and manage licenses in ArcGIS Online andArcGIS Enterprise (Portal)
Parameter
Description
url
required string, the web address of the site tomanage licenses.example:https://<org url>/<wa>/sharing/rest/portals/self/purchases
gis
required GIS, the gis connection object
- Returns:
LicenseManager
Object
- all()→list
Returns all Licenses registered with an organization
- Returns:
List of
License
objects
- propertybundles:list
Returns a list of Application Bundles for an Organization
- Returns:
List of
Bundle
objects
- get(name:str)
Retrieves a license by it’s name (title)
Parameter
Description
name
required string, name of the entitlement to locateon the organization.example:name=”arcgis pro”
- Returns:
List of
License
objects
- propertyoffline_pro:bool
Administrators can get/set the disconnect settings for the ArcGIS Pro licensing.A value of True means that a user can check out a license from the enterpriseinorder to use it in a disconnected setting. By settingoffline_pro to False,the enterprise users cannot check out licenses to work in a disconnected settingfor ArcGIS Pro.
Parameter
Description
value
Required bool.Value: True | False
- Returns:
Boolean
- provisions(user:User,all_available:bool=False,included_expired:bool=True,return_client_ids:bool=False)→list
Allows administrators to manage a user’s list of provsional Add-On Licenses.
LivingAtlas
- classarcgis.gis.admin.LivingAtlas(url,gis)
Living Atlas of the World content is a collection of authoritative,ready-to-use, global geographic content available from ArcGIS Online.The content includes valuable maps, data layers, tools, services andapps for geographic analysis.When you make Living Atlas content available to your portal members,you’re providing them with ready-made content that they can usealone or in combination with their own content to create maps,scenes, and apps and perform analysis in the portal Map Viewer orInsights for ArcGIS.
- Note:
Your portal must have access to the Internet to use Living Atlascontent from ArcGIS Online
Types of content availableAll the Living Atlas content you access from Portal for ArcGIS wascreated by Esri. If your portal can connect to the Internet, thefollowing three levels of Living Atlas content are available to you fromArcGIS Online:
Content Type
Description
Default
Content that does not require you to sign in to anArcGIS Online account. Available by default in ArcGISEnterprise.
Subscriber
Subscriber content is the collection of ready-to-usemap layers, analytic tools, and services publishedby Esri that requires an ArcGIS Online organizationalsubscription account to access. This includes layersfrom Esri such as Landsat 8 imagery, NAIP imagery,landscape analysis layers, and historical maps.Subscriber content is provided as part of yourorganizational subscription and does not consumeany credits.
Premium
Premium content is a type of subscriber content thatrequires an ArcGIS Online organizational subscriptionaccount to access and consumes credits. Access andcredit information is listed in the description detailsfor each item. Premium content provides portal memberswith access to ready-to-use content such as demographicand lifestyle maps as well as tools for geocoding,geoenrichment, network analysis, elevation analysis, andspatial analysis.
SeeConfigure Living Atlas content: Types of Content Availablefor complete details.
Portal administrators do not need to create this class directly in mostcircumstances. Instead, first access the
PortalAdminManager
using theadmin property of theGIS
. Then usetheliving_atlas property to return aLivingAtlas
object.ent_living_atlas=gis.admin.living_atlas
To create an instance directly:
Parameter
Description
url
required string, the web address of the site tomanage licenses.
gis
required
GIS
object.ent_living_atlas=LivingAtlas(url="https://portal_url/web_adaptor/portaladmin/system/content/livingatlas"gis=gis)
- disable_premium_atlas()
Disables the Premium Living Atlas Content for a local portal.
>>>living_atlas=gis.admin.living_atlas>>>living_atlas.disable_premium_atlas() True>>>living_atlas.status(liv_atl_group) {'publicContentEnabled': True, 'subscriberContentEnabled': True, 'premiumContentEnabled': False, 'publicContentShared': True, 'subscriberContentShared': True, 'premiumContentShared': False, 'subscriberContentUsername': 'demos_deldev', 'subscriberUserValid': 'Valid', 'premiumContentUsername': None, 'premiumUserValid': 'UnKnown', 'upgraded': True}
- disable_public_access()
Disables the Public Living Atlas content.
- Returns:
Boolean. True means disabled, False means failure to disable.
- enable_premium_atlas(username:str,password:str)
Enables the Premium Living Atlas Content for a local portal.
Premium content is a type of subscriber content that requires anArcGIS Online organizational subscription account to access andconsumes credits. Access and credit information is listed in thedescription details for each item.Premium content provides portal members with access to ready-to-usecontent such as demographic and lifestyle maps as well as tools forgeocoding, geoenrichment, network analysis, elevation analysis, andspatial analysis.
Parameter
Description
username
required string, username for ArcGIS Online
password
required string, login password for ArcGIS Online account
- Note:
This will cost you credits.
>>>ent_living_atlas=gis.admin.living_atlas>>>liv_atl_groups=ent_living_atlas.groups>>>liv_atl_groups [<Group title:"Living Atlas" owner:esri_livingatlas>, <Group title:"Living Atlas Analysis Layers" owner:esri_livingatlas>]>>>liv_atl_group=liv_atl_groups[0]>>>living_atlas.status(liv_atl_group) {'publicContentEnabled': True, 'subscriberContentEnabled': True, 'premiumContentEnabled': False, 'publicContentShared': True, 'subscriberContentShared': True, 'premiumContentShared': False, 'subscriberContentUsername': 'demos_deldev', 'subscriberUserValid': 'Valid', 'premiumContentUsername': None, 'premiumUserValid': 'UnKnown', 'upgraded': True}>>>living_atlas.enable_premium_atlas("org_admin", "org_admin_password") True>>>living_atlas.status(liv_atl_group) {'publicContentEnabled': True, 'subscriberContentEnabled': True, 'premiumContentEnabled': True, 'publicContentShared': True, 'subscriberContentShared': True, 'premiumContentShared': True, 'subscriberContentUsername': 'demos_deldev', 'subscriberUserValid': 'Valid', 'premiumContentUsername': 'arcgispyapibot', 'premiumUserValid': 'InValid', 'upgraded': True}
- enable_public_access()
Enables the Public Living Atlas content.
Living Atlas of the World content is a collection of authoritative,ready-to-use, global geographic content available from ArcGIS Online.The content includes valuable maps, data layers, tools, services andapps for geographic analysis.
- Returns:
Boolean.True if enabled.False if failed to enable.
- enable_subscriber_atlas(username:str,password:str)
Enables the Subscriber level Living Atlas Content for an ArcGIS Enterprise portal.
Subscriber content is the collection of ready-to-use map layers,analytic tools, and services published by Esri that requires anArcGIS Online organizational subscription account to access.This includes layers from Esri such as Landsat 8 imagery,NAIP imagery, landscape analysis layers, and historical maps.Subscriber content is provided as part of yourorganizational subscription and does not consume any credits.Layers included in the Living Atlas subscriber content are suitablefor use with analysis tools.
Parameter
Description
username
required string, username for ArcGIS Online
password
required string, login password for the specific ArcGIS Online account
- Note:
Use of these layers willnot incur a credit cost for your organization.
- status(group:str)
Returns information about the sharing status of the LivingAtlas with the group.
Parameter
Description
group
required string or Group object
>>>ent_living_atlas=gis.admin.living_atlas>>>liv_atl_groups=ent_living_atlas.groups>>>liv_atl_groups [<Group title:"Living Atlas" owner:esri_livingatlas>, <Group title:"Living Atlas Analysis Layers" owner:esri_livingatlas>]>>>liv_atl_group=liv_atl_groups[0]>>>living_atlas.status(liv_atl_group) {'publicContentEnabled': True, 'subscriberContentEnabled': True, 'premiumContentEnabled': False, 'publicContentShared': True, 'subscriberContentShared': True, 'premiumContentShared': False, 'subscriberContentUsername': 'demos_deldev', 'subscriberUserValid': 'Valid', 'premiumContentUsername': None, 'premiumUserValid': 'UnKnown', 'upgraded': True}
- update_premium_account(username:str,password:str)
Updates the Username/Password for the Living Atlas Premium User.The account must be an ArcGIS Online account.
Parameter
Description
username
Required string. The user who will be used forto access the subscriber Living Atlas content.
password
Required string. The credentials for the user above.
- Returns:
Boolean. True if successful else False.
- update_subscriber_account(username:str,password:str)
Updates the Username/Password for the Living Atlas Subscriber User.The account must be an ArcGIS Online account.
Parameter
Description
username
Required string. The user who will be used forto access the subscriber Living Atlas content.
password
Required string. The credentials for the user above.
- Returns:
Boolean. True if successful else False.
- upgrade()
Upgrades the Living Atlas Group to the latest version of the Living Atlasdata. SeeLiving Atlas content life cycles and updatesfor details.
- Returns:
Boolean
- validate_credentials(username:str,password:str,online_url:str|None=None)
Ensures the arguments contain valid credentials to access an activeArcGIS Online Organization.
Parameter
Description
username
required string, username for ArcGIS Online
password
required string, login password for ArcGIS Online account
online_url
optional string, Url to ArcGIS Online site.default ishttps://www.arcgis.com
- Returns:
Boolean. True if successful else False.
LivingAtlasManager
- classarcgis.gis.admin.LivingAtlasManager(url:str,session:EsriSession)
Provides a collection of tools to update living atlas on an existing enterprise configuration.
- session:EsriSession|None=None
- update(package_id:str,start_time:datetime|None=None)→LivingAtlasJob|dict
Updates the living atlas to a given package
Parameter
Description
package_id
Required str. The package ID to update with. This can be obtained fromcheck method.
start_time
Optional datetime.datetime. The date/time to run the update.
LivingAtlasJob
- classarcgis.gis.admin.LivingAtlasJob(url:str,session:EsriSession)
The Living Atlas Update Job
IdentityProviderManager
- classarcgis.gis.admin.IdentityProviderManager(gis=None)
Bases:
object
Manages and Updates the SAML identity provider configuration for a given GIS.
- propertyconfiguration
Gets, updates, or Adds a SAML provider
Arguement
Value
value
required dictionary. This property sets, updates or deletes an IDPconfiguration for a given GIS.
To configure an IDP, provide the key/valueExample:
idp.configuration = {‘name’ : ‘Enterprise IDP’, ‘idpMetadataFile’ : ‘metadata.xml’}
Once a site has been configured to use IDP, the configuration can beupdated by passing in the key/value pair dictionary.Example:
idp.configuration = {‘name’ : ‘Acme IDP Login’}
To erase an IDP configuration, set the value to NoneExample:
idp.configuration = None
Everytime the IDP configuration is updated, the changes can be seenby calling the ‘configuration’ property and the new results will bereturned as a dictionary.
Key:Value Dictionary for Argument value
Key
Value
bindingPostUrl
Optional string. If the idpMetadataFile isn’t specified when anadministrator, this parameter is required. It is federated identityprovider post url.
bindingUrl
Optional string. If the idpMetadataFile isn’t specified when anadministrator, this parameter is required. It is federated identityprovider url that we have to redirect the user to login to.
certificate
Optional string. the X509Certificate that needs to be used tovalidate the SamlResponse from the identity provider.
encryptionCertificate
Optional string. the X509Certificate that needs to be used tovalidate the SamlResponse from the identity provider.
encryptionSupported
Optional bool. Tells is the SAML provider supports encryption.
entityId
Optional string. Name of the entity ID.
groups
Optional list. List of group ids that users will be put in onwhen they signup to join the GIS.
id
Optional string. unique identifier of the IDP provider.
idpMetadataFile
Optional string. In the case the URL is not accessible, then thesame IDP Metadata file can be uploaded.
level
Optional integer. Either value 1 or 2. The default level a user willbe created as. The default is 2.
logoutUrl
Optional string. The logout SAML url.
name
Optional string. It is the name of the organization’s federatedidentity provider. This is also the name we show up in the Signinpage.
roleId
Optional string. Default role new users will be.
signUpMode
Optional string. This is how new users are added to the GIS. Thereare two modes: Invitation, AutomaticInvitation user needs to get an invitation and then signin throughfederated identity provider.With Automatic all users that signin through the federated identityprovider will be added as a user. The privilege/role is set to ‘user’Default is Invitation.
supportSignedRequest
Optional boolean. Determines if signed requests are supported fromthe provider.
supportsLogoutRequest
Optional boolean. Determines if logout requests are accepted.
updateProfileAtSignin
Optional boolean. If True, users have to update the profile.
useSHA256
Optional boolean. If set to true, SHA256 encryption will be used.
userCreditAssignment
Optional integer. Assigns a set number of credits to new users. Thedefault is -1 (infinite).
PasswordPolicy
PartneredCollabManager
- classarcgis.gis.admin.PartneredCollabManager(url:str,gis:GIS)
Bases:
object
A class for managingpartnered collaborations, which are utilizedto seamlessly share content with other ArcGIS Online organizations. When twoor more organizations create a partnered collaboration, they enter apartnership that allows their members to work closely with each otherand each other’s content using
groups
. Forfurther details seeUnderstanding collaborations.For detailed workflow example, please readThe Power of PartneredCollaboration.A usermust have administrator privileges to access this object.Instances are not meant to be created directly, but rather returnedusing the
partnered_colloboration
property of anArcGISOnlineAdministrator
object.# Usage Example:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>agol_mgr=gis.admin>>>partnered_collab_mgr=agol_mgr.partnered_colloboration>>>partnered_collab_mgr<arcgis.gis.admin._partnercollab.PartneredCollabManagerobjectat<memoryaddress>>
- collaborations(include_hub:bool=False)→Generator[PartneredCollaboration]
Returns a Python generator that can retrieve all thepartneredcollaborations for the current organization.
Parameter
Description
include_hub
Optional Boolean. Indicates whethercollaborationsimplemented through ArcGIS Hub should be included inthe generator returned by this method. Default valueisFalse.
# Usage Example:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>partner_collab_mgr=gis.admin.partnered_collaboration>>>partner_collab_gen=partner_collab_mgr.collaborations()>>>partner_collab_obj=next(partner_collab_gen)>>>partner_collab_obj<arcgis.gis.admin._partnercollab.PartneredCollaborationobjectat0x...>
- propertycoordinators:Generator[_arcgis_gis.User]
returns a Python generator object that can be used to getthe org
users
assigned as coordinators forpartner collaborations. This property also serves as the way to setadditional coordinators by assigning a list ofUser
objects.Note
In order to serve ascoordinators, users must be either anAdministrator in the org or assigned theFacilitator role. Inaddition, users must have their profile access set toOrganizationorEveryone.SeeManage collaboration coordinatorsfor details.
#Usage example to set coordinators>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>partner_clb_mgr=gis.admin.partnered_collaboration>>>new_coordinators=[usrforusringis.users.search("*")ifusr.role=="org_admin"][:3]>>>partner_clb_mgr.coordinators=new_coordinators>>>forclb_coordinatorinpartner_clb_mgr.coordinators:print(f"{clb_coordinator.username:25}{type(clb_coordinator)}")Collab_Coordinator1<class'arcgis.gis.User'>Org_Admin_Overall<class'arcgis.gis.User'>
- create(message:str,org_url:str|None=None,org_id:str|None=None,search_users:bool=False)→bool
Creates a partnered collaboration on the ArcGIS Online site.
Parameter
Description
message
Required String. The message to send to the organization about
org_url
Required String. The url of the organization to partner with.
org_id
Optional String. The ID of the organization to partner with.
search_users
Optional boolean. Allows partnered organization members tosearch for
users
within yourorganization.- Returns:
bool
- propertyproperties:dict[str,Any]
Returns various attributes about partnered collaborations of thecurrent organzations.
Note
ArcGIS Hub is implemented with a similar mechanism to PartneredCollaborations. Properties about the relationship with ArcGISHub is returned in this dictionary as well.
# Usage Example: Organization that initiated a Partner Collaboration# and uses Hub Basic>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>collab_mgr=gis.admin.partnered_collaboration>>>collab_mgr.properties{'total':2,'start':1,'num':10,'nextStart':-1,'trustedOrgs':[{'from':{'orgId':'JQx...','usersAccess':True,'established':1566327495000,'hub':True,'state':'active'},'to':{'orgId':'aee...','usersAccess':True,'established':1566327495000,'name':'Hub Community','hub':True,'state':'active'}},{'from':{'orgId':'JQx...','usersAccess':False,'established':1705623169000,'hub':False,'state':'active'},'to':{'orgId':'KRW...','usersAccess':False,'established':-1,'name':'Organization for Demo','hub':False,'state':'active'}}]}
- Returns:
dict
- propertysession:EsriSession
returns the current EsriSession
PartneredCollaboration
- classarcgis.gis.admin.PartneredCollaboration(url:str,gis:GIS)
Bases:
object
Represents a singlepartnered collaborationfor the organization.
- accept(user_access:bool)→bool
Accepts the invitation and establishes a partnered collaboration.
Parameter
Description
user_access
Required Boolean. Indicates whether the
users
within thepartnered organization can search for userswithin the accepting organization.
- delete(message:str|None=None)→bool
This operation ends the partnered collaboration
Parameter
Description
message
Optional String. Text to appear in the emailnotification to the collaboration partneradministrators and coordinators when ending thecollaboration.
- propertygroups:Generator[_arcgis_gis.Group]
Returns a generator for accessing the
groups
who have members in either of theorganizations in apartnered collaboration.
- propertyis_active:bool
Checks whether the collaboration is active between bothcollaborating organizations.
- propertyproperties:dict[str,Any]
Returns a dictionary indicating various attributes of thecollaboration from the perspective of the organization.
#Usage Example>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>partner_collab_mgr=gis.admin.partnered_collaboration>>>partner_collab=next(partner_collab_mgr.collaboration(include_hub=False))>>>partner_collab.properties{'from':{'orgId':'JXM4...','usersAccess':True,'established':1706041472000,'hub':False,'state':'active'},'to':{'orgId':'SPK1...','usersAccess':True,'established':1706218200000,'name':'My Account','hub':False,'state':'active'}}
- propertysearch_users:bool
Property used to get or set the ability for collaboration membersto search for
users
with public or organizationaccess profiles within collaborating organizations.# Usage Example:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>partner_collab=next(gis.admin.partnered_collaboration.collaborations())>>>parnter_collab.search_users=True
- propertysession:EsriSession
Returns an
EsriSession
object.
- propertysuspend:bool
Gets/sets the state of the collaboration. To suspend collaboration, setthe property toTrue
- Returns:
Boolean.False means the collaboration is not suspended.True means the partnership is suspended.
# Usage Example: Suspend the collaboration>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_online_admin_profile")>>>partner_collab_mgr=gis.admin.partnered_collaboration>>>partner_collab=next(partner_collab_mgr.collaborations())# Get current suspension status>>>partner_collab.suspendFalse# Suspend the collaboration>>>partner_collab.suspend=True
PortalResourceManager
- classarcgis.gis.admin.PortalResourceManager(gis)
Bases:
object
Helper class to manage a GIS’ resources
Parameter
Description
gis
required GIS, connection to ArcGIS Online or ArcGIS Enterprise
- add(key:str|None=None,path:str|None=None,text:str|None=None,**kwargs)
The add resource operation allows the administrator to add a fileresource, for example, the organization’s logo or custom banner.The resource can be used by any member of the organization. Fileresources use storage space from your quota and are scanned forviruses.
Parameter
Description
key
optional string, look up key for file
path
optional string, file path to the local resource to upload
text
optional string, text value to add to the site’s resources
access
optional string, sets the access level for the resource. Thedefault is ‘public’.Values: public, org, orgprivate
- Returns:
boolean
- delete(key:str)
The Remove Resource operation allows the administrator to removea file resource.
Parameter
Description
key
optional string, look up key for file to delete
- Returns:
boolean
- get(resource_name:str,download_path:str|None=None)
Download or get a portal resource item
Parameter
Description
resource_name
optional string, key/name of data
download_path
optional string, save folder location
- Returns:
path to data or raw data if not file.
- list(start:int=1,num:int=100)
returns a list of resources uploaded to portal. The items can beimages, files and other content used to stylize and modify aportal’s appearance.
Parameter
Description
start
optional int, start location of the search. The default isa value of 1
num
optional int, the number of search results to return at onetime. The value ranges between 1-100 (max).Default: 100 and -1 means all resources
- Returns:
boolean
UX
- classarcgis.gis.admin.UX(gis)
Bases:
object
Helper class for modifying common org settings. This class is not created by users directly. An instance ofthe class, called ‘ux’, is available as a property of the GIS object. Users call methods on this ‘ux’ objectto set informational banner, background, logo, name etc. There are also other helper classes to call from this.By calling the ‘org_map_editor’ or ‘homepage_editor’ more methods can be found to change org settings specificto those categories.
- propertyadmin_contacts
An array of chosen administrators listed as points of contact whoseemail addresses will be listed as points of contact in the automaticemail notifications sent to org members when they request password resets,help with their user names, modifications to their accounts, or any issuesrelated to the allocation of credits to their accounts.
- clone(*,targets:list[GIS|None]|None=None,workspace_folder:str|None=None,package_save_folder:str|None=None,package_name:str|None=None)→list[Future]
Copies the UX settings from the source WebGIS site to the destination WebGIS site or toa.uxpk offline file.When directly connected to two WebGIS’, this method performs the clone operation immediately.When cloning in an offline situation, a.uxpk is created and stored on the user’s localhard drive.
Parameter
Description
targets
list[GIS | None]. The sites to clone to. If None is given, thena local file is returned.
workspace_folder
Optional String. The workspace where the temporary files areprocessed.
package_save_folder
Optional String. The output folder where the offline package issaved.
package_name
Optional String. The saved package name minus the extension.
- Returns:
list[concurrent.futures.Future]
- propertydescription
Get/Set the site’s description.
Parameter
Description
description
Required string. Descriptive text of the site. If None, thevalue is reset to default.
- Returns:
dictionary
- propertydescription_visibility
Get/Set the site’s description visibility
Parameter
Description
visiblity
Required boolean. If True, the desciptive text will show on thehome page. If False, the descriptive text will not be displayed
- Returns:
boolean or error
- propertyfeatured_content:dict
Gets/Sets the featured content group information.
If you set the featured content, reinstantiate to update the gis properties and see the updatedlist of featured_content.
Parameter
Description
content
Required list or dictionary, defines the group(s) of the featurecontent area on an organizational site. A value of None willreset the value back to no featured groups.
To add a new group to the list you must pass in the list of currentfeatured content and include the new group in the list. “id” key must be inthe dictionary, extra keys are ok.
It is also acceptable to pass a list of Group class instances.
Example:[{“id”: <group_id>}, {“id”: <group_id>}, etc.]
- Returns:
dictionary
- propertygallery_group
The gallery highlights your organization’s content.Choose a group whose content will be shown in the gallery.To change the group, assign either an instance of Group or the group id.Setting to None will revert to default.
- Returns:
An instance of Group if a group is set, else the default or None
- get_logo(download_path:str)
Get your organization’s logo/thumbnail. You can use theset_logo() method to set an image as your logo.
Parameter
Description
download_path
required string. Folder path to download the logo file.
- Returns:
Path to downloaded logo file. If None, then logo is not set and nothing was downloaded.
- propertyhelp_source
Toggle if the help source is turned on (True) or off (False).It provides the base URL for your organization’s help documentation.
- propertyhomepage_settings
Get an instance of the
HomePageSettings
classto make edits to the organization’s homepage such as the background,title, logo, etc.
- propertyitem_settings
Get an instance of the
ItemSettings
class to make edits to the org’s defaultmap settings such as comments, metadata, etc.
- load_offline_configuration(package:str)→Future
Loads the UX configuration file into the current active portal.
- propertymap_settings
Get an instance of the
MapSettings
class tomake edits to the org’s default map settings such as extent, basemap, etc.
- propertyname
Get/Set the site’s name.
Parameter
Description
name
required string. Name of the site.
- Returns:
string of the name of the site
- navigation_bar(gallery:str|None=None,map:str|None=None,scene:str|None=None,groups:str|None=None,search:str|None=None)
Set the visibility of the content in the navigation bar. To get the current navigationbar settings do not pass in any values for the parameters.
Note
The Home link is always visible to everyone. The Content link is always visible to members.Member roles determine Organization link visibility.
Parameter
Description
gallery
Optional string.Values: “all” | “members” | “noOne”
map
Optional string.Values: “all” | “members” | “mapCreators”
scene
Optional string.Values: “all” | “members” | “sceneCreators”
groups
Optional string.Values: “all” | “members”
search
Optional string.Values: “all” | “members”
- Returns:
Dictionary of the navigation bar and it’s settings.
- propertysecurity_settings
Get an instance of the
SecuritySettings
classto make edits to the organization’s default map settings such asthe informational banner, password policy, etc.
- set_logo(logo_file:str|None=None,show_logo:bool|None=None)
Configure your home page by setting the organization’s logo image. For best results the logo file should be65 x 65 pixels in dimension.
For more information, refer tohttp://server.arcgis.com/en/portal/latest/administer/windows/configure-general.htm
Parameter
Description
logo_file
Optional string. Specify path to image file. If None, existing thumbnail is removed.
show_logo
Optional bool. Specify whether the logo is visible on the homepage or not.
- Returns:
True | False
- set_org_language(language:str,format:str|None=None)
Choose the default language for members of your organization. Thischoice affects the user interface as well as the way time,date, and numerical values appear. Individual members can customizethis choice on their settings page.
Parameter
Description
language
Required string. To see all available languages, usethelanguages property in the GIS class.
format
Optional string. Determine the culture format to beused depending on the language. To see the culture formatsavailable, use thelanguages property in the GIS classand look at the ‘cultureFormats’ key for each language.
- Returns:
True | False
- shared_theme(header:dict[slice(<class'str'>,<class'str'>,None)]|None=None,button:dict[slice(<class'str'>,<class'str'>,None)]|None=None,body:dict[slice(<class'str'>,<class'str'>,None)]|None=None,logo:str|None=None)
Use the shared theme to apply your organization’s brand colors andlogo to information products created from ArcGIS Configurable Apps templates,Web AppBuilder, and Enterprise Sites. To see the current settings, call the method withno parameters passed in.
Parameter
Description
header
Optional dict. Composed of two keys: “background” and “text” thatdetermine the shared theme color for each of these keys. Colorcan be passed in a hexadecimal string.
ex: header = {“background” : “#0d7bba”, “text” : “#000000”}
button
Optional dict. Composed of two keys: “background” and “text” thatdetermine the shared theme color for each of these keys.
body
Optional dict. Composed of three keys: “background”, “text” and“link” that determine the shared theme color for each of these keys.
logo
Optional str. The file path or link to the image that will be uploadedas the shared theme logo.To remove the logo and not replace it then pass in: “”
- Returns:
Dictionary of the shared theme that is set on the org.
HomePageSettings
- classarcgis.gis.admin.HomePageSettings(gis)
Bases:
object
Helper class called from the UX class property: ‘homepage_settings’. Make edits to background,title, logo, etc.
- get_background(download_path:str|None=None)
Get your organization’s home page background image. You can use theset_background() method to set an imageas the home page background image.
For more information, refer tohttp://server.arcgis.com/en/portal/latest/administer/windows/configure-home.htm
Parameter
Description
download_path
Required string. Folder path to download the background file.If the background image is a stock image then an instance of theStockImage class will be returned and the download_path will be ignored.If you know the background is a stock image then don’t provide a download path.
- Returns:
Path to downloaded background file. If the cover image is a stock image then the stock image’s name from the StockImage class will be returned.
- get_logo(download_path:str)
Get your organization’s logo/thumbnail. You can use theset_logo() method to set an image as your logo.
Parameter
Description
download_path
required string. Folder path to download the logo file.
- Returns:
Path to downloaded logo file. If None, then logo is not set and nothing was downloaded.
- get_title()
Get the title displayed on the homepage if show title is set to True.
- Returns:
Dict or None if using old homepage
- set_background(background_file:str|None=None,is_built_in:bool=True,stock_image:StockImage|None=None,layout:str|None=None,opacity:int|None=None)
Configure your home page by setting the organization’s background image. You can choose no image, a built-in imageor upload your own. If you upload your own image, the image is positioned at the top and center of the page.The image repeats horizontally if it is smaller than the browser or device window. For best results, if you wanta single, nonrepeating background image, the image should be 1,920 pixels wide (or smaller if your users are onsmaller screens). The website does not resize the image. You can upload a file up to 1 MB in size.
For more information, refer tohttp://server.arcgis.com/en/portal/latest/administer/windows/configure-home.htm
Parameter
Description
background_file
Optional string. If using a custom background, specify path to image file.To remove an existing background, specify None for this argument andFalse for is_built_in argument.
is_built_in
Optional bool, default=True. The built-in background is set by default.If uploading a custom image, this parameter is ignored.
stock_image
Optional instance of StockImage class or string that representsa stock image key.
layout
Optional string. The layout height of the cover image. The values are:“Full-height”, “Two-thirds-height”, or “Half-height”.
opacity
Optional int that represent the opacity of the header. The value isanything from 0 to 1 included.
- Returns:
True | False
- set_contact_email(email:str|None=None,show_email:bool|None=None)
Set the email shown in the footer of the homepage and whether it is visible.
- set_footer(text:str|None=None,show_text:bool|None=None)
Set the text and the visibility of the text in the footer
- set_logo(logo_file:str|None=None,show_logo:bool|None=None,alignment:str|None=None,position:str|None=None)
Configure your home page by setting the organization’s logo image. For best results the logo file should be65 x 65 pixels in dimension.
For more information, refer tohttp://server.arcgis.com/en/portal/latest/administer/windows/configure-general.htm
Parameter
Description
logo_file
Optional string. Specify path to image file. If None, existing thumbnail is removed.
show_logo
Optional bool. Specify whether the logo is visible on the homepage or not.
alignment
Optional string. Values can either be “center” or “left”. This will setthe alignment for the title and logo on the header.
position
Optional string. Set the title and logo position on the homepage.Values: “middle” | “above” | “below” | “top3rd” | “bottom3rd”
- Returns:
True | False
- set_title(title:str|None=None,show_title:bool|None=None,color:str|None=None,alignment:str|None=None,position:str|None=None)
Set the homepage title and it’s visibility
Parameter
Description
title
Optional string. The title to show on the homepage.
show_title
Optional boolean. Determine if title is shown (True) or hidden (False).
color
Optional string. Specifies the font color for the for thetitle. This property recognizes common colornames (such as red or blue) and hexadecimal color values.
alignment
Optional string. Values can either be “center” or “left”. This will setthe alignment for the title and logo on the header.
position
Optional string. Set the title and logo position on the homepage.Values: “middle” | “above” | “below” | “top3rd” | “bottom3rd”
- Returns:
True | False
- set_typography(font_family:list,custom:bool=False)
Parameter
Description
font_family
Optional list. The combination of fonts to use for typographyof the homepage. The first string represents the title font andthe second string represents the body font. If a custom typographywill be set, specify custom = True parameter
Values:[“Avenir Next”, “Avenir Next”][“Avenir Next”, “Noto Serif”][“Noto Serif”, “Avenir Next”][“Noto Serif”, “Noto Serif”]
custom
Optional bool. If True, a custom list of typography was passed inas the value for the font_family parameter.
ItemSettings
- classarcgis.gis.admin.ItemSettings(gis)
Bases:
object
Helper class that can be called off of UX class using the ‘item_settings’ property.Edit org item settings such as the enabling/disabling comments, metadata info, etc.
- propertyenable_comments
Get/Set item commenting and comments.
Parameter
Description
enable
Optional boolean. If True, the comments for the site are turnedon. False will disable comments (default)
- Returns:
True if enabled, False if disabled
MapSettings
- classarcgis.gis.admin.MapSettings(gis)
Bases:
object
Helper class that can be called off of UX class using the ‘map_settings’ property.Edit org map settings such as the default extent, default basemap, etc.
- propertyanalysis_layer_group
Select the group whose layers will be shown in the Analysis Layergallery for the analysis tools. It is best practice to share featureitems that contain only a single layer with this group.If your feature layer item contains multiple layers, save any of thelayers as an item and share it with the group.
- Returns:
If set, an instance of Group else the default or None
- propertybasemap_gallery_group
Select the group whose web maps will be shown in the basemap gallery.To change the group, assign either an instance of Group or the group id.Setting to None will revert to default.
- Returns:
An instance of Group if a group is set, else the default or None
- bing_map(bing_key:str|None=None,share_public:bool|None=None)
Provide a Microsoft-supplied Bing Maps key to use Bing Maps in your portal’s web maps.
Bing Map Key:https://www.bingmapsportal.com/
Parameter
Description
bing_key
Optional str. The bing key to pass in. To removepass in “”.
share_public
Optional bool. If True, allows this Bing Mapskey to be used in maps shared publicly byorganization members.This requires the access of the portal to be set as public.
- Returns:
Dictionary containing the bing key and whether is is publicly shared
- propertyconfig_apps_group
ArcGIS Configurable Apps contain various settings users can configureto create web apps. Map-based apps display one or more maps.Choose which group contains the apps you want to use in the configurable appsgallery.
Assign either an instance of Group class, a group id, or None to resetto default.
- Returns:
An instance of group if a group is set, else the default or None
- propertydefault_basemap
Get/Set the site’s default basemap.
The Default Basemap opens when users click New Map. Set the groupin the Basemap Gallery above and choose the map to open. It willopen at the default extent you set.
Parameter
Description
basemap
Required string. The new default basemap to set. If None, thedefault value will be set.
- Returns:
dictionary
- propertydefault_extent
Get/Set the site’s default extent
Parameter
Description
extent
Required dictionary. The default extent defines where a webmapwill open.If a value of None is given, the default extent will be provided.Example Extent (default):{“type”:”extent”,”xmin”:-17999999.999994524,”ymin”:-11999999.999991827,“xmax”:17999999.999994524,”ymax”:15999999.999982955,“spatialReference”:{“wkid”:102100}}
- Returns:
dictionary
- propertydefault_mapviewer
Get/Set whether the org’s default Map Viewer is MapViewerClassic or themodern Map Viewer.
Values: “modern” | “classic”
- update_basemap_gallery()
Update the basemap gallery group by getting rid of deprecated maps andadding any non-deprecated default basemaps.Returns the updated group.
- propertyuse_3D_basemaps:bool
Include Esri default 3D basemaps. The 3D basemaps can be used as areference in a web scene.
This is only applicable to to ArcGIS Online
- propertyuse_vector_basemap
If true, the organization uses the Esri vector basemaps in supportedArcGIS apps and basemapGalleryGroupQuery will not be editableand will be set to the default query.
- propertyvector_basemap
Get/Set the default vector basemap
Parameter
Description
basemap
required dictionary. The new default vector basemap to set fora given site.
- Returns:
The current default vector basemap
- web_styles(group:Group|str|None=None,two_dimensional_map:bool=False,three_dimensional_map:bool=False)
Web styles are collections of symbols stored in an item. Apps canuse web styles to symbolize point features with 2D or 3D symbols.Select a group to be used in symbol galleries.
Parameter
Description
group
Optional str or Group. either an instance of Group class,a group id, or None to reset to default.
two_dimensional_map
Optional bool. If True, the group will be assignedto 2D Web Style.
three_dimensional_map
Optional bool. If True, the group will be assignedto 3D Web Style.
- Returns:
dict indicating the group(s) set for the 2D and 3D styles
SecuritySettings
- classarcgis.gis.admin.SecuritySettings(gis)
Bases:
object
Helper class that can be called off of UX class using the ‘security_settings’ property.Edit org item settings such as the informational banner, password policy, etc.
- propertyallowed_origins
Get/Set the list of allowed origins.
Allowed Origins limit the web application domains that can connectvia Cross-Origin Resource Sharing (CORS) to the ArcGIS REST API.
Can set a list of up to 100 web application domains to restrict CORS access to the REST API.
- propertyallowed_redirect_uris
Configure a list of portals with which you want to share secure content.This will allow members of your organization to use their enterprise loginsto access the secure content when viewing it from these portals.
Set a list of allowed redirect URIs which represent portal instances thatyou share secure content with. This will allow your organization usersto be able to use enterprise logins to access the secured contentthrough web applications hosted on these portals.
- delete_email_settings()
This operation deletes all previously configured email settings foryour organization. Once deleted, email notifications about passwordpolicy changes and license expirations will no longer be received bymembers listed under your Administrative Contacts.As well, users will no longer be able to use their email to retrieve forgotten passwords.
- propertyenable_update_user_profile
Allow members to edit biographical information and who can see their profile.
- get_anonymous_access_notice()
Get the provided notice of terms to be displayed to all users whoaccess your organization. Users can proceed only if they accept theterms of the notice. They will not be prompted again for the remainderof the browser session. If you set both types of access notices,an organization member will see two notices.
- Returns:
The dict representation of the notice or if none set then None.
- get_email_settings()
This resource returns the email settings that have been configuredfor your organization. These settings can be used to send out emailnotifications from ArcGIS Enterprise portal about password policyupdates and user type, add-on, or organization capability license expirations.
- Returns:
Dictionary of email settings, if None set then empty dict is returned.
- get_idp(idp:str|None=None)
List organization identity federation information configured using asingle identity provider such as Active Directory FederationServices (ADFS) 2.0 and later, Okta, NetIQ Access Manager 3.2and later, OpenAM 10.1.0 and later, Shibboleth 3.2 and later, etc.
ArcGIS Online Only.
Parameter
Description
idp
The idp to get. If none provided, allavailable are returned.
- Returns:
Json Dictionary response
- get_informational_banner()
Get the informational banner dictionary from the org’s settings.If none set, return None
- get_multifactor_authentication()
See if multifactor authentication is set and who are the admins thatare set as points of contact.
- Returns:
dict
- get_org_access_notice()
Get the provided notice of terms to be displayed to organization membersafter they have signed in. Members can proceed only if they acceptthe terms of the notice. They will not be prompted again till thenext time they sign in.
- Returns:
The dict representation of the notice or if none set then None.
- get_password_policy()
Get the password policy currently set for your org.Returns a dictionary indicating the rules currently set as the policy.
- register_idp(name:str,metadata_file:str|None=None,metadata_url:str|None=None,binding_url:str|None=None,post_binding_url:str|None=None,logout_url:str|None=None,entity_id:str|None=None,signup_mode:str='Invitation',encryption_supported:bool=False,support_signed_request:bool=False,use_SHA256:bool=False,support_logout_request:bool=False,update_profile_at_signin:bool=False,update_groups_at_signin:bool=False)
Allows organization administrators to configure a new enterprise login.Configuring enterprise login allows members of your organization to signin to your organization using the same logins they use to access yourenterprise information systems without creating additional logins.ArcGIS Online and ArcGIS Enterprise are compliant with SAML 2.0 and integratewith IDPs that support SAML 2 web single sign-on for securely exchangingauthentication and authorization data between your organization and ArcGIS Onlineor ArcGIS Enterprise as a service provider (SP). An organization can be set upusing either a single IDP or a federation, but not both.
Parameter
Description
name
Required string. The identity provider name.
metadata_file
Optional string. Metadata file that contains informationabout the IDP. One can also specify the settingsusing metadata_url or binding_url and post_binding_urlparameters alternatively.
metadata_url
Optional string. Metadata URL that returns informationabout information about the IDP.
binding_url
Optional string. The HTTP redirect binding IDP’sURL that your organization uses to allow a memberto sign in.
post_binding_url
Optional string. The HTTP POST binding IDP’s URLthat your organization uses to allow a member to sign in.
logout_url
Optional string. IDP URL used to sign out a signed-inuser (automatically set if the property is specifiedin the IDP metadata file).
entity_id
Optional string. Entity ID used to identify theorganization in IDP.
signup_mode
Optional string. Specifies whether enterprise membersjoin the organization automatically or through an invitation.
Values: ‘Automatic’ | ‘Invitation’
encryption_supported
Optional bool. If True, it indicates to the identityprovider that encrypted SAML assertion responsesare supported. The default is False.
support_signed_request
Optional bool. If True, the organization signs theSAML authentication request sent to the IDP.The default is False.
use_SHA256
Optional bool. If True, the organization signs therequest using the SHA-256 hash function. This isused when support_signed_request is True.The default is False.
support_logout_request
Optional bool. If True, signing out of the organizationpropagates logout of the IDP. The default is False.
update_profile_at_signin
Optional bool. If True, automatically syncs useraccount information (that is, full name and email address)stored in your organization with the informationreceived from the IDP. The default is False.
update_groups_at_signin
Optional bool. If True, enables SAML-based groupmembership that allows organization members to linkspecified SAML-based enterprise groups to yourorganization’s groups during group creation.The default is False.
- Returns:
Dictionary json response indicating success and IDP Id
- set_anonymous_access_notice(title:str|None=None,text:str|None=None,button_type:str|None=None,enabled:bool|None=False)
Provide a notice of terms to be displayed to all users who access yourorganization. Users can proceed only if they accept the terms of thenotice. They will not be prompted again for the remainder of thebrowser session. If you set both types of access notices, anorganization member will see two notices.
Parameter
Description
title
Optional string. The title to set the for the notice.If None then notice will be disabled.
text
Optional string. The text body to set for the notice.If None then notice will be disabled.
button_type
Optional string. The button types the users will seefor the notice. Default is an accept and decline button.
Values: “acceptAndDecline” | “okOnly”
- Returns:
True | False
- set_approved_apps(block_unapproved:bool=False)
Control which apps members are allowed to access without a‘Request for Permissions’ prompt. Approved web apps can optionally bemade available to organization members in the App Launcher.
Note
Only available in ArcGIS Online
Parameter
Description
block_unapproved
Optional bool. Determine whether members can onlysign in to external apps that are approved. Defaultis False.
- set_blocked_apps(block_beta_apps:bool=False,apps:list[str]|None=None)
Control which apps are blocked for all members in your organizationin order to comply with regulations, standards, and best practices.
Note
Only available in ArcGIS Online
Parameter
Description
block_beta_apps
Optional bool. Block Esri apps while they are in beta.Default is False.
- Returns:
Json dictionary response indicating success or failure.
- set_email_settings(smtp_host:str,smtp_port:int,from_address:str,from_address_label:str,encryption_method:str='SSL',auth_required:bool=False,username:str|None=None,password:str|None=None)
This operation allows you to configure email settings for your organization.These settings will be used to send out email notifications from ArcGISEnterprise portal regarding password policy updates and license expirations.
Note
Not for ArcGIS Online.
Parameter
Description
smtp_host
Requried string. The IP address, or the fullyqualified domain name (FDQN), of the SMTP Server.
Example: smtpServer=smtp.myorg.org
smtp_port
Required integer. The port the SMTP Server willcommunicate over. Some of the most common communicationports are 25, 465, and 587.
from_address
Required string. The email address that will beused to send emails from the ArcGIS Enterprise portal.It is recommended that the user associated withthis email address is listed under the AdministrativeContacts for your organization.
from_address_label
Required string. The label, or person, associatedwith the from_email_address. This information will bedisplayed as the sender in the From line forall email notifications.
encryption_method
Optional string. The encryption method for emailmessages sent from ArcGIS Enterprise portal.
Values: ‘SSL’ | ‘TLS’ | ‘NONE’
auth_required
Optional bool. Specifies if authentication isrequired (True) to connect with SMTP server specifiedabove. At 10.8.1, only basic authentication(username and password) is supported.The default is False.
username
Optional string. If auth_required is True, thisspecifies the username of a user who is authorizedto access the SMTP server. This field will be unableto be defined if auth_required is False.
password
Optional string. If auth_required is True, thisspecifies the password associated the authorizeduser specified above. This field will be unable tobe defined if auth_required is False.
- Returns:
Dictionary indicating success or failure.
- set_informational_banner(text:str|None=None,bg_color:str|None=None,font_color:str|None=None,enabled:bool|None=None)
The informational banner that is shown at the top of your organization’s page.
Parameter
Description
text
Optional string. The text that the informational banner will display.To set an empty text use: “”
bg_color
Optional string. Specifies the background color for theinformational banner. This property recognizes common color names(such as red or blue) and hexadecimal color values. While youare able to choose any color for this property, it is recommendedthat you choose a color that contrasts appropriately with thefont_color, as a poor contrast will cause a warning to appearin the Security settings page of yourEnterprise portalalerting you to the insufficient contrast.
font_color
Optional string. Specifies the font color for the for theinformational banner. This property recognizes common colornames (such as red or blue) and hexadecimal color values.While you are able to choose any color for this property,it is recommended that you choose a color that contrastsappropriately with the bg_color, as a poor contrast willcause a warning to appear in the Security settings page of yourEnterprise portal alerting you to the insufficient contrast.
enabled
Optional bool. Determine whether the informational banner isenabled (True) or disabled (False).
- Returns:
True if succeeded
- set_multifactor_authentication(admins:list[str]|None=None,enabled:bool=False)
Multifactor authentication provides all members with ArcGIS accountsin your organization with an extra level of security by requestingan additional verification code at the time of login.
Parameter
Description
admins
Optional list of strings. Designate at least twoadministrators who will receive email requeststo troubleshoot members’ multifactorauthentication issues. Provide a list of at leasttwo admin usernames.
enabled
Optional bool. Allow members to choose whether toset up multifactor authentication fortheir individual accounts. Default is False.
- Returns:
True | False
- set_org_access_notice(title:str|None=None,text:str|None=None,button_type:str|None=None)
Provide a notice of terms to be displayed to organization membersafter they have signed in. Members can proceed only if they acceptthe terms of the notice. They will not be prompted again till thenext time they sign in.
Parameter
Description
title
Optional string. The title to set the for the notice.If None then notice will be disabled.
text
Optional string. The text body to set for the notice.If None then notice will be disabled.
button_type
Optional string. The button types the users will seefor the notice. Default is an accept and decline button.
Values: “acceptAndDecline” | “okOnly”
- Returns:
True | False
- set_social_media_login(social_login:bool,social_networks:list[str]|None=None,social_network_order:list[str]|None=None)
Customize the organization’s sign in page so that members can sign in using anyof the methods below. The order they appear here will determine the order thatthey appear in the sign in page.
Parameter
Description
social_login
Required bool. Allow members to sign up and sign into your organization using their login from thefollowing social networks: Facebook, Google, Github, Apple
social_networks
Optional list of strings. The social networks allowed touse as sign in options for the org.
Options: Facebook, Google, Github, Apple
social_network_order
Optional list of strings. The order in which thesocial network login options will appear on thelogin page.
If none is set then current settings are used.
- propertysignin_settings
Get the signin settings for the org.
- Returns:
Dictionary response of the settings and their values
- test_email_settings(mail_to:str)
This operation can be used once the email settings have beenconfigured using the set_email_settings operation to send a testemail via the SMTP server to ensure that the organization’s emailsettings have been properly configured. If successful, an emailwill be sent out to the specified email address (mail_to).
Parameter
Description
mail_to
Requried string. The email the test message willbe sent to.
- Returns:
Dictionary result stating success and number of seconds to wait before rechecking.
- propertytrusted_servers
Configure the list of trusted servers you wish your organization tosend credentials to when working with services secured with web-tier authentication.
Set a list of trusted servers that clients can send credentials to whenmaking Cross-Origin Resource Sharing (CORS) requests to access web-tier secured services.
- unregister_idp(idp:str)
The unregister IDP operation (POST only) allows organizationadministrator to remove the enterprise login set up with a single identity provider.
Parameter
Description
idp
The idp id to unregister.
- Returns:
Json dictionary response indicating success.
- update_password_policy(min_length:int|None=None,include_uppercase:bool|None=None,include_lowercase:bool|None=None,include_letter:bool|None=None,include_number:bool|None=None,include_special_char:bool|None=None,expires_in:int|None=None,history_number:int|None=None)
Set the password policy for members in your organization that have ArcGISaccounts. Note that member passwords may not match their username. Weakpasswords will be rejected. You may set the following rules forthese passwords by turning them on (True) or off (False) and specifying a numberwhere requested.
Parameter
Description
min_length
Optional int. Password must contain at least the followingnumber of characters. Cannot set this under 8 characters.
include_uppercase
Optional bool. Must contain at least one upper case letter (A-Z).
include_lowercase
Optional bool. Must contain at least one lower case letter (a-z).
include_letter
Optional bool. Must contain at least one letter (A-Z, a-z).
include_number
Optional bool. Must contain at least one number (0-9).
include_special_char
Optional bool. Must contain at least one special(non-alphanumeric) character
expires_in
Optional int. Password expires after the specified number of days.Value between 1 and 1095 days.If value of 0 is passed in then it will disable this parameter.
history_number
Optional int. Users cannot reuse the specified number of last passwords.Password history may have a value between 1 and 24 passwords.If value of 0 is passed in then it will disable this parameter.
EmailManager
- classarcgis.gis.admin.EmailManager(url,gis=None,**kwargs)
Bases:
BasePortalAdmin
- test(email:str)
Sends a test email to a provided email account to ensure theconfiguration is correct.
Parameter
Description
email
Required String. The test email to send to.
- Returns:
Boolean. True if successful else False.
- update(server:str,from_email:str,require_auth:bool,email_label:str|None=None,port:int=25,encryption:str='SSL',username:str|None=None,password:str|None=None)
Configures the Email Server for Portal
Parameter
Description
server
Required String. The email address
from_email
Required String. The email address the email originates from.
require_auth
Required Boolean. If True, the smtp requires authentication andthe username and password must be provided. If False, noauthentication is needed for the smtp server.
email_label
Optional String. The email label.
port
Optional Integer. The port number for the smtp server.
encryption
Optional String. The encryption method used for the email server. Theallowed values are: SSL, TLS, or NONE.
username
Optional String. The username to use to login to the smtp server.
Password
Optional String. The password to use to login to the smtp server.
- Returns:
Boolean. True if successful else False.
Federation
- classarcgis.gis.admin.Federation(url,gis)
Bases:
BasePortalAdmin
This resource returns information about the ArcGIS Servers registeredwith Portal for ArcGIS.
- federate(url:str,admin_url:str,username:str,password:str)
This operation enables ArcGIS Servers to be federated with Portalfor ArcGIS.
Parameter
Description
url:
Required string. The URL of the GIS server used by external userswhen accessing the ArcGIS Server site. If the site includes the WebAdaptor, the URL includes the Web Adaptor address, for example,
https://webadaptor.domain.com/arcgis
. If you’ve added ArcGISServer to your organization’s reverse proxy server, the URL isthe reverse proxy server address (for example,https://reverseproxy.domain.com/myorg
). Note that the federationoperation will perform a validation check to determine if theprovided URL is accessible from the server site. If the resultingvalidation check fails, a warning will be generated in the Portalfor ArcGIS logs. However, federation will not fail if the URL isnot validated, as the URL may not be accessible from the serversite, such as is the case when the server site is behind afirewall.admin_url
Required string. The URL used for accessing ArcGIS Server whenperforming administrative operations on the internal network, forexample,
https://gisserver.domain.com:6443/arcgis
.username
Required string. The username of the primary site administrator account
password
Required string. password of the username above.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- propertyservers
This resource returns detailed information about the ArcGIS Serversregistered with Portal for ArcGIS, such as the ID of the server,name of the server, ArcGIS Web Adaptor URL, administration URL, andif the server is set as a hosting server.
- unfederate(server_id:str)
This operation unfederates an ArcGIS Server from Portal for ArcGIS.
Parameter
Description
server_id
Required string. The unique ID of the server
- Returns:
Boolean. True if successful else False.
- update(server_id:str,role:str,function:str|None=None)
This operation allows you to set an ArcGIS Server federated withPortal for ArcGIS as the hosting server or to enforce fine-grainedaccess control to a federated server. You can also remove hostingserver status from an ArcGIS Server. You can also remove hostingserver status from an ArcGIS Server. To set a hosting server, anenterprise geodatabase must be registered as a managed databasewith the ArcGIS Server.
Parameter
Description
server_id
Required string. The unique ID of the server
role
Required string. Whether the server is a hosting server for theportal, a federated server, or a server with restricted access topublishing. The allowed values are:FEDERATED_SERVER, FEDERATED_SERVER_WITH_RESTRICTED_PUBLISHING,or HOSTING_SERVER.
function
Optional string. This is the purpose of the ArcGIS Server.Values are: GeoAnalytics, RasterAnalytics, ImageHosting, NotebookServer, MissionServer, WorkflowManager, or None
- Returns:
Dictionary indicating ‘success’ or ‘error’
Indexer
- classarcgis.gis.admin.Indexer(url,gis=None,**kwargs)
Bases:
BasePortalAdmin
This resource contains connection information to the default indexing service.
- reconfigure()→bool
This operation recreates the index service metadata, schema, and data in the event it becomes corrupted.
- Returns:
Boolean
- reindex(mode,includes=None)
The operation allows you to generate or update the indexes for content, such as users, groups, and items stored in the database store.
Parameter
Description
mode
Required String. The mode in which the indexer should run.Values: USER_MODE, GROUP_MODE, SEARCH_MODE, or FULL_MODE
includes
Optional String. A comma separated list of elements to include inthe index. This is useful if you want to only index certain itemsor user accounts.
- Returns:
Boolean
- propertystatus
status allows you to view the status of the indexing service. Youcan view the number of users, groups, and search items in both thedatabase (store) and the index. If the database and index do notmatch, indexing is either in progress or there is a problem withthe index. It is recommended that you reindex to correct anyissues. If indexing is in progress, you can monitor the status byrefreshing the page.
- Returns:
dict
Logs
- classarcgis.gis.admin.Logs(url,gis)
Bases:
BasePortalAdmin
Logs are records written by various components of the portal. You canquery the logs, clean the logs, and edit log settings.
Parameter
Description
gis
required GIS, portal connection object
url
required string, web address of the log resource
- clean()
Deletes all the log files on the machine hosting Portal for ArcGIS.This operation allows you to free up disk space. The logs cannot berecovered after executing this operation.
USAGE:CleanlogsfromyourPortalAdminAPIfromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")logs=gis.admin.logsresp=logs.clean()print(resp)# OutputTrue
- Returns:
Boolean True or False depicting success
- query(start_time:datetime|float,end_time:datetime|float|None=None,level:str='WARNING',query_filter:str|dict='*',page_size:int=1000,*,federated_servers:str|None=None)
The query operation allows you to aggregate, filter, and pagethrough logs written by the portal. Please seeQuery Logsfor full details on parameters.
Parameter
Description
start_time
Required datetime, integer, or string. The most recent time toquery.
Local date corresponding to the POSIX timestamp, such as isreturned by time.time().
Note
This may raise OverflowError, if thetimestamp is out of the range of values supported by theplatform. It’s common for this to be restricted to years from1970 through 2038.
Time can be specified as:
a portal timestamp string formatted as: “%Y-%m-%dT%H:%M:%S”:
>>>start_time="2025-02-01T15:18:22"
integer milliseconds since UNIX epoch. For example:
>>>start_time=1738396800000
Datetime Object:
>>>start_time=datetime.datetime.now()
end_time
Optional datetime, integer, string. The latest time to includein the result. You can use this to limit the query to the lastnumber of minutes, hours, days, months, and years as needed.
Local date corresponding to the POSIX timestamp, such as isreturned by time.time().
Note
This may raise OverflowError, if thetimestamp is out of the range of values supported by theplatform. It’s common for this to be restricted to years from1970 through 2038.
Time can be specified as:
a portal timestamp string formatted as: “%Y-%m-%dT%H:%M:%S”:
>>>end_time="2025-02-18T11:00:14"
integer milliseconds since UNIX epoch. For example:
>>>end_time=1738396800000
Datetime Object:
>>>end_time=datetime.datetime.now()
level
Optional string, Can be one of:
OFF
SEVERE
WARNING
INFO
FINE
VERBOSE
DEBUG
Returns only records with a log level at or more severe thanthe level specified. Default:WARNING.
query_filter
Optional dict. Filtering is allowed by any combination ofcodes,users andsource components. The filter accepts adictionary whose keys can be a comma delimited list of filterdefinitions. If any definition is omitted, it defaults to all(“*”).
For example:
# Usage example: Filter for a specific user>>>query_filter={"users":["gis_admin","jcho_python"]}# Usage example: Filter for specific codes, code range, user# and source:>>>query_filter={"codes":["204000-205999",212015,219114],"users":["gis_admin"],"source":["PORTAL ADMIN"]}
Note
When filtering for a range ofcode values, the range mustbe entered as a string.
Thesource of logged events are generated from the sharing,administrative, and portal components of the software. Valid valuesare:
SHARING - Events related to publishing and users
PORTAL_ADMIN - Events related to security and indexing
PORTAL - Events related to installing the software
page_size
Optional integer. The number of log records to return. Thedefault is 1000.
federated_servers
Optional string. Specifies whether logs from federated serversshould be included in the result. To include logs from everyfederated server, set the value toall. To include logs froma specific federated, set the values as the server’s URL. Toexclude federated server logs from the query, leave the valueto the default,None.
Note
Introduced at ArcGIS Enterprise 11.4.
>>>federated_servers="https://example.server.com/wa_name"
- Returns:
Dictionary of metadata and messages.
# Usage Example: Querying for specific codes and users:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>portal_log_mgr=gis.admin.logs>>>log_report=portal_log_mgr.query(level="WARNING",start_time="2025-02-01T00:00:00",end_time="2025-02-22T00:00:00",query_filter={"codes":[200011,200014,"202020-202050"],"users":["gis_admin","gis_user"]})>>>log_report{'hasMore':False,'startTime':1740163821807,'endTime':1738217912458,'logMessages':[{'type':'WARNING','message':' Publish error for item '...}
- propertysettings
Get/Set the current log settings for the portal.
Parameter
Description
value
required dictionary, the dictionary of the log settings
USAGE:PrintouttheLogSettingsfromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")logs=gis.admin.logslogsettings=logs.settingsforkey,valueindict(logsettings).items():print("{} :{}".format(key,value))# OutputlogDir:C:\arcgisportal\logslogLevel:INFOmaxErrorReportsCount:10maxLogFileAge:90usageMeteringEnabled:False
- Returns:
Dictionary of key/value pairs of log settings
Machines
Security
- classarcgis.gis.admin.Security(url,gis=None,**kwargs)
This resource is an umbrella for a collection of system-wide resourcesfor your portal. This resource provides access to the ArcGIS WebAdaptor configuration, portal directories, database management server,indexing capabilities, license information, and the properties of yourportal.
- propertyconfig
This operation can be used to update the portal’s security settingssuch as whether or not enterprise accounts are automaticallyregistered as members of your ArcGIS organization the first timethey accesses the portal.The security configuration is stored as a collection of propertiesin a JSON object. The following properties are supported:
enableAutomaticAccountCreation
disableServicesDirectory
defaultRoleForUser (introduced at ArcGIS 10.4)
The automatic account creation flag (enableAutomaticAccountCreation)determines the behavior for unregistered enterprise accounts thefirst time they access the portal. When the value for this propertyis set to false, first time users are not automatically registeredas members of your ArcGIS organization, and have the same accessprivileges as other nonmembers. For these accounts to sign in, anadministrator must register the enterprise accounts using theCreate User operation.The default value for the enableAutomaticAccountCreation propertyis false. When this value is set to true, portal will addenterprise accounts automatically as members of your ArcGISorganization.The disableServicesDirectory property controls whether the HTMLpages of the services directory should be accessible to the users.The default value for this property is false, meaning the servicesdirectory HTML pages are accessible to everyone.Use the defaultRoleForUser property to set which role the portalautomatically assigns to new member accounts. By default, newaccounts are assigned to account_user. Other possible values areaccount_publisher or the ID of one of the custom roles defined inthe ArcGIS organization. To obtain the ID of a custom role,
Log in to the portal sharing directory.
Go to Portals > Self > Roles.
Copy the custom role ID you want to use.
The allowedProxyHosts property restricts what hosts the portal canaccess directly. This restriction applies to several scenarios,including when the portal accesses resources from a server thatdoes not support Cross Origin Resource Sharing (CORS) or whensaving credentials used to access a secure service. By default,this property is not defined and no restrictions are applied.Define the allowedProxyHosts with a comma-separated list ofhostnames to restrict the hosts the portal can access directly. Usethe format (.*).domain.com to allow access to all machines within aspecified domain.
- Example Value
- {
“disableServicesDirectory”:false,“enableAutomaticAccountCreation”:true,“defaultRoleForUser”: 12aBC3D4EF5ghIJ
}
- propertyenterpriseusers
provides access into managing enterprise users
- Returns:
EnterpriseUsers
object
- propertygroups
provides access to managing Enterprise Groups with Portal
- Returns:
EnterpriseGroups
object
- propertyoauth
The OAuth resource contains a set of operations that update theOAuth2-specific properties of registered applications in Portal forArcGIS.
- Returns:
OAuth
object
- propertytest_identity_store
This operation can be used to test the connection to a user orgroup store.
Parameter
Description
user_config
Optional dict. The user store configuration
group_config
Optional dict. The group store configuration
- Returns:
Dictionary indicating ‘success’ or ‘error’
- propertytokens
This resource represents the token configuration within yourportal. Use the set on token_config operation to change theconfiguration properties of the token service.
Parameter
Description
value
Required string. A shared key value
- Returns:
Dictionary
- update_identity_store(user_config:dict|None=None,group_config:dict|None=None)
You can use this operation to change the identity provider andgroup store configuration in your portal. When Portal for ArcGIS isfirst installed, it supports token-based authentication andbuilt-in groups using the built-in identity store for accounts. Toconfigure your portal to connect to your enterprise authenticationmechanism and group store, it must be configured to use anenterprise identity store such as Windows Active Directory or LDAP.
See:https://developers.arcgis.com/rest/enterprise-administration/portal/update-identity-store.htm
Parameter
Description
user_config
Optional dict. The user store configuration
group_config
Optional dict. The group store configuration
- Returns:
Dictionary indicating ‘success’ or ‘error’
OAuth
- classarcgis.gis.admin.OAuth(url,gis=None,**kwargs)
The OAuth resource contains a set of operations that update theOAuth2-specific properties of registered applications in Portal forArcGIS.
- propertyapp_info
Every application registered with Portal for ArcGIS has a uniqueclient ID and a list of redirect URIs that are used for OAuth. Thisoperation returns these OAuth-specific properties of anapplication. You can use this information to update the redirectURIs by using the Update App Info operation.
- update(current_id:str,new_id:str)
When new applications are registered with Portal for ArcGIS, a newclient ID is generated for the application. This allows theapplication to access content from the portal. The new client IDdoes not work if the application developer has programmed against aspecific ID. This operation can, therefore, be used to change theclient ID to another value as specified by the applicationdeveloper.
Parameter
Description
current_id
Required string. The current client ID of an existing application.
new_id
Required string. The new client ID to assign to the application.
- Returns:
Boolean. True if successful else False
SSLCertificate
- classarcgis.gis.admin.SSLCertificate(url,gis=None,**kwargs)
represents a single registered certificate
- delete()
This operation deletes an SSL certificate from the key store. Oncea certificate is deleted, it cannot be retrieved or used to enableSSL.
- export(out_path:str|None=None)
This operation downloads an SSL certificate. The file returned bythe server is an X.509 certificate. The downloaded certificate canbe imported into a client that is making HTTP requests.
Parameter
Description
out_path
Required string. Save location of the certificate
- Returns:
string
SSLCertificates
- classarcgis.gis.admin.SSLCertificates(url,gis=None,**kwargs)
Manages the Portal’s SSL Certificates
- generate(alias:str,common_name:str,organization:str,key_algorithm:str='RSA',validity:int=90,key_size:int=2048,signature_algorithm:str='SHA256withRSA',unit:str='',city:str='',state:str='',country_code:str='',alt_name:str='')
Use this operation to create a self-signed certificate or as astarting point for getting a production-ready CA-signedcertificate. The portal will generate a certificate for you andstore it in its keystore.
Parameter
Description
alias
Required string. The name of the certificate. This is a requiredparameter.
common_name
Required string. The common name used to identify the server forwhich the certificate is to be generated. This is a requiredparameter.
organization
Required string. The name of the organization. This is a requiredparameter.
key_algorithm
Optional string. The algorithm used to generate the key pairs. Thedefault is RSA.
validity
Optional integer. The expiration time for the certificate in days.The default is 90.
key_size
Optional integer. The size of the key. The default is 2048.
signature_algorithm
Optional string. The algorithm used to sign the self-signedcertificates. The default is derived from the key_algorithm parameter.
unit
Optional string. The department within which this server resides.
city
Optional string. The name of the city
state
Optional string. The name of the state
country_code
Optional string. The two letter abbrevation of the country
alt_name
Optional string. The common name used to identify the server forwhich the certificate is to be generated. This is a requiredparameter.
- Returns:
boolean
- get(alias_name:str)
gets a single SSLCertificate object by the alias name
Parameter
Description
alias_name
Required string. The common name of the certificate.
- Returns:
- class:
~arcgis.gis.admin.SSLCertificate object
USAGE:PrintoutinformationaboutaspecificSSLCertificatebyaliasnamefromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")# Get the SSL Certificate classsslmgr=gis.admin.security.ssl# Get a specific certificate alias and print informationssl=sslmgr.get('portal')forpropinssl.properties:print(prop,ssl.properties[prop])]))# OutputaliasNameportalissuerCN=YOURPORTAL.COM,OU=SelfSignedCertificatesubjectCN=YOURPORTAL.COM,OU=SelfSignedCertificatesubjectAlternativeNames[]validFromFriSep1507:46:45EDT2017validUntilSunJul2407:46:45EDT2050keyAlgorithmRSAkeySize2048serialNumber503b23c6version3signatureAlgorithmSHA256withRSAkeyUsage[]md5Fingerprint76d695d72e46b30ea90013676d559faasha1Fingerprint6f36513757c28ad43c2df5e4c7cee581ad18dd1esha256Fingerprinta051aab19d1ed8ceee7322572b3b1b2abd1ed680d0a1d81d0da84cf0e1a1b6cb
- import_certificate(certificate:str,alias:str,norestart:bool=False)
This operation imports a certificate authority’s (CA) root andintermediate certificates into the keystore.To create a production quality CA-signed certificate, you needto add the CA certificates into the keystore that enables theSSL mechanism to trust the CA (and the certificates it hassigned). While most of the popular CA certificates are alreadyavailable in the keystore, you can use this operation if youhave a custom CA or specific intermediate certificates.
Parameter
Description
certificate
Required string. The file location of the certificate file
alias
Required string. The name of the certificate
norestart
Optional boolean. Determines if the portal should be prevented fromrestarting after importing the certificate. By default this is falseand the portal will restart. Added in 10.6.
- Returns:
boolean
USAGE:ImportatrustedCAorIntermediateSSLCertificateintoPortalAdminAPIfromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")# Get the SSL Certificate classsslmgr=gis.admin.security.ssl# Load a trust CA certificate and restart Portalresp=sslmgr.import_certificate(r'c:\temp\myTrustedCA.crt','myroot',norestart=False)print(resp)# OutputTrue
- import_server_certificate(alias:str,password:str,certificate:str)
This operation imports an existing server certificate, storedin the PKCS #12 format, into the keystore. If the certificateis a CA signed certificate, you must first import the CA Rootor Intermediate certificate using the Import Root orIntermediate Certificate operation.
Parameter
Description
alias
Required string. The name of the certificate
password
Required string. The password for the certificate
certificate
Required string. The file location of the certificate file
- Returns:
Dictionary indicating ‘success’ or ‘error’
- list(force:bool=False)
List of SSL Certificates as represented in the Portal Admin API
Parameter
Description
force
Optional Boolean. If True, the certificate list will be refreshed,else, if a set of values is in memory, it will use those values.This is used when you want to ensure you have the most up to datelist of certificates.
- Returns:
List of :class: arcgis.gis.admin.SSLCertificate objects
USAGE:PrintoutinformationabouteachSSLCertificatefromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")# Get the SSL Certificate classsslmgr=gis.admin.security.ssl# Get a list of SSL Certificatessslcerts=sslmgr.list()# For each certificate, print its alias and issuerforsslcertinsslcerts:print("{} :{}".format(dict(sslcert)['aliasName'],dict(sslcert)['issuer']))# Outputportal:CN=YOURPORTAL.COM,OU=SelfSignedCertificateyourorgroot:CN=YourOrgEnterpriseRoot,DC=empty,DC=localsamlcert:CN=YOURPORTAL.COM,OU=SelfSignedCertificateca_signed:CN=YourOrgEnterpriseRoot,DC=empty,DC=local
- update(alias:str,protocols:str,cipher_suites:str,HSTS:bool=False)
Use this operation to configure the web server certificate, SSLprotocols, and cipher suites used by the portal.
Parameter
Description
alias
Required string. The name of the certificate. This is a requiredparameter. The certificate must be already present in the portal.
protocols
Required string. The SSL protocols the portal will use. Validoptions are TLSv1, TLSv1.1, and TLSv1.2; values must be commaseparated. By default, these options are all enabled.
cipher_suites
Required string. The cipher suites the portal will use. Validoptions are:
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
By default, all of the above options are enabled. Values must becomma separated.
HSTS
Optional Boolean. A Boolean value that indicates whether HTTP Strict Transport Security (HSTS) is being used by the portal.
- Returns:
Dictionary indicating ‘success’ or ‘error’
EnterpriseUsers
- classarcgis.gis.admin.EnterpriseUsers(url,gis=None,**kwargs)
The users resource is an umbrella for operations to manage memberswithin Portal for ArcGIS. The resource returns the total number ofmembers in the system.
- create(username:str,password:str,first_name:str,last_name:str,email:str,role:str='org_user',level:int=2,provider:str='arcgis',idp_username:str|None=None,description:str|None=None,user_license:str|None=None)
This operation is used to pre-create built-in or enterpriseaccounts within the portal. The provider parameter is used toindicate the type of user account.
Parameter
Description
username
Required string. The name of the user account
password
Required string. The password of the user account
first_name
Required string. The first name for the account
last_name
Required string. The last name for the account
email
Required string. The email for the account
role
Optional string. The role for the user account. The default value isorg_user.Values org_admin | org_publisher | org_user | org_editor (Data Editor) | viewer
level
Optional integer. The account level to assign the user.Values 1 or 2
provider
Optional string. The provider for the account. The default value isarcgis. Values arcgis | enterprise
idp_username
Optional string. The name of the user as stored by the enterpriseuser store. This parameter is only required if the providerparameter is enterprise.
description
Optional string. A user description
user_license
Optional string. The user type for the account. (10.7+)
- Values before Enterprise 11.4: creator, editor, advanced (GIS Advanced),
basic (GIS Basic), standard (GIS Standard), viewer,fieldworker
- Values for Enterprise 11.4+: creator, contributor, fieldworker, viewer,
professionalplus, professional
- Returns:
boolean
- get(username:str)
This operation returns the description, full name, and emailaddress for a single user in the enterprise identity (user) storeconfigured with the portal. The username parameter is used tospecify the enterprise username. If the user does not exist, anerror is returned.
Parameter
Description
username
Required string. Username of the enterprise account. For WindowsActive Directory users, this can be either domainusername or justusername. For LDAP users, the format is always username.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- refresh_users(users:str)
This operation iterates over every enterprise group configured inthe portal and determines if the input user accounts belong to anyof the configured enterprise groups. If there is any change inmembership, the database and the indexes are updated for each useraccount. While portal automatically refreshes the membershipsduring a user login and during a periodic refresh (configuredthrough the Update Identity Store operation), this operation allowsan administrator to force a refresh.
Parameter
Description
users
Required string. A comma seperated list of users.
- Returns:
Dictionary indicating ‘success’ or ‘error’
- search(query:str='',max_count:int=255)
This operation searches users in the configured enterprise userstore. You can narrow down the search using the filter parameter.
Parameter
Description
query
Optional string. Where clause into parse down results
max_count
Optional integer. The maximum number of records to return
- Returns:
Dictionary of the search
- update(username:str,idp_username:str)
This operation allows an administrator to update the idp_usernamefor an enterprise user in the portal. This is used when migratingfrom accounts used with web-tier authentication to SAMLauthentication.
Parameter
Description
username
Required string. Username of the enterprise account. For WindowsActive Directory users, this can be either domainusername or justusername. For LDAP users, the format is always username.
idp_username
Required string. The username used by the SAML identity provider
- Returns:
Dictionary indicating ‘success’ or ‘error’
EnterpriseGroups
- classarcgis.gis.admin.EnterpriseGroups(url,gis=None,**kwargs)
The groups resource is an umbrella for operations to manageenterprise groups within the portal. The resource returns the totalnumber of groups in the system.
- get_group_users(name:str,query:str='',max_count:int=255)
This operation returns the users that are currently assigned to theenterprise group within the enterprise user/group store. You canuse the filter parameter to narrow down the user search.
Parameter
Description
name
Optional string. The name of the enterprise group
query
Optional string. Where clause into parse down results
max_count
Optional integer. The maximum number of records to return
- Returns:
Dictionary of group users
- get_user_groups(username:str,query:str='',max_count:int=255)
This operation lists the groups assigned to a user account in theconfigured enterprise group store.
Parameter
Description
username
Optional string. The name of the user account
query
Optional string. Where clause into parse down results
max_count
Optional integer. The maximum number of records to return
- Returns:
Dictionary of user groups
- refresh_groups(groups:str)
This operation iterates over every enterprise account configured inthe portal and determines if the user account is a part of theinput enterprise group. If there are any change in memberships, thedatabase and the indexes are updated for each group.While portal automatically refreshes the memberships during a userlogin and during a periodic refresh configured through the UpdateIdentity Store operation, this operation allows an administrator toforce a refresh.
Parameter
Description
groups
Required string. The comma seperated list of group names to berefreshed
- Returns:
Dictionary indicating ‘success’ or ‘error’
- search(query:str='',max_count:int=255)
This operation searches groups in the configured enterprise groupstore. You can narrow down the search using the filter parameter.
Parameter
Description
query
Optional string. Where clause into parse down results
max_count
Optional integer. The maximum number of records to return
- Returns:
Dictionary indicating ‘success’ or ‘error’
Site
- classarcgis.gis.admin.Site(url,portaladmin,**kwargs)
Bases:
BasePortalAdmin
Site is the root resources used after a local GIS is installed. Hereadministrators can create, export, import, and join sites.
- staticcreate(con,url:str,username:str,password:str,full_name:str,email:str,content_store:str,description:str='',question_idx:int|None=None,question_ans:str|None=None,license_file:str|None=None,user_license:str|None=None)
The create site operation initializes and configures Portal forArcGIS for use. It must be the first operation invoked afterinstallation. Creating a new site involves:
Creating the initial administrator account
Creating a new database administrator account (which is same asthe initial administrator account)
Creating token shared keys
Registering directories
This operation is time consuming, as the database is initializedand populated with default templates and content. If the databasedirectory is not empty, this operation attempts to migrate thedatabase to the current version while keeping its data intact. Atthe end of this operation, the web server that hosts the API isrestarted.
Parameter
Description
con
Required Connection. The connection object.
url
Required string. The portal administration urlEx:https://mysite.com/<web adaptor>/portaladmin
username
Required string. The initial admin account name
password
Required string. The password for initial admin account
full_name
Required string. The full name of the admin account
email
Required string. The account email address
content_store
Required string. JSON string including the path to the location ofthe site’s content.
description
Optional string. The optional description for the account
question_idx
Optional integer. The index of the secret question to retrieve aforgotten password
question_ans
Optional string. The answer to the secret question
license_file
Optional string. The portal license file. Starting at 10.7, you willobtain your portal license file - which contains informationregarding your user types, apps, and app bundles-from My Esri. Formore information, see Obtain a portal license file.
user_license
The user type for the initial administrator account. The valueslisted below are the user types that are compatible with theAdministrator role.
- Values: creatorUT, GISProfessionalBasicUT,
GISProfessionalStdUT, GISProfessionalAdvUT
- Returns:
Dictionary indicating ‘success’ or ‘error’
- export_site(location:str)
This operation exports the portal site configuration to a locationyou specify. The exported file includes the following information:
- Content directory - the content directory contains the data
associated with every item in the portal
- Database dump file - a plain-text file that contains the SQL
commands required to reconstruct the portal database
- Configuration store connection file - a JSON file that contains
the database connection information
Parameter
Description
location
Required string. The path to the folder accessible to the portalwhere the exported site configuration will be written.
- Returns:
Dictionary indicating ‘success’ or ‘error’
USAGE:ExportPortalSitetoalocationthePortalserverhasaccessto.**Thiscanbealengthyoperation.fromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")sitemgr=gis.admin.siteresponse=sitemgr.export_site(r'c:\temp')print(response)# Output{'status':'success','location':'C:\Temp\June-9-2018-5-22-29-PM-EDT-FULL.portalsite'}
- import_site(location:str)
The importSite operation lets you restore your site from a backupsite configuration file that you created using the exportSiteoperation. It imports the site configuration file into thecurrently running portal site.The importSite operation will replace all site configurations withinformation included in the backup site configuration file. See theexport_site operation documentation for details on what the backupfile includes. The importSite operation also updates the portalcontent index.
Parameter
Description
location
Required string. A file path to an exported configuration.
- Returns:
Boolean. True if successful else False.
- join(admin_url:str,username:str,password:str)
The joinSite operation connects a portal machine to an existingsite. You must provide an account with administrative privileges tothe site for the operation to be successful.When an attempt is made to join a site, the site validates theadministrative credentials, then returns connection informationabout its configuration store back to the portal machine. The portalmachine then uses the connection information to work with theconfiguration store.If this is the first portal machine in your site, use the CreateSite operation instead.The join operation:
Registers a machine to an existing site (active machine)
Creates a snapshot of the database of the active machine
Updates the token shared key
Updates Web Adaptor configurations
Sets up replication to keep the database of both machines in syncThe operation is time-consuming as the database is configured onthe machine and all configurations are applied from the activemachine. After the operation is complete, the web server that hoststhe API will be restarted.
Parameter
Description
admin_url
Required string. The admin URL of the existing portal site to whicha machine will be joined
username
Required string. The username for the initial administrator accountof the existing portal site.
password
Required string. The password for the initial administrator accountof the existing portal site.
- Returns:
Dictionary indicating ‘success’ or ‘error’
System
- classarcgis.gis.admin.System(url,gis=None,**kwargs)
This resource is an umbrella for a collection of system-wide resourcesfor your portal. This resource provides access to the ArcGIS WebAdaptor configuration, portal directories, database management server,indexing capabilities, license information, and the properties of yourportal.
- propertycontent_discovery
This resource allows an administrator to enable or disable external content discovery from the portal website.Because some Esri-provided content requires external access to the internet, an administrator may choose to disable the content to prevent requests to ArcGIS Online resources. When disabling the content, a select group of items will be disabled:
All basemaps owned by “esri_[lang]”
All content owned by “esri_nav”
All content owned by “esri”
This resource will not disable ArcGIS Online utility services or Living Atlas content. For steps to disable these items, refer to the Portal Administrator guide.
When external content is disabled, System Languages are also disabled.
Parameter
Description
value
required Boolean. If true, external content is enabled, else it isdisabled.
- Returns:
boolean
- propertydatabase
The database resource represents the database management system(DBMS) that contains all of the portal’s configuration andrelationship rules. This resource also returns the name and versionof the database server currently running in the portal.You can use the properety to update database accounts
- propertydirectories
The directories resource is a collection of directories that areused by the portal to store and manage content. Beginning at10.2.1, Portal for ArcGIS supports five types of directories:
Content directory-The content directory contains the dataassociated with every item in the portal.
Database directory-The built-in security store and sharingrules are stored in a Database server that places files in thedatabase directory.
Temporary directory - The temporary directory is used as ascratch workspace for all the portal’s runtime components.
Index directory-The index directory contains all the indexesassociated with the content in the portal. The indexes are usedfor quick retrieval of information and for querying purposes.
Logs directory-Errors and warnings are written to text files inthe log file directory. Each day, if new errors or warnings areencountered, a new log file is created.
If you would like to change the path for a directory, you can usethe Edit Directory operation.
- propertyincremental_backup
Gets/Sets the Incremental Backup for the Enterprise Configuration
- Returns:
dict
- propertyindex_status
The status resource allows you to view the status of the indexingservice. You can view the number of users, groups, and search itemsin both the database (store) and the index.If the database and index do not match, indexing is either inprogress or there is a problem with the index. It is recommendedthat you reindex to correct any issues. If indexing is in progress,you can monitor the status by refreshing the page.
- Returns:
dict
USAGE:PrintsoutcurrentIndexStatusfromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")sysmgr=gis.admin.systemidx_status=sysmgr.index_statusimportjsonprint(json.dumps(idx_status,indent=2))# Output{"indexes":[{"name":"users","databaseCount":51,"indexCount":51},{"name":"groups","databaseCount":325,"indexCount":325},{"name":"search","databaseCount":8761,"indexCount":8761}]}
- propertylanguages
This resource gets/sets which languages will appear in portalcontent search results. Use the Update languages operation tomodify which language’content will be available.
- propertylicenses
Portal for ArcGIS requires a valid license to function correctly.This resource returns the current status of the license.Starting at 10.2.1, Portal for ArcGIS enforces the license bychecking the number of registered members and comparing it with themaximum number of members authorized by the license. Contact EsriCustomer Service if you have questions about license levels orexpiration properties.
- propertylimits:dict[str,Any]
Thelimits resource provides limits associated with theorganization, such as user and organizational limits or scheduledtasks. SeeArcGIS Enterprise Portal limitsfor detailed description of each limit.
- Returns:
dict[str,Any]A Python dictionary with aScheduledTask key whose value is a listof dictionaries with specific limit names and their values.
# Usage example:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>ent_system=gis.admin.system>>>ent_system.limits{'ScheduleTask':[{'limitName':'UpdateInsightsUserLimit','numLimit':20},{'limitName':'UpdateInsightsOrgLimit','numLimit':50},...{'limitName':'TaskRunHistoryCount','numLimit':30}]}
- propertyproperties
Gets/Sets the system properties that have been modified to controlthe portal’s environment.
- The list of available properties are:
privatePortalURL-Informs the portal that it has a front endload-balancer/proxy reachable at the URL. This property istypically used to set up a highly available portal configuration
portalLocalhostName-Informs the portal back-end to advertise thevalue of this property as the local portal machine. This istypically used during federation and when the portal machine hasone or more public host names.
httpProxyHost-Specifies the HTTP hostname of the proxy server
httpProxyPort-Specifies the HTTP port number of the proxy server
httpProxyUser-Specifies the HTTP proxy server username.
httpProxyPassword-Specifies the HTTP proxy server password.
isHttpProxyPasswordEncrypted-Set this property to false when youare configuring the HTTP proxy server password in plain text.After configuration, the password will be encrypted and thisproperty will be set to true
httpsProxyHost-Specifies the HTTPS hostname of the proxy server
httpsProxyPort-Specifies the HTTPS port number of the proxyserver
httpsProxyUser-Specifies the HTTPS proxy server username
httpsProxyPassword-Specifies the HTTPS proxy server password
isHttpsProxyPasswordEncrypted-Set this property to false whenyou are configuring the HTTPS proxy server password in plaintext. After configuration, the password will be encrypted andthis property will be set to true.
nonProxyHosts-If you want to federate ArcGIS Server and the sitedoes not require use of the forward proxy, list the servermachine or site in the nonProxyHosts property. Machine anddomain items are separated using a pipe (|).
WebContextURL-If you are using a reverse proxy, set thisproperty to reverse proxy URL.
ldapCertificateValidation Introduced at 10.7. When set to true,any encrypted LDAP communication (LDAPS) made from the portal tothe user or group identity store will enforce certificatevalidation. The default value is false.
- reindex(mode:str='FULL',includes:str|None=None)
This operation allows you to generate or update the indexes forcontent; such as users, groups, and items stored in the database(store). During the process of upgrading an earlier version ofPortal for ArcGIS, you are required to update the indexes byrunning this operation. You can check the status of your indexesusing the status resource.
Parameter
Description
mode
Optional string. The mode in which the indexer should run.Values USER_MODE | GROUP_MODE | SEARCH_MODE | FULL
includes
Optional string. An optional comma separated list of elements toinclude in the index. This is useful if you want to only indexcertain items or user accounts.
- Returns:
Boolean. True if successful else False.
- set_limits(properties:list[dict],*,category:str='ScheduleTask')→dict
Theset_limit() method updates one or more organizational limits in aspecific category. Only limits that are included in this requestwill be updated.
Parameter
Description
properties
A Python list of one or more dictionaries withlimitName andnumLimit keys whose values are the specific limit category and thespecific value to update.SeePortal limitsfor comprehensive list of limit options to set.
category
Optional String. Category limits to be updated.
Note
As of the Enterprise 11.2 release,ScheduleTask is the onlycategory implemented.
- Returns:
Python dictionary with astatus key indicating success or failure of the operation.
# Usage Example>>>gis=GIS(profile="your_enterprise_admin_profile")>>>ent_system=gis.admin.system>>>ent_system.set_limits(properties=[{"limitName":"TaskRunHistoryCount","numLimit":45}],category="ScheduleTask"){'status':'success'}
- propertyweb_adaptors
The Web Adaptors resource lists the ArcGIS Web Adaptor configuredwith your portal. You can configure the Web Adaptor by using itsconfiguration web page or the command line utility provided withthe installation.
- Returns:
WebAdaptors
object
Licenses (Deprecated 10.7+)
- classarcgis.gis.admin.Licenses(url,gis=None,**kwargs)
Portal for ArcGIS requires a valid license to function correctly. Thisresource returns the current status of the license.As of 10.2.1, Portal for ArcGIS enforces the license by checking thenumber of registered members and comparing it with the maximum numberof members authorized by the license. Contact Esri Customer Service ifyou have questions about license levels or expiration properties.Starting at 10.5, Portal for ArcGIS enforces two levels of membershipfor licensing to define sets of privileges for registered members andtheir assigned roles.
Deprecated at ArcGIS Enterprise 10.7
- entitlements(app:str='arcgisprodesktop')
This operation returns the currently queued entitlements for aproduct, such as ArcGIS Pro or Navigator for ArcGIS, and appliesthem when their start dates become effective. It’s possible thatall entitlements imported using the Import Entitlements operationare effective immediately and no entitlements are added to thequeue. In this case, the operation returns an empty result.
Parameter
Description
app
Required string. The application lookup.Allowed values: appstudioweb,arcgisprodesktop,busanalystonline_2,drone2map,geoplanner,arcgisInsights,LRReporter,navigator, or RoadwayReporter
- Returns:
dict
- import_entitlements(file:str,application:str)
This operation allows you to import entitlements for ArcGIS Pro andadditional products such as Navigator for ArcGIS into yourlicensing portal. Once the entitlements have been imported, you canassign licenses to users within your portal. The operation requiresan entitlements file that has been exported out of your ArcGISLicense Server Administrator or out of My Esri, depending on theproduct.A typical entitlements file will have multiple parts, eachrepresenting a set of entitlements that are effective at a specificdate. The parts that are effective immediately will be configuredto be the current entitlements. Other parts will be added to aqueue. The portal framework will automatically apply the parts whenthey become effective. You can use the Get Entitlements operationto see the parts that are in the queue.Each time this operation is invoked, it overwrites all existingentitlements, even the ones that are in the queue.
Parameter
Description
file
Required string. The entitlement file to load into Enterprise.
application
Required string. The application identifier to be imported
- Returns:
Dictionary indicating ‘success’ or ‘error’
- release_license(username:str)
If a user checks out an ArcGIS Pro license for offline ordisconnected use, this operation releases the license for thespecified account. A license can only be used with a single devicerunning ArcGIS Pro. To check in the license, a valid access tokenand refresh token is required. If the refresh token for the deviceis lost, damaged, corrupted, or formatted, the user will not beable to check in the license. This prevents the user from loggingin to ArcGIS Pro from any other device. As an administrator, youcan release the license. This frees the outstanding license andallows the user to check out a new license or use ArcGIS Pro in aconnected environment.
- remove_all(application:str)
This operation removes all entitlements from the portal for ArcGISPro or additional products such as Navigator for ArcGIS and revokesall entitlements assigned to users for the specified product. Theportal is no longer a licensing portal for that product.License assignments are retained on disk. Therefore, if you decideto configure this portal as a licensing portal for the productagain in the future, all licensing assignments will be available inthe website.
- remove_entitlement(app:str='arcgisprodesktop')
deletes an entitlement from a site
Parameter
Description
app
Required string. The application lookup.Allowed values: appstudioweb,arcgisprodesktop,busanalystonline_2,drone2map,geoplanner,arcgisInsights,LRReporter,navigator, or RoadwayReporter
- Returns:
dict
- update_license_manager(info:str)
ArcGIS License Server Administrator works with your portal andenforces licenses for ArcGIS Pro. This operation allows you tochange the license server connection information for your portal.When you import entitlements into portal using the ImportEntitlements operation, a license server is automaticallyconfigured for you. If your license server changes after theentitlements have been imported, you only need to change thelicense server connection information.You can register a backup license manager for high availability ofyour licensing portal. When configuring a backup license manager,you need to make sure that the backup license manager has beenauthorized with the same organizational entitlements. Afterconfiguring the backup license manager, Portal for ArcGIS isrestarted automatically. When the restart completes, the portal isconfigured with the backup license server you specified.
Parameter
Description
info
Required string. The JSON representation of the license serverconnection information.
- Returns:
Dictionary indicating ‘success’ or ‘error’
PortalLicense
- classarcgis.gis.admin.PortalLicense(url,gis=None,**kwargs)
The Enterprise portal requires a valid license to function correctly.This resource returns information for user types that are licensedfor your organization.
Starting at 10.7, the Enterprise portal enforces user type licensing.Members are assigned a user type which determines the privileges thatan be granted to the member through a role. Each user type mayinclude access to specific apps and app bundles.
The license information returned for the organization includes thetotal number of registered members that can be added, the currentnumber of members in the organization and the Portal for ArcGISversion. For each user type, the license information includes the ID,the maximum number of registered members that can be assigned, thenumber of members currently assigned the license and the expiration,in epoch time. In addition, this resource provides access to theValidate License, Import License, Populate License, Update LicenseManager, and Release License operations.
- import_license(file:str)
Theimport_license operation is used to import a new licensefile. The portal license file contains your Enterprise portal’suser type, app and app bundle licenses. By importing a portallicense file, you will be applying the licenses in the file to yourorganization.
Caution:
Importing a new portal license file will overwrite yourorganization’s current user type, app, and app bundle licenses.Before importing, verify that the new license file hassufficient user type, app, and app bundle licenses.
Parameter
Description
file
Required String. The portal license file.
- Returns:
Boolean. True if successful else False.
- populate()
Thepopulate operation applies the license information from thelicense file that is used to create or upgrade your portal. Thisoperation is only necessary as you create or upgrade your portalthrough the Portal Admin API.
- Returns:
Boolean. True if successful else False.
- release_license(username:str)
If a user checks out an ArcGIS Pro license for offline ordisconnected use, this operation releases the license for thespecified account. A license can only be used with a single devicerunning ArcGIS Pro. To check in the license, a valid access tokenand refresh token is required. If the refresh token for the deviceis lost, damaged, corrupted, or formatted, the user will not beable to check in the license. This prevents the user from loggingin to ArcGIS Pro from any other device. As an administrator, youcan release the license. This frees the outstanding license andallows the user to check out a new license or use ArcGIS Pro in aconnected environment.
Parameter
Description
username
Required String. The user name of the account.
- Returns:
Boolean. True if successful else False.
- update(info:dict)
ArcGIS License Server Administrator works with your portal andenforces licenses for ArcGIS Pro. This operation allows you tochange the license server connection information for your portal.
You can register a backup license manager for high availability ofyour licensing portal. After configuring the backup licensemanager, Portal for ArcGIS is restarted automatically. When therestart completes, the portal is configured with the backup licenseserver you specified. When configuring a backup license manager,you will need to ensure that the backup is authorized using thesame license file as your portal.
- Note:
Previously, premium apps were licensed individually through theportal. Starting at 10.7, there will no longer be separatelicensing for apps; the portal’s user types, apps, and appbundles will be licensed using a single portal license file.Licensing ArcGIS Pro and Drone2Map requires licensing yourEnterprise portal’s ArcGIS License Server Administrator(license manager). Previously, users were required to import a.lic file into the portal’s license manager. They would thengenerate a .json file through the license manager and importthe file into portal. Now, users licensing ArcGIS Pro andDrone2Map import the same license file used to license theirportal into their license manager. Users are no longer requiredto generate an additional license file in the license manager.
Parameter
Description
info
Required Dict. The JSON representation of the license serverconnection information.
- Returns:
Boolean. True if successful else False.
# Example Usage>>>gis.admin.system.licenses.update(info={"hostname":"licensemanager.domain.com,backuplicensemanager.domain.com","port":27000})True
- validate(file:str,list_ut:bool=False)
Thevalidate operation is used to validate an input license file.Only valid license files can be imported into the Enterpriseportal. If the provided file is valid, the operation will returnuser type, app bundle, and app information from the license file.If the file is invalid, the operation will fail and return an errormessage.
Parameter
Description
file
Required String. The portal license file.
list_ut
Optional Boolean. Returns a list of user types that are compatiblewith the Administrator role. This identifies the user type(s) thatcan be assigned to the Initial Administrator Account when creatinga portal.
- Returns:
Dictionary indicating ‘success’ or ‘error’
Directory
- classarcgis.gis.admin.Directory(url,gis=None,**kwargs)
A directory is a file system-based folder that contains a specific typeof content for the portal. The physicalPath property of a directorylocates the actual path of the folder on the file system. Beginning at10.2.1, Portal for ArcGIS supports local directories and network sharesas valid locations.During the Portal for ArcGIS installation, the setup program asks youfor the root portal directory (that will contain all the portal’s subdirectories). However, you can change each registered directory throughthis API.
- propertyproperties
The properties operation on a directory can be used to change thephysical path and description properties of the directory. This isuseful when changing the location of a directory from a local pathto a network share. However, the API does not copy your content anddata from the old path to the new path. This has to be doneindependently by the system administrator.
WebAdaptor
- classarcgis.gis.admin.WebAdaptor(url,gis=None,**kwargs)
The ArcGIS Web Adaptor is a web application that runs in a front-endweb server. One of the Web Adaptor’s primary responsibilities is toforward HTTP requests from end users to Portal for ArcGIS. The WebAdaptor acts a reverse proxy, providing the end users with an entrypoint to the system, hiding the back-end servers, and providing somedegree of immunity from back-end failures.The front-end web server can authenticate incoming requests againstyour enterprise identity stores and provide specific authenticationschemes such as Integrated Windows Authentication (IWA), HTTP Basic, orDigest.Most importantly, a Web Adaptor provides your end users with a welldefined entry point to your system without exposing the internaldetails of your portal. Portal for ArcGIS will trust requests beingforwarded by the Web Adaptor and will not challenge the user for anycredentials. However, the authorization of the request (by looking uproles and permissions) is still enforced by the portal’s sharing rules.
- unregister()
You can use this operation to unregister the ArcGIS Web Adaptorfrom your portal. Once a Web Adaptor has been unregistered, yourportal will no longer trust the Web Adaptor and will not accept anycredentials from it. This operation is typically used when you wantto register a new Web Adaptor or when your old Web Adaptor needs tobe updated.
WebAdaptors
- classarcgis.gis.admin.WebAdaptors(url,gis=None,**kwargs)
The Web Adaptors resource lists the ArcGIS Web Adaptor configured withyour portal. You can configure the Web Adaptor by using itsconfiguration web page or the command line utility provided with theinstallation.
- propertyconfiguration
Gets/Sets the common properties and configuration of the ArcGIS WebAdaptor configured with the portal.
Parameter
Description
shared_key
Required string. This property represents credentials that are sharedwith the Web Adaptor. The Web Adaptor uses these credentials tocommunicate with the portal
- list()
Returns all instances of WebAdaptors
USAGE:GetallWebAdaptorsandlistkeys,valuesoffirstWebAdaptorobjectfromarcgis.gisimportGISgis=GIS("https://yourportal.com/portal","portaladmin","password")# Return a List of Web Adaptor objectswebadaptors=gis.admin.system.web_adaptors.list()# Get the first Web Adaptor object and print out each of its valuesforkey,valueindict(webadaptors[0]).items():print("{} :{}".format(key,value))# OutputmachineName:yourportal.commachineIP:10.11.12.13webAdaptorURL:https://yourwebserver.com/portalid:ac17d7b9-adbd-4c45-ae13-77b0ad6f14e8description:httpPort:80httpsPort:443refreshServerListInterval:1reconnectServerOnFailureInterval:1
- Returns:
List of
WebAdaptor
objects. Typically, only 1 Web Adaptor will exist for a Portal
WebhookManager
- classarcgis.gis.admin.WebhookManager(url,gis)
Creates and manages ArcGIS Enterprise webhooks. Webhooks allow you to beautomatically notified when events associated with items, groups, andusers occur. Once a webhook has been triggered, an HTTP request ismade to a user-defined URL to provide information regarding the event.
- create(name:str,url:str,events:list|str='ALL',number_of_failures:int=5,days_in_past:int=5,secret:str|None=None,properties:dict|None=None)
Creates a WebHook to monitor REST endpoints and report activities
Parameter
Description
name
Required String. The name of the webhook.
url
Required String. This is the URL to which the webhook will deliver payloads to.
events
Otional List or String. The events accepts a list or all events can bemonitored. This is done by passing “ALL” in as the events. If a list isprovided, a specific endpoint can be monitored.
Item Trigger Events
Trigger event
URI example
All trigger events for all items
/items
Add item to the portal
/items/add
All trigger events for a specific item
/items/<itemID>
Delete a specific item
/items/<itemID>/delete
Update a specific item’s properties
/items/<itemID>/update
Move an item or changing ownership of the item
/items/<itemID>/move
Publish a specific item
/items/<itemID>/publish
Share a specific item
/items/<itemID>/share
Unshare a specific item
/items/<itemID>/unshare
Group Trigger Events
Trigger event
URI example
All trigger events for all groups
/groups
Add group
/groups/add
All trigger events for a specific group
/groups/<groupID>
Update a specific group
/groups/<groupID>/update
Delete a specific group
/groups/<groupID>/delete
Enable Delete Protection for a specific group
/groups/<groupID>/protect
Disable Delete Protection for a specific group
/groups/<groupID>/unprotect
Invite a user to a specific group
/groups/<groupID>/invite
Add a user to a specific group
/groups/<groupID>/addUsers
Remove a user from a specific group
/groups/<groupID>/removeUsers
Update a user’s role in a specific group
/groups/<groupID>/updateUsers
User Trigger Events
Trigger event
URI example
All trigger events for all users in the portal
/users
All trigger events associated with a specific user
/users/<username>
Delete a specific user
/users/<username>/delete
Update a specific user’s profile
/users/<username>/update
Disable a specific user’s account
/users/<username>/disable
Enable a specific user’s account
/users/<username>/enable
Example Syntax: [‘/users’, ‘/groups/abcd1234….’]
number_of_failures
Optional Integer. The number of failures to allow before the service
days_in_past
Option Integer. The number of days to report back on.
secret
Optional String. Add a Secret to your payload that can be used to authenticatethe message on your receiver.
properties
Optional Dict. At 10.9.1+ users can provide additional configuration properties.
:returns a
WebHook
instance# Example using Zapier as the payload URLfromarcgis.gisimportGISgis=GIS(profile="your_profile",verify_cert=False)wh_mgr=gis.admin.webhookswh=wh_mgr.create(name="Webhook_from_API",url="https://hooks.zapier.com/hooks/catch/6694048/odqj9o3/",events=["/items/981e98b949d9432ebf26433f40948cec/move","/items/981e98b949d9432ebf26433f40948cec/update"]
SeeWebhook Blog Post for a detailed explanation.
- propertysettings
There are several advanced parameters that can be used to configurethe connection behavior of your webhook. These parameters will beapplied to all of the configured webhooks in your Portal. Use theUpdate operation to modify any of the parameters.
** Dictionary Key/Values **
Parameter
Description
notificationAttempts
Required Integer. This will determine how many attempts will be made to delivera payload.
otificationTimeOutInSeconds
Required Integer. The length of time (in seconds) that Portal will wait toreceive a response. The max response is 60.
notificationElapsedTimeInSeconds
Required Integer. The amount of time between each payload delivery attempt. Bydefault, this is set to 30 seconds and can be set to a maximum of 100 secondsand a minimum of one second.
returns: dict
Webhook
- classarcgis.gis.admin.Webhook(url,gis)
a single webhook
- activate()
Restarts a deactivated webhook. When activated, payloadswill be delivered to the payload URL when the webhook is invoked.
- deactivate()
Temporarily pause the webhook. This will stop the webhook fromdelivering payloads when it is invoked. The webhook will beautomatically deactivated when the deactivation policy is met.
- Returns:
boolean
- propertynotifications
Thenotifications` will display information pertaining totrigger events associated with the specific webhook. You can usethis table to monitor your webhook and the details of any deliveredpayloads such as the time the webhook was triggered, the responsereceived from the payload URL, and the delivered payload data.
- Returns:
List
- update(name:str|None=None,url:str|None=None,events:str|list|None=None,number_of_failures:int|None=None,days_in_past:int|None=None,secret:str|None=None,properties:dict|None=None)
The Update Webhook operation allows administrators to update any ofthe parameters of their webhook.
Parameter
Description
name
Required String. The name of the webhook.
url
Required String. This is the URL to which the webhook will deliver payloads to.
events
Otional List or String. The events accepts a list of all events that can bemonitored. This is done by passing “ALL” in as the events. If a list isprovided, a specific endpoint can be monitored.
Item Trigger Events
Trigger event
URI example
All trigger events for all items
/items
Add item to the portal
/items/add
All trigger events for a specific item
/items/<itemID>
Delete a specific item
/items/<itemID>/delete
Update a specific item’s properties
/items/<itemID>/update
Move an item or changing ownership of the item
/items/<itemID>/move
Publish a specific item
/items/<itemID>/publish
Share a specific item
/items/<itemID>/share
Unshare a specific item
/items/<itemID>/unshare
Group Trigger Events
Trigger event
URI example
All trigger events for all groups
/groups
Add group
/groups/add
All trigger events for a specific group
/groups/<groupID>
Update a specific group
/groups/<groupID>/update
Delete a specific group
/groups/<groupID>/delete
Enable Delete Protection for a specific group
/groups/<groupID>/protect
Disable Delete Protection for a specific group
/groups/<groupID>/unprotect
Invite a user to a specific group
/groups/<groupID>/invite
Add a user to a specific group
/groups/<groupID>/addUsers
Remove a user from a specific group
/groups/<groupID>/removeUsers
Update a user’s role in a specific group
/groups/<groupID>/updateUsers
User Trigger Events
Trigger event
URI example
All trigger events for all users in the portal
/users
All trigger events associated with a specific user
/users/<username>
Delete a specific user
/users/<username>/delete
Update a specific user’s profile
/users/<username>/update
Disable a specific user’s account
/users/<username>/disable
Enable a specific user’s account
/users/<username>/enable
#Example Usage:>>>events=['/users','/groups/abcd1234....']
number_of_failures
Optional Integer. The number of failures to allow before the webhook isdeactivated.
days_in_past
Option Integer. The number of days to report back on.
secret
Optional String. Add a secret to your payload that can be used to authenticatethe message on your receiver.
:returns Boolean
SocialProviders
- classarcgis.gis.admin.SocialProviders(gis)
Enables/Disables the Social Providers Settings for a GIS
Parameter
Description
value
Required GIS. This is an administrator connection to a GIS site.
- Returns:
SocialProviders
object
- propertyconfiguration
Gets/Sets for the Social Providers on the GIS
Parameter
Description
value
Optional dict or None. If the value is None, the social providerconfiguration is deleted. If the value is a dictionary, a socialprovider is setup on the site or updated.
Key:Value Dictionary Options for value Argument
Key
Value
signUpMode
optional string. Invitation or Automatic.
providers
required string. This is a list of strings seperated by a comma. Theallowed values are: facebook and google
role
optional string. This is the default role setup when users login toa GIS.
level
optional integer. This is the default level set when a socialprovider user logins.
userCreditAssignment
optional integer. The default is -1, which means infinite creditusage. The
groups
optional string. A comma seperated list of group ids to assign newusers to when they login to using a social provider.
user_type
optional string. A default user license type.
MetadataManager
- classarcgis.gis.admin.MetadataManager(gis)
Provides Administrators an Easy value to enable, update and disablemetadata settings on a Web GIS Site (Enterprise or ArcGIS Online)
- enable(metadata_format:str='arcgis')
This operation turns on metadata for items and allows theadministrator to set the default metadata scheme.
Parameter
Description
metadata_format
Required string. Sets the default metadata format. The allowedvalues are: inspire,iso19139-3.2,fgdc,iso19139,arcgis, or iso19115
- Returns:
boolean