Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

ArcGIS API for PythonAPI Reference

arcgis.gis.server module

A collection of classes for administering ArcGIS Server sites.

Server

classarcgis.gis.server.Server(url:str,gis:GIS=None,**kwargs)

Bases:BaseServer

An ArcGIS Server site used for hosting GIS web services.

This class can be directly instantied when working with stand-alone (unfederated) ArcGIS Server sites.

This class is not directly created when working with federated ArcGIS Server sites, instead use theServerManagerlist() orget() methods.

# Usage Example 1: Get an object for an ArcGIS Server site federated with an ArcGIS Enterprise portalgis=GIS(profile="your_ent_admin_profile")hosting_server=gis.admin.servers.get(role="HOSTING_SERVER")

For stand-alone ArcGIS Server sites, directly create aServer instance.

# Usage Example 2: Get a stand-alone ArcGIS Server site that has Web Adaptor installedserver_base_url="https://example.com"gis_server=Server(url=f"{server_base_url}/web_adaptor/admin",token_url=f"{server_base_url}/web_adaptor/tokens/generateToken",username="admin_user",password="admin_password")

Parameter

Description

url

Required string. The URL to the ArcGIS Server administrationend point for the ArcGIS Server site.

Example:https://gis.mysite.com/arcgis/admin

The URL should be formatted as follows:<scheme>://<fully_qualified_domain_name>:<port (optional)>/<web adaptor>/admin

Note: Using the fully-qualified domain name to the server, also known as theWeb Context URL, is recommended as generally the SSL Certificate binding forthe web server uses this hostname.

gis

Optional string. The GIS object representing the ArcGIS Enterprise portal which thisArcGIS Server site is federated with. The GIS object should be logged in with a usernamein the publisher or administrator Role in order to administer the server. If thisparameter is not present, a combination of other keyword arguments must be present.

Note

If thegis argument is not present, any number of combinations of keyword arguments will initialize afunctioningServer object. See examples below.

Optional Argument

Description

baseurl

Optional string. The root URL to a site.Example:https://mysite.com/arcgis

tokenurl

Optional string. Used when a site is federated or when the tokenURL differs from the site’s base url. If a site is federated, thetoken URL will return as the portal token and ArcGIS Server userswill not validate correctly.

username

Optional string. The login username when using built-in ArcGIS Server security.

password

Optional string. The password for the specified username.

key_file

Optional string. The path to a PKI key file used to authenticate theuser to the Web Server in front of the ArcGIS Server site.

cert_file

Optional string. The path to PKI cert file used to authenticate theuser to the web server in front of the ArcGIS Server site.

proxy_host

Optional string. The web address to the proxy host if the environmentwhere the Python API is running requires a proxy host for access to theSite URL or GIS URL.

Example: proxy.mysite.com

proxy_port

Optional integer. The port which the proxy is accessed through,default is 80.

expiration

Optional integer. This is the length of time in minutes that a tokenrequested through this login process will be valid for.Example: 1440 is one day. The Default is 60.

all_ssl

Optional boolean. If True, all calls will be made over HTTPS insteadof HTTP. The default is False.

portal_connection

Optional string. This is used when a site is federated. It is theArcGIS Enterprise portal GIS object representing the portal managing the site.

initialize

Optional boolean. If True, the object will attempt to reach out tothe URL resource and populate at creation time. The default is False.

# Usage Example 3: Get the ArcGIS Server site that is federated to an Enterprise (using ``gis``)server_base_url="https://example.com"gis=GIS(profile="your_ent_admin_profile")gis_server=Server(url=f"{server_base_url}/web_adaptor/admin",gis=gis)# Usage Example 4: Get the ArcGIS Server site that is federated to an Enterprise (using ``portal_connection``)server_base_url="https://example.com"gis=GIS(profile="your_ent_admin_profile")gis_server=Server(url=f"{server_base_url}/web_adaptor/admin",portal_connection=gis._portal.con)
propertycontent:ServicesDirectory

Gets the Services Directory which can help you discover information aboutservices available on a particular server. A service represents alocal GIS resource whose functionality has been made available onthe server to a wider audience. For example, an ArcGIS Serveradministrator can publish a Pro map or ArcMap map document (.mxd) as a mapservice. Developers and clients can display the map service andquery its contents.

The Services Directory is available as part of the REST servicesinfrastructure available with ArcGIS Server installations. Itenables you to list the services available, including securedservices when you provide a proper login. For each service, a setof general properties are displayed. For map services, theseproperties include the spatial extent, spatial reference(coordinate system) and supported operations. Layers are alsolisted, with links to details about layers, which includes layerfields and extent. The Services Directory can execute simplequeries on layers.

The Services Directory is also useful for finding information aboutnon-map service types. For example, you can use the ServicesDirectory to determine the required address format for a geocodeservice, or the necessary model inputs for a geoprocessing service.

Returns:

ServicesDirectory object

propertydatastores:DataStoreManager

Gets the information about the data holdings of the server.Data items are used by ArcGIS Pro, ArcGIS Desktop, and other clientsto validate data paths referenced by GIS services.You can register new data items with the server by using theRegister Data Item operation. Use the Find Data Items operation tosearch through the hierarchy of data items.A relational data store type represents a database platform thathas been registered for use on a portal’s hosting server by theArcGIS Server administrator. Each relational data store typedescribes the properties ArcGIS Server requires in order to connectto an instance of a database for a particular platform. At leastone registered relational data store type is required before clientapplications such as Insights for ArcGIS can create RelationalDatabase Connection portal items.The Compute Ref Count operation counts and lists all references toa specific data item. This operation helps you determine if aparticular data item can be safely deleted or refreshed.

Returns:

DataStoreManager object

propertylogs:LogManager

Gives users access the ArcGIS Server’s logs and letsadministrators query and find errors and/or problems related tothe server or a service.

Logs are the records written by the various components of ArcGISServer. You can query the logs and change various log settings.NoteArcGIS Server Only

Returns:

LogManager object

propertymachines:MachineManager

Gets the list of server machines registered with the site.This resource represents a collection of all the server machines thathave been registered with the site. It other words, it representsthe total computing power of your site. A site will continue to runas long as there is one server machine online.For a server machine to start hosting GIS services, it must begrouped (or clustered). When you create a new site, a cluster called‘default’ is created for you.The list of server machines in your site can be dynamic. You canregister additional server machines when you need to increase thecomputing power of your site or unregister them if you no longerneed them.

Returns:

MachineManager object

propertymode:Mode

ArcGIS Server site mode that allows you to control changes to your site.You can set the site mode to READ_ONLY to disallow the publishing of newservices and block most administrative operations. Your existing serviceswill continue to function as they did previously. Note that certainadministrative operations such as adding and removing machines from asite are still available in READ_ONLY mode.

Returns:

Mode class

publish_sd(sd_file:str,folder:str|None=None,service_config:dict|None=None,future:bool=False,publish_options:dict|None=None,item_id:str|None=None)bool

Publishes a service definition file to ArcGIS Server.

Parameter

Description

sd_file

Required string. The path to 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.

future

Optional boolean. If True, the operation is returned immediately and a Job object is returned.

publish_options

Optional Dict[str, Any]. A set of specifications for the published item.

item_id

Optional string. The item ID of the item to be published. Must be a valid ID nonexistent in the server.

Returns:

If future=False, A boolean indicating success (True) or failure (False).else when future=True, a Future object is returned.

propertyresources:list

returns the list of resources available on the server administration endpoint.

propertyservices:ServiceManager

Gives the administrator access to the services on ArcGIS Server

Returns:

ServiceManager or None

propertysite:SiteManager

Gets the site’s collection of server resources. This collectionincludes server machines that are installed with ArcGIS Server,including GIS services, data and so on. The site resource alsolists the current version of the software.When you install ArcGIS Server on a server machine for the firsttime, you must create a new site. Subsequently, newer servermachines can join your site and increase its computing power. Oncea site is no longer required, you can delete the site, which willcause all of the resources to be cleaned up.

Returns:

SiteManager

propertysystem:SystemManager

Provides access to common system configuration settings.

Returns:

SystemManager or None

propertyuploads:Uploads

Gets an object to work with the site uploads.

propertyusage:ReportManager

Gets the collection of all the usage reports createdwithin your site. The Create Usage Report operation lets you definea new usage report.

Returns:

ReportManager or None

propertyusers

Gets operations to work with users.

Returns:

UserManager object

ServicesDirectory

classarcgis.gis.server.catalog.ServicesDirectory(url:str=None,username:str=None,password:str=None,key_file:str=None,cert_file:str=None,verify_cert:bool=False,proxy:dict=None,**kwargs)

Bases:BaseServer

Provides ArcGIS Server Services Directory access.

The Services Directory allows you to browse the contents of an ArcGIS Server and obtaininformation that can be useful to end-users for developing applications, performing analysis, orcataloging services. The ServicesDirectory is a view of the ArcGIS Server REST API in a pythonclass.

With the Services Directory, you can do the following:
  • Browse the contents of the GIS Server and get service-level metadata

  • Navigate a series of links to view information about the services on your GIS Server.

  • Get information to help you develop applications

When you develop applications with the Python API, you must provide URLs to services and thelayers and functionality they expose. The Services Directory provides an interactive way foryou to construct those URLs.

The Services Directory works using REST. REST is an architectural style that allows ArcGISServer to reveal a hierarchy of information about itself through endpoints, or URLs. When youuse the Services Directory, you navigate through a series of links to discover informationabout the server. Each time you click a link, you see a new page that reveals additionalinformation about what’s available on the server. The information that you see on the page isretrieved through REST using the page’s URL.

Parameter

Description

url

string required. The web address to the ArcGIS Server administrationend point.

Example:https://mysite.com/arcgis

The URL should be formatted as follows:<scheme>://<host>:<port (optional)>/<web adapter>

baseurl

optional string, the root URL to a site.Example:https://mysite.com/arcgis

tokenurl

optional string. Used when a site if federated or when the tokenURL differs from the site’s baseurl. If a site is federated, thetoken URL will return as the Portal token and ArcGIS Server userswill not validate correctly.

username

optional string, login username for BUILT-IN security

password

optional string, a secret word or phrase that must be used to gainaccess to the account above.

key_file

optional string, path to PKI ket file

cert_file

optional string, path to PKI cert file

proxy_host

optional string, web address to the proxy host

Example: proxy.mysite.com

proxy_port

optional integer, default is 80. The port where the proxy resided on

expiration

optional integer. The Default is 60. This is the length of time atoken is valid for.Example 1440 is one week.

all_ssl

optional boolean. The default is False. If True, all calls will bemade over HTTPS instead of HTTP.

portal_connection

optional GIS. This is used when a site is federated. It is theArcGIS Online or Portal GIS object used.

initialize

optional boolean. The default is False. If True, the object willattempt to reach out to the URL resource and populate at creationtime.

verify_cert

optional booean. The defaut is True. If False, any certificateerrors will be ignored. This is useful for new sites or where sitethat have invalid certificates.

find(service_name:str,folder:str|None=None)

finds a service based on it’s name in a given folder

propertyfolders

returns a list of server folders

footprints(folder:str|None=None,out_sr:dict|None=None)dict

Returns the Services’ extents for all services in a given folder.

Parameter

Description

folder

Optional String. The name of the folder to examine for the footprints.

out_sr

Optional Integer. The well-known ID of the spatial reference. The default is 4326.

Returns:

dict[str, Any]

get(name:str,folder:str|None=None)

returns a single service in a folder

list(folder:str|None=None,as_dict:bool=False)list|dict[str,Any]

Thelist method returns a list of services at the given folder.The objects will vary in type according to the type of service. Forexample,FeatureServicesreturnFeatureLayerCollection objects,GeoprocessingServices returnToolbox objects, whileMapServices returnMapImageLayer objects.

Note

This method is not to be confused with thelist method of theServerManager class, which returnsServer orNotebookServer objects, or thelist method oftheServiceManager class, whichreturns a list ofService objects and modules.

report(as_html:bool=True,folder:str|None=None)

Generates a table of Services in the given folder, as a Pandas dataframe.

propertysession:EsriSession

returns the session for the ServiceDirectory

Service

classarcgis.gis.server.Service(url:str,gis:GIS,initialize:bool=False,**kwargs)

Bases:BaseServer

Represents a GIS administrative service

(This should not be created by a user)

change_provider(provider:str)bool

Allows for the switching of the service provide and how it is hosted on the ArcGIS Server instance.

Values:

  • ‘ArcObjects’ means the service is running under the ArcMap runtime i.e. published from ArcMap

  • ‘ArcObjects11’: means the service is running under the ArcGIS Pro runtime i.e. published from ArcGIS Pro

  • ‘DMaps’: means the service is running in the shared instance pool (and thus running under the ArcGIS Pro provider runtime)

Returns:

Boolean

delete()bool

deletes a service from arcgis server

edit(service:dict,future:bool=False)tuple[bool,dict]|tuple[bool,AsyncJob]

To edit a service, you need to submit the complete JSONrepresentation of the service, which includes the updates to theservice properties. Editing a service causes the service to berestarted with updated properties.

Parameter

Description

service

Required dict. The service JSON as a dictionary.

future

Optional bool. Allows the operation to be run asynchronously whenTrue, else the operation is run synchronously.

Returns:

Boolean and the Service Message whenfuture=False,orAsyncJob whenfuture=True

propertyextensions:list

lists theextensions on a service

propertyiteminformation:ItemInformationManager

Returns the item information

Returns:

ItemInformationManager

propertyjobs:JobManager

returns aJobManager to manage asynchronous geoprocessing tasks

modify_extensions(extension_objects:list|None=None)bool

enables/disables a service extension type based on the name

Parameter

Description

extension_objects

Required list. A list of new extensions.

Returns:

Boolean

rename(new_name:str)bool

Renames this service to the new name

Parameter

Description

new_name

Required string. New name of the current service.

Returns:

Boolean

restart()bool

restarts the current service

service_manifest(file_type:str='json')str

The service manifest resource documents the data and otherresources that define the service origins and power the service.This resource will tell you underlying databases and their locationalong with other supplementary files that make up the service.

Parameter

Description

file_type

Required string. This value can be json or xml. json return themanifest.json file. xml returns the manifest.xml file.

Returns:

string

start()bool

starts the specific service

propertystatistics:dict

returns the stats for the service

propertystatus:dict

returns the status of the service

stop()bool

stops the current service

propertywebhook_manager:ServiceWebHookManager

Returns an instance ofServiceWebHookManager,the feature service-based webhook manager available atArcGIS Server 11.1 and later.

Extension

classarcgis.gis.server.Extension(type_name:str,capabilities:str,enabled:bool,max_upload_file_size:str|float|int,allowed_upload_filetype:str,properties:dict)

Bases:object

represents a service extension

propertyallowed_upload_filetypes:str

gets/sets the allowed upload file type

propertycapabilities:str

gets/sets the capabilities

propertyenabled:bool

gets/sets the extension is enabled

staticfromJSON(value:str|dict)Extension

returns the object from json string or dictionary

propertymax_upload_file_size:int|float

sets/gets the max upload file size

propertyproperties:dict

gets/sets the extension properties

propertytypeName:str

gets the extension type

propertyvalue:dict

returns the object as a dictionary

Machine

classarcgis.gis.server.Machine(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

A resource to provide administrative tools for managing this machineand the required SSL Certificate.

Note

The Machine

A server machine represents a machine on which ArcGIS Serversoftware has been installed and licensed. A site is made up of oneor more machines that must be registered with the site. The site’smachines work together to host GIS services and data, and provideadministrative capabilities for the site. Each server machine iscapable of performing all these administrative tasks and hence asite can be thought of as a distributed peer-to-peer network ofmachines. The server machine communicates with its peers over arange of TCP and UDP ports that can be configured using the edit operation(https://developers.arcgis.com/rest/enterprise-administration/server/editmachine.htm ).

Note

SSL Certificates

A certificate represents a key pair that has been digitally signedand acknowledged by a Certifying Authority (CA). It is the mostfundamental component in enabling SSL on your server. Before youenable SSL on your server, you need to generate a certificate andget it signed by a trusted CA.

The Generate Certificate(https://developers.arcgis.com/rest/enterprise-administration/server/generatecertificate.htm )operation creates a new self-signed certificate and adds it tothe keystore. For your convenience, the server is capable of generatingself-signed certificates that can be used during development orstaging. However, it is critical that you obtain CA-signedcertificates when standing up a production server. Even thougha self-signed certificate can be used to enable SSL, it is recommendedthat you use these only on staging or development servers.

In order to get a certificate signed by a CA, you need to generatea CSR (certificate signing request) and then submit it to your CA.The CA will sign your certificate request which can then beimported into the server by using the import CA signed certificateoperation.

delete_certificate(certificate:str)bool

Deletes a SSL certificate using the certificate alias.

Parameter

Description

certificate

Required string. The name of the certificate to delete

Returns:

Boolean

export_certificate(certificate:str)str

Downloads an SSL certificate. The file returned by theserver is an X.509 certificate. The downloaded certificate can thenbe imported into a client that is making HTTP requests.

Parameter

Description

certificate

Required string. The name of the certificate in the key store.

Returns:

The SSL certificate object.

generate_CSR(certificate:str)dict

Generates a certificate signing request (CSR) for aself-signed certificate. A CSR is required by a CA to create adigitally signed version of your certificate. Supply the certificateobject that was created with method ssl_certificate.

Parameter

Description

certificate

Required string. The name of the certificate in the key store.

Returns:

The CSR.

propertyhardware:dict

This resource displays hardware information for the machine in yourArcGIS Server site. It updates the information when it detects anychange to the configuration of your machine, as well as each timethe machine is restarted.

Returns:

Dict

import_CA_signed_certificate(certificate:str,ca_signed_certificate:str)bool

Imports a certificate authority (CA)-signed SSL certificate into the key store.

Parameter

Description

certificate

Required string. The name of the certificate in the key store.

ca_signed_certificate

Required string. The multi-part POST parameter containing thesigned certificate file.

Returns:

A boolean indicating success (True) or failure (False).

import_existing_server_certificate(alias:str,cert_password:str,cert_file:str)bool

Imports an existing server certificate, stored inthe PKCS #12 format, into the keystore.If the certificate is a CA-signed certificate, you must firstimport the CA root or intermediate certificate using theimportRootCertificate operation.

Parameter

Description

alias

Required string. A unique name for the certificate that easilyidentifies it.

cert_password

Required string. The password to unlock the file containing the certificate.

cert_file

Required string. The multi-part POST parameter containing the certificate file.

Returns:

A boolean indicating success (True) or failure (False).

import_root_certificate(alias:str,root_CA_certificate:str)dict

Imports a certificate authority’s (CA) root and intermediatecertificates into the keystore.

To create a production quality CA-signed certificate, you need toadd the CA’s certificates into the keystore that enables the SSLmechanism to trust the CA (and the certificates it is signed).While most of the popular CA’s certificates are already availablein the keystore, you can use this operation if you have a customCA or specific intermediate certificates.

Parameter

Description

alias

Required string. The name of the certificate.

root_CA_certificate

Required string. The multi-part POST parameter containing the certificate file.

Returns:

A boolean indicating success (True) or failure (False).

ssl_certificate(certificate:str)

Provides the self-signed certificate object.

Note

Even though a self-signed certificate can be used to enable SSL, itis recommended that you use a self-signed certificate only on stagingor development servers.

Parameter

Description

certificate

Required string. The name of the certificate in the key store tograb information from.

Returns:

The certificate object.

propertyssl_certificates:dict

Gets the list of all the certificates (self-signed and CA-signed)created for the server machine. The server securely stores thesecertificates inside a key store within the configuration store.

start()bool

Starts this server machine. Starting the machine enables itsability to host GIS services.

Returns:

A boolean indicating success (True) or failure (False).

propertystatus:dict

Gets the status/state of this machine.

stop()bool

Stops this server machine. Stopping the machine disables itsability to host GIS services.

Returns:

A boolean indicating success (True) or failure (False).

synchronize()bool

On occasion, one or more machines in a server site might beunavailable due to network issues or because they are down(intentionally or unintentionally). Once these machines becomeavailable again, they will need to synchronize with the site topick up any changes made to the site during that downtime. Thisis done automatically by the site, but it is only a one-timeattempt. If there are any issues with this synchronizing effort,a SEVERE message is logged.

This operation allows administrators to manually synchronize specificmachines with the site. Synchronizing a machine with the site willreconfigure the machine and redeploy all services. This will take afew minutes. During this time, all administrative operations on thesite will be blocked.

Returns:

Boolean

unregister()bool

Removes this machine from the site. This server machine will nolonger participate in the site or run any of the GIS services. Allresources that were acquired by the server machine (memory, files,and so forth) will be released.

Typically, you should only invoke this operation if the machineis going to be shut down for extended periods of time, or if itis being upgraded.

Once a machine has been unregistered, you can create a new siteor join an existing site.

Returns:

A boolean indicating success (True) or failure (False).

Report

classarcgis.gis.server.Report(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

(This class should not be created by a user)

A utility class representing a single usage report returned by ArcGIS Server.

A Usage Report is used to obtain ArcGIS Server usage data for specifiedresources during a given time period. It specifies the parameters forobtaining server usage data, time range (parameters since, from_value, to_value),aggregation interval, and queries (which specify the metrics to begathered for a collection of server resources, such as folders andservices).

delete()dict

Deletes this usage report.

Returns:

A JSON indicating success.

edit()dict

Edits the usage report. To edit a usage report, submitthe complete JSON representation of the usage report whichincludes updates to the usage report properties. The name of thereport cannot be changed when editing the usage report.

Values are changed in the class, to edit a property likemetrics, pass in a new value.

Returns:

A JSON indicating success.

query(query_filter:str|None=None)dict

Retrieves server usage data for this report. This operationaggregates and filters server usage statistics for the entireArcGIS Server site. The report data is aggregated in a time slice,which is obtained by dividing up the time duration by the default(or specified) aggregationInterval parameter in the report. Eachtime slice is represented by a timestamp, which represents theending period of that time slice.

In the JSON response, the queried data is returned for each metric-resource URI combination in a query. In the report-data section,the queried data is represented as an array of numerical values. Aresponse of null indicates that data is not available or requestswere not logged for that metric in the corresponding time-slice.

Parameter

Description

query_filter

Optional string. The report data can be filtered by the machinewhere the data is generated. The filter accepts a comma-separatedlist of machine names; * represents all machines.

Returns:

A JSON containing the server usage data.

USAGEEXAMPLE1:Filtersforthespecifiedmachines{"machines":["WIN-85VQ4T2LR5N","WIN-239486728937"]}
USAGEEXAMPLE2:Nofiltering,allmachinesareaccepted{"machines":"*"}

Datastore

classarcgis.gis.server.Datastore(datastore:DataStoreManager,path:str,datadict:dict|None=None,**kwargs)

Bases:BaseServer

Represents a single Datastore in the Data Store Manager.

propertydatasets:list

Gets the datasets in the data store (currently implemented for big data file shares).

delete()bool

Unregisters this data item from the data store.

Returns:

A boolean indicating success (True) or failure (False).

propertyhints:dict

Gets the hints resource for a big data file share. Hintsare advanced parameters to control the generation of a manifest.

Sets the hints resource for a big data file share. Hintsare advanced parameters to control the generation of a manifest.

Upload a hints file for a big data file share item. This willreplace the existing hints file. To apply the control parameters inthe hints file and regenerate the manifest, use the editDataItem toedit the big data file share (using the same data store item asinput) which will regenerate the manifest. When a manifest isregenerated, it will be updated only for datasets that have hintsand for new datasets that are added to the existing big data fileshare location.

Parameter

Description

hints

Required string. The hints file to be uploaded.

propertylifecycleinfos:dict[str,Any]

Returns information regarding when the data store item was created and last edited.

propertymanifest:dict

Gets the manifest resource for a big data file share.

propertyref_count:dict

The total number of references to this data item that exist on theserver. You can use this property to determine if this data itemcan be safely deleted or taken down for maintenance.

Returns:

A number indictaing the number of references to this data item.

regenerate()bool

This regenerates the manifest for a big data file share. You canregenerate a manifest if you have added new data or if you haveuploaded a hints file using the edit resource.

Returns:

Boolean. True = Success, False = Failure

update(item:str)bool

Edits this data item to update its connection information.

Parameter

Description

item

Required string. The dict representation of the updated item.

Returns:

True if the data item was successfully updated, False if the update failed.

validate()bool

Validates that this data item’s path (for file shares) or connection string (for databases)is accessible to every server node in the site. This is necessary for the data item to beregistered and used successfully with the server’s data store.

Returns:

True if the data item was successfully validated.

User

classarcgis.gis.server.User(usermanager:UserManager,user_dict:dict)

Bases:dict

A resource representing a user in the user store that can administer ArcGIS Server.

add_role(role_name:str)dict

Use this operation to assign roles to a user account whenworking with a user and role store that supports reads and writes.By assigning a role to a user, the user account automaticallyinherits all the role’s permissions.

Parameter

Description

role_name

Required string. A role name to assign to this user.

Returns:

A JSON indicating success.

delete()bool

Deletes this user account.

Returns:

A JSON indicating success.

update(password:str|None=None,full_name:str|None=None,description:str|None=None,email:str|None=None)bool

Updates this user account in the user store.

Parameter

Description

password

Optional string. The password for this user.

full_name

Optional string. A full name for this user.

description

Optional string. Provide comments or description for this user.

email

Optional string. An email for this user account.

Returns:

A JSON indicating success.

Role

classarcgis.gis.server.Role(rolemanager:RoleManager,roledict:dict)

Bases:dict

Represents a single role on server.

delete()bool

Deletes this current role.

Returns:

A boolean indicating success (True) or failure (False).

grant(username:str)bool

Adds a user to this role.

Parmeters

Description

username

Required string. The account name to add to the role.

Returns:

A boolean indicating success (True) or failure (False).

set_privileges(privilege:str)bool

Assigns a privilege to this role.

Administrative access to ArcGIS Server is modeled as three broadtiers of privileges:

  • ADMINISTER - A role that possesses this privilege has unrestricted administrative access to ArcGIS Server.

  • PUBLISH - A role with PUBLISH privilege can only publish GIS services to ArcGIS Server.

  • ACCESS - No administrative access. A role with this privilege can only be granted permission to access one or more GIS services.

By assigning these privileges to one or more roles in the rolestore, ArcGIS Server’s security model supports role-based accesscontrol to its administrative functionality.

These privilege assignments are stored independent of ArcGISServer’s role store. As a result, you don’t need to update yourenterprise identity stores (like Active Directory).

Parameter

Description

privilege

Required string. The capability to assign to the role. Choices areADMINISTER, PUBLISH, ACCESS

Returns:

A boolean indicating success (True) or failure (False).

update(description:str|None=None)dict

Updates this role in the role store with new information. Thisoperation is available only when the role store is a read-writestore such as the default ArcGIS Server store.

Parameter

Description

description

Optional string. An optional field to add comments or a description for the role.

Returns:

A status dictionary.

ServerManager

classarcgis.gis.server.ServerManager(gis)

Bases:object

Helper class for managing your ArcGIS Servers. This class is not createdby users directly. An instance of this class, called ‘servers’,is available as a property of the gis.admin object. Administrators call methodson thisServerManager object to manage and interrogate ArcGIS Servers.

get(role:str|None=None,function:str|None=None)

Retrieves the ArcGIS Server(s) by role or function. While each argument is optional,at least one argument must be set with an allowed value other than None.

Parameter

Description

role

Optional string. Limits the returned ArcGIS Servers based on theserver’s role as either a hosting server for the portal, a federated server,or a server with restricted access to publishing. The allowed valuesare HOSTING_SERVER, FEDERATED_SERVER, or FEDERATED_SERVER_WITH_RESTRICTED_PUBLISHING,respectively.

function

Optional string. Limits the returned ArcGIS Servers based on theserver’s function. Provide a comma-separated list of values. Theallowed values are GeoAnalytics, RasterAnalytics, NotebookServer,and ImageHosting.

Returns:

The ArcGIS Server(s) discovered that match the criteria.

list()

Thelist method retrieves all servers in aGIS, retrieving a list of admin services.

Note

This method is not to be confused with thelist method, in theServicesDirectory class, which returns a variety of services, such as aFeatureService,MapService,VectorTile,GeoprocessingService, etc.

Returns:

A list of all servers (in the form of admin service objects) found in theGIS.

propertyproperties

TheServerManager properties

Returns:

Dict

update(server: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. To set a hosting server, anenterprise geodatabase must be registered as a managed databasewith the ArcGIS Server.

Parameter

Description

server

Required string. The arcgis.gis.Server object.

role

Required string. State whether the server is either a hosting serverfor the portal, a federated server, or a server with restricted accessto publishing. The allowed values are HOSTING_SERVER, FEDERATED_SERVER,or FEDERATED_SERVER_WITH_RESTRICTED_PUBLISHING, respectively.

function

Optional string. The specific function associated with this server. Provide acomma-separated list of values, but it is not recommend that a singleserver have all the server functions. The allowed values areRasterAnalytics and ImageHosting.

Returns:

A status message of ‘success’ with the ID of the ArcGIS Server.

validate()

This operation returns information on the status of ArcGIS Serversregistered with Portal for ArcGIS.

Returns:

True if all servers are functioning as expected, False if there is anissue with 1 or more of the Federated Servers.

ServiceManager

classarcgis.gis.server.ServiceManager(url:str,gis:GIS,initialize:bool=False,sm:Server=None)

Bases:BaseServer

Helper class for managing services. This class is not created by users directly. An instance of this class,called ‘services’, is available as a property of the Server object. Users call methods on this ‘services’ object tomanaging services.

create_folder(folder_name:str,description:str='')bool

Creates a unique folder name on AGS

Parameter

Description

folder_name

Required string. Name of the new folder.

description

Optional string. Description of what the folder is.

Returns:

Boolean

create_service(service:dict)dict

Creates a new GIS service in the folder. A service is created bysubmitting a JSON representation of the service to this operation.

The JSON representation of a service contains the following foursections:

  • Service Description Properties-Common properties that are sharedby all service types. Typically, they identify a specific service.

  • Service Framework Properties-Properties targeted towards theframework that hosts the GIS service. They define the life cycleand load balancing of the service.

  • Service Type Properties -Properties targeted towards the coreservice type as seen by the server administrator. Since theseproperties are associated with a server object, they vary acrossthe service types. The Service Types section in the Helpdescribes the supported properties for each service.

  • Extension Properties-Represent the extensions that are enabledon the service. The Extension Types section in the Help describesthe supported out-of-the-box extensions for each service type.

Parameter

Description

service

Required dict. The service is the properties to create a service.

Returns:

Dict

Output:

dictionary status message

delete_folder(folder_name:str)bool

Removes a folder on ArcGIS Server

Parameter

Description

folder_name

Required string. Name of the folder.

Returns:

Boolean

exists(folder_name:str,name:str|None=None,service_type:str|None=None)bool

This operation allows you to check whether a folder or a serviceexists. To test if a folder exists, supply only a folder_name. Totest if a service exists in a root folder, supply both serviceNameand service_type with folder_name=None. To test if a service existsin a folder, supply all three parameters.

Parameter

Description

folder_name

Required string. The folder name to check for.

name

Optional string. The service name to check for.

service_type

Optional string. A service type. Allowed values:

GeometryServer | ImageServer | MapServer | GeocodeServer |GeoDataServer | GPServer | GlobeServer | SearchServer

Returns:

Boolean

propertyfolders:list

returns a list of all folders

list(folder:str|None=None,refresh:bool=True)list

returns a list of services in the specified folder

Parameter

Description

folder

Required string. The name of the folder to list services from.

refresh

Optional boolean. Default is False. If True, the list of services will berequested to the server, else the list will be returned from cache.

Returns:

list

publish_sd(sd_file:str,folder:str|None=None,service_config:dict|None=None)bool

publishes a service definition file to arcgis server

Parameter

Description

sd_file

Required string. File path to the .sd file

folder

Optional string. This parameter allows for the override of thefolder option set in the SD file.

Returns:

Boolean

propertyservice_properties:dict[str,Any]

The properties resource returns the default settings for newlypublished services. Currently, the only supported property ispreferSharedInstances. ThepreferSharedInstances propertycontrols whether new, compatible services published from ArcGIS Prowill use shared or dedicated instances. This property can bemodified using the update operation.

Parameter

Description

properties

Required dict[str,Any]. A JSON object that describes each propertyto be set. Currently, the only supported property ispreferSharedInstances. When set to true, compatible services willuse shared instances when first published. When set to false, theywill use dedicated instances. The default is true.

Returns:

dict[str,Any]

session:EsriSession|None=None
propertytypes:TypesManager

The types resource provides metadata about all service types andextensions that can be enabled on each service type. The servicesframework uses this information to validate a service and constructthe various objects in the service. The metadata containsidentifiers for each object, a default list of capabilities,properties, and other resource information (like WSDL and soforth). Type information for a specific service type can beaccessed by appending the type name to this URL.

Returns:

TypesManager

MachineManager

classarcgis.gis.server.MachineManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

This resource represents a collection of all the server machines thathave been registered with the site. In other words, it represents thetotal computing power of your site. A site will continue to run as longas there is at least one server machine online.

For a server machine to start hosting GIS services, it must be in a cluster(note that clusters have been deprecated, seehttp://server.arcgis.com/en/server/latest/administer/windows/about-single-cluster-mode.htm ).When you create a new site, a cluster called ‘default’ (deployed withsingleClusterMode set to true) is created for you.

The list of server machines in your site can be dynamic. You canregister additional server machines when you need to increase thecomputing power of your site, or unregister them if you no longer needthem.

get(machine_name:str)Machine

Provides the machine object for a given machine.

Parameter

Description

machine_name

Required string. The name of the server. Example: machines_obj.get(“SERVER.DOMAIN.COM”)

Returns:

Machine object

list()list
Returns:

A list ofmachines that are part of the server configuration.

register(name:str,admin_url:str)bool

For a server machine to participate in a site, it needs to beregistered with the site. The server machine must have ArcGISServer software installed and authorized.

Registering machines this way is a “pull” approach to growingthe site and is a convenient way when a large number of machinesneed to be added to a site. A server machine can alsochoose to join a site.

Parameter

Description

name

Required string. The name of the server machine.

admin_url

Required string. The URL where the Administrator API is running onthe server machine. Example: http: //<machineName>:6080/arcgis/admin

Returns:

A boolean indicating success (True) or failure (False).

rename(name:str,new_name:str)bool

You must use this operation if one of the registered machineshas undergone a name change. This operation updates anyreferences to the former machine configuration.

By default, when the server is restarted, it is capable ofidentifying a name change and repairing itself and all itsreferences. This operation is a manual call to handle themachine name change.

Parameter

Description

name

Required string. The former name of the server machine that isregistered with the site.

new_name

Required string. The new name of the server machine.

Returns:

A boolean indicating success (True) or failure (False).

LogManager

classarcgis.gis.server.LogManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

Helper class for the management of logs by administrators. Logs are thetransaction records written by the various components of ArcGIS Server.You can query the logs, change various log settings, and check errormessages for helping to determine the nature of an issue. This class isnot meant to be initialized directly, but instead is accessed as thelogs property on aServer object:

#Usage Example: Initializing a Server LogManager of federated server>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>server_mgr=gis.admin.servers>>>host_server=server_mgr.get(role="HOSTING_SERVER")[0]>>>log_mgr=host_server.logs<LogManagerathttps://example_server.com/<web_adaptor>/admin/logs>

See theServer logsdocumentation for more details.

clean()bool

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 freeingup disk space. However, it is not required that you invoke this operation becausethe server periodically purges old logs.

Returns:

A boolean indicating success (True) or failure (False).

count_error_reports(machine:str='*')dict

This operation counts the number of error reports (crash reports) that have been generatedon each machine.

Parameter

Description

machine

Optional string. The name of the machine on which to count thereports. The default will return the count for all machines in a site.

Returns:

A dictionary with machine name and report count.

edit(level:str='WARNING',log_dir:str|None=None,max_age:int=90,max_report_count:int=10)dict

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.

log_dir

Optional string. The file path to the root of the log directory.

max_age

Optional integer. The number of days that a server should save alog file. The default is 90.

ax_report_count

Optional integer. The maximum number of error report files permachine. The default is 10.

Returns:

A JSON with the edited settings.

query(start_time:int|datetime|None=None,end_time:int|datetime|None=None,since_server_start:bool=False,level:str='WARNING',services:str='*',machines:str='*',server:str='*',codes:str|None=None,process_IDs:str|None=None,export:bool=False,export_type:str='CSV',out_path:str|None=None,max_records_return:int=5000)

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 integer, string or datetime. The most recent time to query.Default is current time. Time can be specified in:

  • milliseconds since UNIX epoch - integer

  • ArcGIS Server timestamp - string

  • Python datetime object - datetime

# Example for Unix Epoch:>>>log_resp=log_mgr.query(>>>start_time=1312237040123,>>>...)# Example for Timestamp:>>>log_resp=log_mgr.query(>>>start_time="2024-10-18T13:00:00",>>>...)# Example for Datetime object:>>>importdatetimeasdt>>>starting_time=dt.datetime(2024,10,18,13,0,0)>>>log_resp=log_mgr.query(>>>start_time=starting_time,>>>...)

end_time

Optional integer, string or datetime. The previous time to query from.Time can be specified in:

  • milliseconds since UNIX epoch - integer

  • ArcGIS Server timestamp - string

  • Python datetime object - datetime

Note

Ifsince_server_start=True, the default is all logs since theserver was started.

since_server_start

Optional Bool. Gets only the records written since the serverstarted (True). The default isFalse.

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

The default isWARNING.

services

Optional List of comma separated strings denoting service names.Query records related to a specific service(s). The default is “*”,which queries all services.

Note

The string format isFolder_name/<service_name>.<service_type>.For example:

>>>log_mgr.query(>>>...>>>services="Hosted/streets.FeatureServer,System/PublishingTools.GPServer",>>>...>>>)

machines

Optional String. Query records related to a specific machine.The default is all, “*”.

server

Optional String. Query records related to a specific server.The default is all, “*”.

codes

Optional List of integers and/or strings. Gets only the records with thespecified codes, or between the range of codes. If no argument isprovided, all codes are included.

SeeLog codes overviewfor full details.

Note

Individual codes should be entered as integers. A range of codesmust be entered as a string:

>>>res=log_manager.query(>>>...>>>codes=["6500-7000",12018]>>>...>>>)

process_IDs

Optional String. Query by the machine process ID that logged the event.

export

Optional String. Boolean indicating whether to export the queryresults. The default isFalse, which will not export).

export_type

Optional String. The export file type. Choices are:

  • CSV

  • TAB

The default isCSV.

out_path

Optional String. The path to download the log file to.

max_records_return

Optional Int. The maximum amount of records to return. Default is 5000

Returns:

A Python dictionary of the log items that match the query. If export option is set to True, theoutput log file path is returned.

# Usage Example: Query all services for specific codes:>>>fromarcgis.gisimportGIS>>>gis=GIS(profile="your_enterprise_admin_profile")>>>server_mgr=gis.admin.servers>>>log_mgr=server_mgr.logs>>>query_resp=log_mgr.query(>>>start_time="2025-03-07T06:00:00",>>>end_time="2025-02-07T06:00:00",>>>codes=["7000-8000"],>>>services="Hosted/water_mains.FeatureServer",>>>level="WARNING">>>)
propertysettings:dict

Gets the current log settings.

ReportManager

classarcgis.gis.server.ReportManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

A utility class for managing usage reports for ArcGIS Server.

create(reportname:str,queries:list,metadata:str|None=None,since:str='LAST_DAY',from_value:int|None=None,to_value:int|None=None,aggregation_interval:str|None=None)dict

Creates a new usage report. A usage report is created by submittinga JSON representation of the usage report to this operation.SeeCreate Usage Reportfor details on the REST request bundled by this method.

Parameter

Description

reportname

Required string. The unique name of the report.

queries

Required list of Python dictionaries for which to generate thereport. Each dictionary has two keys:resourceURIs andmetrics

# Usage Example>>>server1.usage.create(...queries=[{"resourceURIs":["/services/Folder_name/","Forest_loss.FeatureServer"],"metrics":["RequestCount,RequestsFailed"]}]...)

Each key’s corresponding value is a list of strings specifyinga resource for which to gather metrics, or the metrics togather, respectively.

  • resourceURIs

    Comma-separated list that specifies the services or foldersfor which to gather metrics, formatted as below:

    • services/ -Entire Site

    • services/Folder/ -Folder within a Site. Reports metrics aggregated across allservices within that folder and any sub-folders.

    • services/Folder/ServiceName.ServiceType -Service in a specified folder.

      • services/Folder_name/Map_bv_999.MapServer

    • service -If in the root folder

      • Map_bv_999.MapServer

  • metrics

    Comma-separated string of specific measures to gather.

    • RequestCount — the number of requests received

    • RequestsFailed - the number of requests that failed

    • RequestsTimedOut — the number of requests that timed out

    • RequestMaxResponseTime — the maximum response time

    • RequestAvgResponseTime - the average response time

    • ServiceRunningInstancesMax — the maximum number of active service instancessampled at one-minute intervals for a specified service.

    Note

    For ArcGIS Enterprise deployments at 11.0 and below, if you includeServiceRunningInstancesMax, it must be the only metric included in the report.

    • RequestAvgWaitTime — the average time all requests waited for an available instance

    • RequestMaxWaitTime — the maximum time a request waited for an available instance

    • RequestMinWaitTime — the minimum time a request waited for an available instance

metadata

Optional string. Any JSON object representing presentation tierdata for the usage report, such as report title, colors,line-styles, etc. Also used to denote visibility in ArcGIS ServerManager for reports created with the Administrator Directory. Tomake any report created in the Administrator Directory visible toManager, include“managerReport”:true in the metadata JSON object.When this value is not set (default), reports are not visible inManager. This behavior can be extended to any client that wants tointeract with the Administrator Directory. Any user-created valuewill need to be processed by the client.

since

Optional string. The time duration of the report. The supportedvalues are: LAST_DAY, LAST_WEEK, LAST_MONTH, LAST_YEAR, CUSTOM

  • LAST_DAY represents a time range spanning the previous 24 hours.This is the default value.

  • LAST_WEEK represents a time range spanning the previous 7 days.

  • LAST_MONTH represents a time range spanning the previous 30 days.

  • LAST_YEAR represents a time range spanning the previous 365 days.

  • CUSTOM represents a time range that is specified using the fromand to parameters.

from_value

Optional integer. Only valid whensince is CUSTOM. The timestampin milliseconds (since January 1, 1970, 00:00:00 GMT, the Unix epoch)for the beginning period of the report.

# usage Example:importdatetimeasdt>>>sept1_2020=int(dt.datetime(2020,9,1).timestamp())*1000sept1_20201598943600000

to_value

Optional integer. Only valid whensince is CUSTOM. The timestampin milliseconds (since January 1, 1970, 00:00:00 GMT, the Unix epoch)for the ending period of the report.

# usage Example:importdatetimeasdtnow=int(dt.datetime.now().timestamp())*1000

aggregation_interval

Optional string. The aggregation interval in minutes. Server metricsare aggregated and returned for time slices aggregated using thespecified aggregation interval. The time range for the report,specified using thesince parameter (andfrom_value andto_value when since is CUSTOM) is split into multiple slices, eachcovering an aggregation interval. Server metrics are then aggregatedfor each time slice and returned as data points in the report data.When the aggregation_interval is not specified, the following defaultsare used:

  • LAST_DAY: 30 minutes

  • LAST_WEEK: 4 hours

  • LAST_MONTH: 24 hours

  • LAST_YEAR: 1 week

  • CUSTOM: 30 minutes up to 1 day, 4 hours up to 1 week, 1

day up to 30 days, and 1 week for longer periods.

If the interval specified in Usage Reports Settings is more thanthe aggregationInterval, the interval is used instead.

Returns:

AReport object.

USAGEEXAMPLE:importdatetimeasdtfromarcgis.gisimportGIS>>>gis=GIS(profile="your_ent_profile",verify_cert=False)>>>gis_servers=gis.admin.servers.list()>>>gis_server=gis_servers[1]>>>now=int(dt.datetime.now().timestamp())*1000>>>sept1_2020=int(dt.datetime(2020,9,1).timestamp())*1000>>>query_obj=[{"resourceURIs":["services/Map_bv_999.MapServer"],"metrics":["RequestCount"]}]>>>r=gis_server.usage.create(reportname="SampleReport",queries=query_obj,metadata="This could be any String or JSON Object.",since="CUSTOM",from_value=sept1_2020,to_value=now)>>>r<Reportathttps://server_url:6443/arcgis/admin/usagereports/SampleReport>
edit(interval:str,enabled:bool=True,max_history:int=0)dict

Edits the usage reports settings that are applied to the entire site.

Parameter

Description

interval

Required string. Defines the duration (in minutes) for which theusage statistics are aggregated or sampled, in-memory, before beingwritten out to the statistics database.

enabled

Optional string. When usage reports are enabled, serviceusage statistics are collected and persisted to a statisticsdatabase. When usage reports are disabled, the statistics are notcollected. The default is True (enabled).

max_history

Optional integer. The number of days after which usage statisticsare deleted from the statistics database. If the max_historyparameter is set to 0 (the default value), the statistics arepersisted forever.

Returns:

A JSON message indicating success.

list()list

Retrieves a list of reports on the server.

Returns:

A list of reports found.

quick_report(since:str='LAST_WEEK',queries:str='services/',metrics:str='RequestsFailed')dict

Generates an on the fly usage report for a service, services, or folder.SeeCreate Usage Reportfor full details on server reports.

Parameter

Description

since

Optional string. The time duration of the report. The supportedvalues are:

  • LAST_DAY represents a time range spanning the previous 24 hours.This is the default value.

  • LAST_WEEK represents a time range spanning the previous 7 days.

  • LAST_MONTH represents a time range spanning the previous 30 days.

  • LAST_YEAR represents a time range spanning the previous 365 days.

queries

Opitonal string. A string of resources for which to generate the report.Specified as a comma-separated sting of services or folders for which togather metrics.

  • services/ – Entire Site. The default.

  • services/Folder/ – Folder within a Site. Reports metricsaggregated across all services within that Folder and Sub-Folders.

  • services/Folder/ServiceName.ServiceType – Service in aspecified folder, for example:

    • services/Folder_Name/Map_bv_999.MapServer

    • services/Fodler_Name/ServiceName.ServiceType

  • rootfolder – Service in the root folder
    • Map_bv_999.MapServer.

# Example:>>>my_server.usage.quick_report(...queries="services/Hydroligic_Data/Lake_algae.FeatureServer,services/Mountains"...)

metrics

Optional string. Comma separated list of metrics to be reported.

Supported metrics are:

  • RequestCount – the number of requests received

  • RequestsFailed – the number of requests that failed

  • RequestsTimedOut – the number of requests that timed out

  • RequestMaxResponseTime – the maximum response time

  • RequestAvgResponseTime – the average response time

  • ServiceRunningInstancesMax – the maximum number of running service instances,sampled at one-minute intervals for a specified service.

Note

For ArcGIS Enterprise deployments at 11.0 and below, if you includeServiceRunningInstancesMax,it must be the only metric included in the report.

  • RequestAvgWaitTime— the average time all requests waited for an available instance

  • RequestMaxWaitTime— the maximum time a request waited for an available instance

  • RequestMinWaitTime— the minimum time a request waited for an available instance

# Example:>>>my_server.usage.quick_report(...metrics="RequestCount,RequestsFailed")
Returns:

A Python dictionary of data on a successful query.

# Usage Example:>>>gis=GIS(profile="my_own_portal",verify_cert=False)>>>gis_servers=gis.admin.servers.list()>>>srv=gis_servers[0]>>>query_string="services/Forests/Forests_degraded_2000.MapServer,services/Lakes/Lakes_drought_levels.MapServer">>>qk_report=srv.usage.quick_report(since="LAST_MONTH",queries=query_string,metrics="RequestCount,RequestsFailed")>>>qk_report{'report':{'reportname':'1fa828eb31664485ae5c25c76c86e28d','metadata':'{"temp":true,"title":"1fa828eb31664485ae5c25c76c86e28d","managerReport":false}','time-slices':[1598914800000,1599001200000,1599087600000,...1601420400000],'report-data':[[{'resourceURI':'services/Forests/Forests_degraded_2000.MapServer','metric-type':'RequestCount','data':[None,17,928,...20]},{'resourceURI':'services/Forests/Forests_degraded_2000.MapServer','metric-type':'RequestsFailed','data':[None,225,None,...0]},{'resourceURI':'services/Lakes/Lakes_drought_levels.MapServer','metric-type':'RequestCount','data':[0,0,7,...71]},{'resourceURI':'services/Lakes/Lakes_drought_levels.MapServer','metric-type':'RequestsFailed','data':[None,None,1...,0]}]]}}
propertysettings:dict

Gets the current usage reports settings. The usage reportssettings are applied to the entire site. When usagereports are enabled, service usage statistics are collected andpersisted to a statistics database. When usage reports aredisabled, the statistics are not collected. The intervalparameter defines the duration (in minutes) during which the usagestatistics are sampled or aggregated (in-memory) before beingwritten out to the statistics database. Database entries aredeleted after the interval specified in the max_history parameter (in days), unless the max_history parameter is 0, for which thestatistics are persisted forever.

DataStoreManager

classarcgis.gis.server.DataStoreManager(url:str,gis:GIS=None,**kwargs)

Bases:BaseServer

This resource provides information about the data holdings of theserver, as well as the ability to manage (add new items, update primarydata store, remove a data store item, etc) the data store. Data itemsare used by ArcGIS Pro, ArcGIS Desktop, and other clients to validate data pathsreferenced by GIS services.

Note

A relational data store type represents a database platform that has beenregistered for use on a portal’s hosting server by the ArcGIS Serveradministrator. Each relational data store type describes theproperties ArcGIS Server requires in order to connect to an instance ofa database for a particular platform. At least one registeredrelational data store type is required before client applications suchas Insights for ArcGIS can create Relational Database Connection portalitems.

Parameter

Description

url

Required string. The URL to the Data Store URL.

gis

Optional string. TheGIS,Server,orServicesDirectory object.

add(item:dict)Datastore

Registers a new data item with the data store.

Parameter

Description

item

Required String, Dict. The dictionary representing the data item.Seehttps://developers.arcgis.com/rest/enterprise-administration/server/dataitem.htm

Returns:

The data item if registered successfully, None otherwise.

add_bigdata(name:str,server_path:str|None=None,connection_type:str='fileShare')Datastore

Registers a bigdata fileshare with the data store.

Parameter

Description

name

Required string. The unique bigdata fileshare name on the server.

server_path

Optional string. The path to the folder from the server.

connection_type

Optional string. Allows for the setting of the types of big data store.The value ‘fileShare’ is used for local big data stores, and forcloud stores, the connection_type should be ‘dataStore’. The value‘fileShare’ is the default value.

Returns:

The big data fileshare if registered successfully, None otherwise.

add_cloudstore(name:str,conn_str:str,object_store:str,provider:str,managed:bool=False,folder:str|None=None)Datastore

Cloud Store data item represents a connection to a Amazon or Microsoft Azure store.Connection information for the data store item is stored within conn_str as astringified JSON. ArcGIS Server encrypts connection string for storage. Connectionstrings that are encrypted will include a {crypt} prefix. You can get a data storeitem with decrypted connection string by passing a decrypt=true parameter in the requestfor a data store item. Data store with decrypted connection string will be returned only forrequests made with https. The examples below show data stores with decrypted conn_str.A valid object_store (S3 bucket or Azure Blob store) is required. Folders within an objectstore are optional.

Parameter

Description

name

Required string. The name of the cloud store.

conn_str

Required string. The connection information for the cloud storageproduct.

object_store

Required string. This is the amazon bucket path or Azuze path.

provider

Required string. Values must be amazon or azure.

managed

Optional boolean. When the data store is server only, the databaseis entirely managed and owned by the server and cannot be accessedby the publisher directly. When this option is chosen, themanaged property should be set to true. Otherwise it is false.

folder

Optional string. For some Azure cloud stores, an optional foldercan be specified.

Returns:

Datastore object or None

add_database(name:str,conn_str:str,client_conn_str:str|None=None,conn_type:str='shared')Datastore

Registers a database with the data store.

Parameter

Description

name

Required string. The unique database name on the server.

conn_str

Required string. The path to the folder from the server (and client,if shared or serverOnly database)

client_conn_str

Optional string. The connection string for client to connect to replicated enterprise database>

conn_type

Optional string. The connection type. Default value is shared,other choices are replicated or serverOnly

Returns:

The data item if successfully registered, None otherwise.

add_folder(name:str,server_path:str,client_path:str|None=None)Datastore

Registers a folder with the data store.

Parameter

Description

name

Required string. The unique fileshare name on the server.

server_path

Required string. The path to the folder from the server (and client, if shared path).

client_path

Optional string. If folder is replicated, the path to the folder fromthe client; if folder is shared, don’t set this parameter.

Returns:

The data item if successfully registered, None otherwise.

add_object_store(name:str,conn_str:str,object_store:str,provider:str,folder:str|None=None)Datastore

Object-store data item represents a connection to a Amazon or Microsoft Azure store.

Parameter

Description

name

Required string. The name of the cloud store.

conn_str

Required string. The connection information for the cloud storageproduct.

object_store

Required string. This is the amazon bucket path or Azuze path.

provider

Required string. Values must be amazon or azure.

folder

Optional string. For some Azure cloud stores, an optional foldercan be specified.

Returns:

Datastore object or None

propertyconfig:dict

Gets the data store configuration properties. These propertiesaffect the behavior of the data holdings of the server. Forexample, the blockDataCopy property - when this property is false,or not set at all, copying data to the site when publishing servicesfrom a client application is allowed. This is the default behavior.When this property is true, the client application is not allowed tocopy data to the site when publishing. Rather, the publisher isrequired to register data items through which the service beingpublished can reference data. Values: true | false

This operation allows you to update the data store configurationYou can use this to allow or block the automatic copying of datato the server at publish time

Parameter

Description

config

Required string. A JSON string containing the data store configuration.

Returns:

JSON dictionary of the set configuration properties.

propertydata_items:dict

Gets the list of data items that are the root of all other data items in the data store.

federate_data_item(path:str)bool

This operation can be used to create a data store item in the portalfor a data store that has been registered with one of the portal’sfederated ArcGIS Server sites.

Once the operation is complete, a data store item is created in theportal with which the ArcGIS Server site is federated. If the datastore is registered with only this federated server, no furthersteps are required. However, if the data store is registered withmultiple federated servers and you want any of those servers toaccess the data store item, you need to bind the data store itemwith an additional federated server or servers using thePortalDataStore.register method.

Parameter

Description

path

Required string. The item path for the database, cloud, or fileshare data store for which you want to create a data store item.

Returns:

Boolean

generate_connection_string(sde:str)str

Converts an SDE connection file to a string with encrypted password.

Parameter

Description

sde

required string. Path to SDE connection file.

Returns:

string on success, None on failure

# Usage>>>con=dm.generate_connection_string("c:\myfolder\postgres_db.sde")>>>print(con)'ENCRYPTED_PASSWORD=************************;SERVER=localhost;INSTANCE=sde:postgresql:localhost,5432;DBCLIENT=postgresql;DB_CONNECTION_PROPERTIES=localhost,5432;DATABASE=esri_spatial;USER=sde;VERSION=sde.DEFAULT;AUTHENTICATION_MODE=DBMS'
get(path:str)Datastore

Retrieves the data item object at the given path.

Parameter

Description

path

Required string. The path to the data item.

Returns:

The data item object, None if not found.

get_relational_datastore_type(type_id:str)list

This resource lists the properties of a registered relational datastore of the given type. The properties returned are those that clientapplications must provide when creating a Relational DatabaseConnection portal item.

Note

This method only works if using ArcGIS Insights.

Parameter

Description

type_id

Required string. The datastore type ID of interest.SeeRelational Data Store Typesfor details.

Returns:

A JSON string listing the properties

get_total_refcount(path:str)dict

The total number of references to a given data itemthat exists on the server. You can use this operation todetermine if a data resource can be safely deleted, or takendown for maintenance.

Parameter

Description

path

Required string. The complete hierarchical path to the item.

Returns:

A JSON dictionary containing a number representing the total count.

list()list

Retrieves a list of datastore objects.

Returns:

The list ofDatastore objects.

make_datastore_machine_primary(item_name:str,machine_name:str)bool

Promotes a standby machine to the primary Data Store machine. Theexisting primary machine is downgraded to a standby machine.

Parameter

Description

item_name

Required string. The primary machine item name in the data store.

machine_name

Required string. The machine name of the machine to promote to primary.

Returns:

A boolean indicating success (True) or failure (False).

make_primary(datastore_name:str,machine_name:str)bool

Promotes a standby machine to the primary Data Store machine. Theexisting primary machine is downgraded to a standby machine.

Parameter

Description

datastore_name

Required string. The primary machine name in the data store.

machine_name

Required string. The machine name of the machine to promote to primary.

Returns:

A boolean indicating success (True) or failure (False).

propertyrelational_datastore_types:dict

Gets a list of the relational data store types that have beenregistered with the server. Each registered relational data storetype has both an id and a name property, as well as an array ofuserDefinedProperties, which indicates the properties clientapplications must provide when creating a Relational DatabaseConnection portal item. Only administrators can register andunregister a relational data store type. The following databaseplatforms are supported: SAP HANA, Microsoft SQL Server andTeradata.

remove_datastore_machine(item_name:str,machine_name:str)bool

Removes a standby machine from the Data Store. This operation isnot supported on the primary Data Store machine.

Parameter

Description

item_name

Required string. The standby machine item name in the data store.

machine_name

Required string. The machine name of the machine to remove.

Returns:

A boolean indicating success (True) or failure (False).

search(parent_path:str|None=None,ancestor_path:str|None=None,types:str|None=None,id:str|None=None,**kwargs)list

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.

Returns:

A JSON list of the items found matching the search criteria.

start(item_name:str,machine_name:str)bool

Starts the database instance running on the Data Store machine.

Parameter

Description

item_name

Required string. The database item name in the data store to start.

machine_name

Required string. The machine name of the machine with the databaseinstance to start.

Returns:

A boolean indicating success (True) or failure (False).

stop(item_name:str,machine_name:str)bool

Stop the database instance running on the Data Store machine.

Parameter

Description

item_name

Required string. The database item name in the data store to stop.

machine_name

Required string. The machine name of the machine with the databaseinstance to stop.

Returns:

A boolean indicating success (True) or failure (False).

validate()bool

Validates all the items in the data store.

Returns:

True if all items are valid.

validate_egdb(data_store_name:str,name:str)dict

Checks the status of the given ArcGIS Data Store and provides a health check response.

Parameter

Description

data_store_name

Required string. The item name of the data store.

name

Required string. The machine name of where the data store is.

Returns:

A JSON response containing general status information and an overall health report.

UserManager

classarcgis.gis.server.UserManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

This resource represents all users available in the user store that canadminister ArcGIS Server and access the GIS services hosted on theserver. As the user space could be potentially large, and there is not a listingof users, but you can use Get Users or Search operations to accesstheir account information.

ArcGIS Server is capable of connecting to your enterprise identitystores such as Active Directory or other directory services exposedthrough the LDAP protocol. Such identity stores are treated as readonly, and ArcGIS Server does not attempt to update them. As a result,operations that need to update the identity store (such as addingusers, removing users, updating users, assigning roles and removingassigned roles) are not supported when identity stores are read only.On the other hand, you could configure your ArcGIS Server to use thedefault identity store (shipped with the server) which is treated as aread-write store.

The total number of users are returned in the response.

Note

Typically, this resource must be accessed over an HTTPS connection.

create(username:str,password:str,fullname:str|None=None,description:str|None=None,email:str|None=None)dict

Adds a user account to the user store.

Parameter

Description

username

Required string. The name of the new user. The name must be uniquein the user store.

password

Optional string. The password for this user.

fullname

Optional string. A full name for this user.

description

Optional string. Provide comments or description for this user.

email

Optional string. An email for this user account.

Returns:

A JSON indicating success.

get(username:str)User

Finds a specific user.

Parameter

Description

username

Required string. The user to find.

Returns:

TheUser object or None.

propertyme:str

Gets the user object as the current logged in user. If the usernamecannot be found, for example, the site administrator account, thenjust the username is returned.

Returns:

TheUser object or username

propertyroles

Helper object to manage custom roles for users

Returns:

RoleManager object

search(username:str,max_results:int=25)list

You can use this operation to search a specific user or a group ofusers from the user store. The size of the search result can becontrolled with the max_results parameter.

Parameter

Description

username

Required string. The user or users to find.

max_results

Optional integer. The maximum number of users to return for thisquery. The default is 25.

Returns:

A list of users found.

RoleManager

classarcgis.gis.server.RoleManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

This resource represents all roles available in the role store. TheArcGIS Server security model supports a role-based access control inwhich each role can be assigned certain permissions (privileges) toaccess one or more resources. Users are assigned to these roles. Theserver then authorizes each requesting user based on all the rolesassigned to the user.

ArcGIS Server is capable of connecting to your enterprise identitystores such as Active Directory or other directory services exposed viathe LDAP protocol. Such identity stores are treated as read-only storesand ArcGIS Server does not attempt to update them. As a result,operations that need to update the role store (such as adding roles,removing roles, updating roles) are not supported when the role storeis read-only. On the other hand, you can configure your ArcGIS Serverto use the default role store shipped with the server, which istreated as a read-write store.

all(start_index:int=0,page_size:int=10)list

This operation gives you a pageable view of roles in the rolestore. It is intended for iterating through all available roleaccounts. To search for specific role accounts instead, use theSearch Roles operation.

Parameter

Description

start_index

Optional integer. The starting index (zero-based) from the roleslist to be returned in the result page. The default is 0.

page_size

Optional integer. The maximum number of roles to return in theresult page. The default size is 10.

Returns:

A JSON dictionary containing the list of roles found and a boolean on if there are more roles.

propertycount:dict

Gets the number of roles for ArcGIS Server.

create(name:str,description:str|None=None)bool

Adds a role to the role store. This operation is available onlywhen the role store is a read-write store such as the defaultArcGIS Server store.

If the name of the role exists in the role store, an error willbe returned.

Parameter

Description

name

Required string. The name of the new role. The name must be uniquein the role store.

description

Optional string. Provide comments or description for the role.

Returns:

A JSON message as dictionary

get_role(role_id:str|None=None,max_count:int=10)list

Use this operation to search a specific role or a groupof roles from the role store.

Parameter

Description

role_id

Optional string. A filter string to search for the roles

max_count

Optional integer. The maximum number of the result items that canbe retuned. The default is 10.

Returns:

A JSON message as dictionary.

SystemManager

classarcgis.gis.server.SystemManager(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

The System resource is a collection of miscellaneous server-wideresources such as server properties, server directories, theconfiguration store, Web Adaptors, and licenses.

clear_cache()bool

This operation clears the cache on all REST handlers in the system.While the server typically manages the REST cache for you, use thisoperation to get explicit control over the cache.

Returns:

A boolean indicating success (True).

propertyconfiguration_store:ConfigurationStore

Gets the ConfigurationStore object for this site.

Returns:

ConfigurationStore

propertydeployment:dict

Gets the load balancing value for this site. Load balancing is anArcGIS Server deployment configuration resource that cancontrol the load balancing functionality between GIS servermachines. A value of True means that load balancing is disabled.

singleClusterMode - At 10.4, in large sites with a single cluster,the site is configured to prevent load balancing between GISserver machines. This reduces network traffic between machinesin the site and helps reduce load on your network. Upgradesfrom earlier versions will set this property to true if thesite uses a single cluster. Sites with multiple clusters cannotuse singleClusterMode.

To prevent load balancing, the following criteria must be met:

  • All machines in the site must participate in a singlecluster. Multiple clusters cannot exist.

  • An external load balancer or ArcGIS Web Adaptor must beconfigured to forward requests to the site. If no externalgateway exists, requests will only be handled by themachine designated in the request.

To enable load balancing, set this property to false. Updatingthis property will restart all machines in the site.

propertydirectories:DirectoryManager
Returns:

TheServerDirectory object in a list.

propertyhandlers:dict

Gets the handler of this server. A handler exposes the GIS capabilities of ArcGIS Server through aspecific interface/API. There are two types of handlers currentlyavailable in the server:

  • Rest – Exposes the REST-ful API

  • Soap – Exposes the SOAP API

The Rest Handler resource exposes some of the administrativeoperations on the REST handler such as clearing the cache.

propertyjobs:Jobs

Gets the Jobs object.

Returns:

Jobs object

propertylicenses:dict

Gets the license resource list. The licenses resource lists thecurrent license level of ArcGIS for Server and all authorizedextensions. Contact Esri Customer Service if you have questionsabout license levels or expiration properties.

propertyplatform_services:PlatformServiceManager

Provides access to the platform services that are associated with GeoAnalytics.

propertyrest_handler:dict

Gets a list of resources accessible throught the REST API.

propertyserver_properties:ServerProperties

Gets the server properties for the site as an object.

Returns:

ServerProperties object

propertysoap_config:dict

Thesoap_config resource lists the URLs for domains allowed tomake cross-domain requests, including SOAP and OGC service requests.If the value fororigins is not updated, no restrictions oncross-domain requests will be made.

Theset operation allows you to restrict cross-domain requests tospecific domains, including SOAP and OGC service requests. By default,no domains are restricted.

Parameter

Description

origins

Optional String. A comma-separated list of URLs of domains allowedto make requests. The default value,*, denotes all domains, meaningnone are restricted.

Returns:

dict

unregister_webadaptor(wa_id:str)bool

Unregistering a Web Adaptor removes the Web Adaptor from the ArcGISServer’s trusted list. The Web Adaptor can no longer submit requeststo the server.

Parameter

Description

wa_id

Required string. The web adaptor ID.

Returns:

A boolean indicating success (True).

update_web_adaptor(wa_id:str,description:str,http_port:int,https_port:int)bool

This operation allows you to update the description, HTTP port, andHTTPS port of a Web Adaptor that is registered with the server.

Note

This operation is only meant to change the descriptive propertiesof the Web Adaptor and does not affect the configuration of the webserver that deploys your Web Adaptor.

Parameter

Description

wa_id

Required string. The web adaptor ID.

description

Required string. A description of this web adaptor.

http_port

Required integer. The HTTP port of the web server.

https_port

Required integer. The HTTPS (SSL) port of the web server that runsthe web adaptor.

Returns:

A boolean indicating success (True), else a Python dictionary containing an error message.

update_web_adaptors_configuration(config:str)bool

You can use this operation to change the Web Adaptor configurationand the sharedkey attribute. The sharedkey attribute must be presentin the request.

Parameter

Description

config

Required string. The configuration items to be updated for this webadaptor. Always include the web adaptor’s sharedkey attribute.

Returns:

A boolean indicating success (True), else a Python dictionary containing an error message.

propertyweb_adaptors:dict

Gets a list of all the Web Adaptors that have been registeredwith the site. The server will trust all these Web Adaptors andwill authorize calls from these servers.

To configure a new Web Adaptor with the server, you’ll need to usethe configuration web page or the command line utility. For fullinstructions, see Configuring the Web Adaptor after installation.

propertyweb_adaptors_configuration:dict

Gets the Web Adaptors configuration which is a resource of all theconfiguration parameters shared across all the Web Adaptors in thesite. Most importantly, this resource lists the shared key that isused by all the Web Adaptors to encrypt key data bits for theincoming requests to the server.

SiteManager

classarcgis.gis.server.SiteManager(server:Server,initialize:bool=False)

Bases:object

A site is a collection of server resources. This collection includesserver machines that are installed with ArcGIS Server, including GISservices, data and so on. The site resource also lists the currentversion of the software.When you install ArcGIS Server on a server machine for the first time,you must create a new site. Subsequently, newer server machines canjoin your site and increase its computing power. Once a site is nolonger required, you can delete the site, which will cause all ofthe resources to be cleaned up.

Parameter

Description

server

Required string. The arcgis.gis.server object.

staticcreate(username:str,password:str,config_store_connection:str,directories:str,cluster:str|None=None,logs_settings:str|None=None,run_async:bool=False,**kwargs)

This is the first operation that you must invoke when you installArcGIS Server for the first time. Creating a new site involves:

  • Allocating a store to save the site configuration

  • Configuring the server machine and registering it with the site

  • Creating a new cluster configuration that includes the server machine

  • Configuring server directories

  • Deploying the services that are marked to auto-deploy

Because of the sheer number of tasks, it usually takes some timefor this operation to complete. Once a site has been created,you can publish GIS services and deploy them to your servermachines.

Parameter

Description

url

Required string. URI string to the site.

username

Required string. The name of the administrative account to be used bythe site. This can be changed at a later stage.

password

Required string. The password to the administrative account.

configStoreConnection

Required string. A JSON object representing the connection to theconfiguration store. By default, the configuration store will bemaintained in the ArcGIS Server installation directory.

directories

Required string. A JSON object representing a collection of serverdirectories to create. By default, the server directories will becreated locally.

cluster

Optional string. An optional cluster configuration. By default, thesite will create a cluster called ‘default’ with the first availableport numbers starting from 4004.

logsSettings

Optional string. Optional log settings, seehttps://developers.arcgis.com/rest/enterprise-administration/server/logssettings.htm .

run_async

Optional boolean. A flag to indicate if the operation needs to be run

asynchronously.

Optional Argument

Description

baseurl

Optional string. The root URL to a site.Example:https://mysite.example.com/arcgis

tokenurl

Optional string. Used when a site is federated or when the tokenURL differs from the site’s baseurl. If a site is federated, thetoken URL will return as the Portal token and ArcGIS Server userswill not validate correctly.

username

Optional string. The login username when using built-in ArcGIS Server security.

password

Optional string. The password for the specified username.

key_file

Optional string. The path to PKI key file.

cert_file

Optional string. The path to PKI cert file.

proxy_host

Optional string. The web address to the proxy host.

Example:proxy.mysite.com

proxy_port

Optional integer. The port where the proxy resides on, default is 80.

expiration

Optional integer. This is the length of time a token is valid for.Example 1440 is one week. The Default is 60.

all_ssl

Optional boolean. If True, all calls will be made over HTTPS insteadof HTTP. The default is False.

portal_connection

Optional string. This is used when a site is federated. It is theArcGIS Enterprise portal GIS object representing the portal managing the site.

initialize

Optional boolean. If True, the object will attempt to reach out tothe URL resource and populate at creation time. The default is False.

Returns:

Success statement.

delete()dict

Deletes the site configuration and releases all server resources.This operation is well suitedfor development or test servers that need to be cleaned upregularly. It can also be performed prior to uninstall. Use cautionwith this option because it deletes all services, settings, andother configurations.

This operation performs the following tasks:

  • Stops all server machines participating in the site. This inturn stops all GIS services hosted on the server machines.

  • All services and cluster configurations are deleted.

  • All server machines are unregistered from the site.

  • All server machines are unregistered from the site.

  • The configuration store is deleted.

Note

This is an unrecoverable operation!

Returns:

A status indicating success or failure.

export(location:str|None=None)dict

Exports the site configuration to a location you specify as inputto this operation.

Parameter

Description

location

Optional string. A path to a folder accessible to the serverwhere the exported site configuration will be written. If a locationis not specified, the server writes the exported site configurationfile to directory owned by the server and returns a virtual path(an HTTP URL) to that location from where it can be downloaded.

Returns:

A status indicating success (along with the folder location) or failure.

import_site(location:str)dict

This operation imports a site configuration into the currentlyrunning site. Importing a site means replacing all siteconfigurations (including GIS services, security configurations,and so on) of the currently running site with those contained inthe site configuration file you supply as input. The input siteconfiguration file can be obtained through the exportSiteoperation.

This operation will restore all information included in the backup,as noted in exportSite. When it is complete, this operation returnsa report as the response. You should review this report and fix anyproblems it lists to ensure your site is fully functioning again.The importSite operation lets you restore your site from a backupthat you created using the exportSite operation.

Parameter

Description

location

Required string. A file path to an exported configuration or an IDreferencing the stored configuration on the server.

Returns:

A status indicating success (along with site details) or failure.

join(admin_url:str,username:str,password:str)dict

The Join Site operation is used to connect a server machine to anexisting site. This is considered a ‘push’ mechanism, in which aserver machine pushes its configuration to the site. For theoperation to be successful, you need to provide an account withadministrative privileges to the site.When an attempt is made to join a site, the site validates theadministrative credentials, then returns connection informationabout its configuration store back to the server machine. Theserver machine then uses the connection information to work withthe configuration store.If this is the first server machine in your site, use the CreateSite operation instead.

Parameter

Description

admin_url

Required string. The site URL of the currently live site. This istypically the Administrator Directory URL of one of the servermachines of a site.

username

Required string. The name of an administrative account for the site.

password

Required string. The password of the administrative account.

Returns:

A status indicating success or failure.

propertyproperties:dict

Gets the site properties.

propertypublic_key:dict

Returns the public key of the server that can be used by a clientapplication (or script) to encrypt data sent to the server using theRSA algorithm for public-key encryption. In addition to encryptingthe sensitive parameters, the client is also required to send tothe server an additional flag encrypted with value set to true. Asthe public key for the server can be changed at a later time, theclient must fetch it on each request before encrypting the datasent to the server.

Returns:

dict

upgrade(run_async:bool=False)dict

This is the first operation that must be invoked during an ArcGISServer upgrade. Once the new software version has been installedand the setup has completed, this operation will be available. Asuccessful run of this operation will complete the upgrade ofArcGIS Server.

Note

If errors are returned with the upgrade operation, you must addressthe errors before you can continue. For example, if you encounteran error about an invalid license, you will need to re-authorizethe software using a valid license and you may then retry thisoperation.

This operation is available only when a server machine is currentlybeing upgraded. It will not be available after a successful upgradeof a server machine.

Parameter

Description

run_async

Required string. A flag to indicate if the operation needs to be runasynchronously. The default value is False.

debug

Optional Boolean. Introduced at 11.0. This parameter sets the loglevel for the upgrade process. If true, the log level is set toDEBUG during the upgrade, which can aid in troubleshooting issuesrelated to the upgrade process. If false, the log level is set toVERBOSE during the upgrade process. The default value is false.

Returns:

A status indicating success or failure.

TypesManager

classarcgis.gis.server.TypesManager(uploads:Uploads,url:str,session:EsriSession)

Bases:object

The types resource provides metadata about all service types andextensions that can be enabled on each service type. The servicesframework uses this information to validate a service and construct thevarious objects in the service. The metadata contains identifiers foreach object, a default list of capabilities, properties, and otherresource information (like WSDL and so forth). Type information for aspecific service type can be accessed by appending the type name tothis URL.

propertyextension:ExtensionManager

The extensions resource is a collection of all the custom serverobject extensions that have been uploaded and registered with theserver. You can register new server object extensions using theRegister Extension operation. When updating an existing extension,you need to use the Update Extension operation. If an extension isno longer required, you can use the Unregister operation to removethe extension from the site.

propertyproperties:dict[str,Any]

returns the types properties

propertyprovider:ProvidersManager

The providers resource returns the supported provider types for theGIS services in your organization. Starting at ArcGIS Enterprise10.9.1, this resource includes an enabled providers section thatspecifies which of the supported providers are currently enabled.At Enterprise 11.0, only ArcObjects11 is supported as an enabledprovider.

session:EsriSession|None=None
uploads:Uploads
url:str|None=None

ProvidersManager

classarcgis.gis.server.ProvidersManager(url:str,session:EsriSession)

Bases:object

The providers resource returns the supported provider types for theGIS services in your organization. Starting at ArcGIS Enterprise10.9.1, this resource includes an enabled providers section thatspecifies which of the supported providers are currently enabled.At Enterprise 11.0, only ArcObjects11 is supported as an enabledprovider.

get(provider:str)dict[str,Any]

Returns the supported services for a given provider

Parameter

Description

provider

Required String. The single provider to return supported serviceinformation on. The registered providers can be obtained from theproperties property. The provider types will vary based on yourversion of ArcGIS Server.

Returns:

dict

propertyproperties:dict[str,Any]

returns the properties of the endpoint.

session:EsriSession
url:str

ExtensionManager

classarcgis.gis.server.ExtensionManager(url:str,session:EsriSession,um:Uploads)

Bases:object

Manages the Service Extension Objects

propertyextensions:Iterable[RegisteredExtension]

returns all the registered extensions

propertyproperties:dict[str,Any]

returns the properties of the extension

register(file_path:str)bool

Registers a new extension

Parameter

Description

file_path

Required str. The path to the SOI/SOE zipped file.

Returns:

dict

session:EsriSession
url:str

RegisteredExtension

classarcgis.gis.server.RegisteredExtension(url:str,session:EsriSession,extension_name:str,properties:dict[str,Any],upload:Uploads)

Bases:object

Represents a single SOE or SOI deployment.

delete()bool

Removes the extension from the server

extension_name:str|None=None
propertyname:str

returns the SOI/SOE name

propertyproperties:dict[str,Any]

returns the properties of the extension

session:EsriSession|None=None
update(file_path:str)bool

updates the extension

url:str|None=None

DirectoryManager

classarcgis.gis.server.DirectoryManager(system)

Bases:object

A collection of all the server directories is listed under thisresource.

You can add a new directory using the Register Directory operation. Youcan then configure GIS services to use one or more of thesedirectories. If you no longer need the server directory, you mustremove the directory by using the Unregister Directory operation.

add(name:str,physicalPath:str,directoryType:str,maxFileAge:int,cleanupMode:str='NONE',description:str|None=None)bool

Registers a new server directory. While registering the serverdirectory, you can also specify the directory’s cleanup parameters.

Parameter

Description

name

Required string. The name of the server directory.

physical_path

Required string. The absolute physical path of the server directory.

directory_type

Required string. The type of server directory.

max_age

Required integer. The length of time a file in the directory needsto be kept before it is deleted.

cleanup_mode

Optional string. Defines if files in the server directory needs tobe cleaned up. The default is None.

description

Optional string. An optional description for the server directory.The default is None.

Returns:

A boolean indicating success (True).

all()list

Provides a configuration of this server directory.Server directories are used by GIS services as a location to outputitems such as map images, tile caches, and geoprocessing results.In addition, some directories contain configurations that power theGIS services.

Returns:

A dictionary of this server directory configuration properties.

edit_services_directory(allowedOrigins:str,arcgis_com_map:str,arcgis_com_map_text:str,jsapi_arcgis:str,jsapi_arcgis_css:str,jsapi_arcgis_css2:str,jsapi_arcgis_sdk:str,serviceDirEnabled:str)bool

Allows you to update the Services Directory configuration. You can do such thing asenable or disable the HTML view of ArcGIS REST API, or adjust the JavaScript and map viewerpreviews of services in the Services Directory so that they work with your own locallyhosted JavaScript API and map viewer.

Parameter

Description

allowed_origins

Required string. A comma-separated list of URLs of domains allowed tomake requests. An asterisk (*) can be used to denote all domains.

arcgis_com_map

Required string. URL of the map viewer application used for servicepreviews. Defaults to the ArcGIS.com map viewer but could be usedto point at your own Portal for ArcGIS map viewer.

arcgis_com_map_text

Required string. The text to use for the preview link that opensthe map viewer.

jsapi_arcgis

Required string. The URL of the JavaScript API to use for servicepreviews. Defaults to the online ArcGIS API for JavaScript, butcould be pointed at your own locally-installed instance of theJavaScript API.

jsapi_arcgis_css

Required string. The CSS file associated with the ArcGIS API forJavaScript. Defaults to the online Dojo tundra.css.

jsapi_arcgis_css2

Required string. An additional CSS file associated with the ArcGISAPI for JavaScript. Defaults to the online esri.css.

jsapi_arcgis_sdk

Required string. The URL of the ArcGIS API for JavaScript help.

service_dir_enabled

Required string. Flag to enable/disable the HTML view of theservices directory.

Returns:

A boolean indicating success (True).

get(name:str)dict

Retrieves a single directory registered with ArcGIS Server.

Parameter

Description

name

Required string. The name of the registered directory.

Returns:

The ArcGIS ServerServerDirectory object

propertyproperties:dict

returns the current service directory properties for the server.

Returns:

Dict

ConfigurationStore

classarcgis.gis.server.ConfigurationStore(url:str,connection:Connection,initialize:bool=False)

Bases:BaseServer

A utility class for managing the Configuration Store of this server.

edit(type_value:str,connection:GIS,move:bool=True,run_async:bool=False,*,local_path:str|None=None)bool

You can use this operation to update the configuration store.Typically, this operation is used to change the location of theconfiguration store.

When ArcGIS Server is installed, the default configuration storeuses local paths. As the site grows (more server machines areadded), the location of the store must be updated to use a sharedfile system path. On the other hand, if you know at the onset thatyour site will have two or more server machines, you can start froma shared path while creating a site and skip this step altogether.

Parameter

Description

type_value

Required string. The type of the configuration store. Values: FILESYSTEM

gis

Required string. A file path or connection URL to the physicallocation of the store.

move

Optional string. A boolean to indicate if you wantto move the content of the current store to the new store. Thedefault True (move the content).

run_async

Optional string. Determines if this operation must run asynchronously.The default is False (doesn not have to run asynchronously).

local_path

Optional String. A file path or connection URL to the physicallocation of the local repository for when the site is in read-onlymode.

Returns:

A boolean indicating success (True).

recover()dict

Recovers the Configuration Store of the site.

If the shared configuration store for a site is unavailable, a sitein read-only mode will operate in a degraded capacity that allowsaccess to the ArcGIS Server Administrator Directory. You can recovera site if the shared configuration store is permanently lost. Thesite must be in read-only mode, and the site configuration filesmust have been copied to the local repository when switching sitemodes. The recover operation will copy the configuration store fromthe local repository into the shared configuration store location.The copied local repository will be from the machine in the sitewhere the recover operation is performed.

Returns:

A boolean indicating success (True).

Jobs

classarcgis.gis.server.Jobs(url:str,connection:Connection,initialize:bool=False)

Bases:BaseServer

This resource is a collection of all the administrative jobs(asynchronous operations) created within your site. When operationsthat support asynchronous execution are run, the server creates a newjob entry that can be queried for its current status and messages.

get(job_id:str)dict

A job represents the asynchronous execution of an operation. Youcan acquire progress information by periodically querying the job.

Parameter

Description

job_id

Required string. The ID of the job.

Returns:

A JSON dictionary containing progress information for the job ID.

propertyjobs:list

Gets the job IDs.

ServerDirectory

classarcgis.gis.server.ServerDirectory(url:str,connection:Connection,initialize:bool=False)

Bases:BaseServer

Server directories are used by GIS services as a location to outputitems such as map images, tile caches, and geoprocessing results. Inaddition, some directories contain configurations that power the GISservices.In a Site with more than one server machine these directories must beavailable on network shares, accessible to every machine in the site.

The following directory types can be registered with the server:

  • Output – Stores various information generated by services, such as mapimages. Instances: One or more

  • Cache – Stores tile caches used by map, globe, and image services forrapid performance. Instances: One or more

  • Jobs – Stores results and other information from geoprocessingservices. Instances: One or more

  • System – Stores files that are used internally by the GIS server.Instances: One

Server directories that contain output of various GISservices can be periodically cleaned to remove old unused files. Byusing the cleanup mode and maximum file age parameters, you controlwhen when you would like the files in these directories to becleaned.

All the output server directories are automatically virtualized (theycan be accessed over a URL) for you through the ArcGIS Server REST API.

clean()bool

Cleans the content (files and folders) within the directory thathave passed their expiration date. Every server directory has themax file age and cleanup mode parameter that govern when a filecreated inside is supposed to be cleaned up. The server directorycleaner automatically cleans up the content within serverdirectories at regular intervals. However, you can explicitly cleanthe directory by invoking this operation.

Returns:

A boolean indicating success (True).

edit(physical_path:str,cleanup_mode:str,max_age:int,description:str,*,use_local_dir:bool|None=None,local_dir:str|None=None)

The server directory’s edit operation allows you to change the pathand clean up properties of the directory. This operation updatesthe GIS service configurations (and points them to the new path)that are using this directory, causing them to restart. It istherefore recommended that any edit to the server directories beperformed when the server is not under load.

This operation is mostly used when growing a single machine site toa multiple machine site configuration, which requires that theserver directories and configuration store be put on anetwork-accessible file share.

Parameter

Description

physical_path

Required string. The absolute physical path of the server directory.

cleanup_mode

Optional string. Defines if files in the server directory needs tobe cleaned up. The default is None.

max_age

Required integer. The length of time a file in the directory needsto be kept before it is deleted.

description

Optional string. An optional description for the server directory.The default is None.

use_local_dir

Optional Boolean. WhenTrue the local directory will be used tostore results. This is useful forHA configurations to reducecopying over the local network. The directory must exist on theserver already.

local_dir

Optional String. The local directory path to be used for the service.

Returns:

A boolean indicating success (True).

recover()dict

Recovers the shared server directories of the site.

If the shared server directories for a site are unavailable, a sitein read-only mode will operate in a degraded capacity that allowsaccess to the ArcGIS Server Administrator Directory. You can recovera site if the shared server directories are permanently lost. Thesite must be in read-only mode, and the site configuration filesmust have been copied to the local repository when switching sitemodes. The recover operation will copy the server directories fromthe local repository into the shared server directories location.The copied local repository will be from the machine in the sitewhere the recover operation is performed.

Returns:

A boolean indicating success (True).

unregister()bool

Unregisters a server directory. Once a directory has beenunregistered, it can no longer be referenced (used) from within aGIS service.

Returns:

A boolean indicating success (True).

ServerProperties

classarcgis.gis.server.ServerProperties(url:str,connection:Connection,initialize:bool=False)

Bases:BaseServer

The Server has configuration parameters that can govern some of itsintricate behavior. This Server Properties resource is a container forsuch properties. These properties are available to all server objectsand extensions through the server environment interface.

The properties include:

  • CacheSizeForSecureTileRequests – An integer that specifies thenumber of users whose token information will be cached. Thisincreases the speed of tile retrieval for cached services. If notspecified, the default cache size is 200,000. Both REST and SOAPservices honor this property. You’ll need to manually restartArcGIS Server in order for this change to take effect.

  • DisableAdminDirectoryCache – Disables browser caching of theAdministrator Directory pages. The default is False. To disablebrowser caching, set this property to True.

  • disableIPLogging – When a possible cross-site request forgery(CSRF) attack is detected, the server logs a message containingthe possible IP address of the attacker. If you do not want IPaddresses listed in the logs, set this property to True. Also,HTTP request referrers are logged at FINE level by the REST andSOAP handlers unless this property is set to True.

  • javaExtsBeginPort – Specifies a start port of the port range usedfor debugging Java server object extensions.Example:8000

  • javaExtsEndPort – Specifies an end port of the port range used fordebugging Java server object extensions.Example:8010

  • localTempFolder – Defines the local folder on a machine that canbe used by GIS services and objects. If this property is notexplicitly set, the services and objects will revert to using thesystem’s default temporary directory.

    Note

    If this property is used, you must create the temporary directoryon every server machine in the site. Example: /tmp/arcgis.

  • messageFormat – Defines the transmission protocol supported bythe services catalog in the server.

    Values:- esriServiceCatalogMessageFormatBin,- esriServiceCatalogMessageFormatSoap,- esriServiceCatalogMessageFormatSoapOrBin

  • messageVersion – Defines the version supported by the servicescatalog in the server.Example: esriArcGISVersion101

  • PushIdentityToDatabase – Propogates the credentials of the logged-inuser to make connections to an Oracle database. Thisproperty is only supported for use with Oracle databases.Values: True | False

  • suspendDuration – Specifies the duration for which the ArcGISservice hosting processes should suspend at startup. Thisduration is specified in milliseconds. This is an optionalproperty that takes effect when suspendServiceAtStartup is setto True. If unspecified and suspension of service at startup isrequested, then the default suspend duration is 30 seconds.Example: 10000 (meaning 10 seconds)

  • suspendServiceAtStartup – Suspends the ArcGIS service hostingprocesses at startup. This will enable attaching to thoseprocesses and debugging code that runs early in the lifecycle ofserver extensions soon after they are instantiated.Values: True | False

  • uploadFileExtensionWhitelist – This specifies what files areallowed to be uploaded through the file upload API byidentifying the allowable extensions. It is a list of comma-separatedextensions without dots. If this property is notspecified, a default list is used. This is the default list: soe,sd, sde, odc, csv, txt, zshp, kmz, and geodatabase.

    Note

    Updating this list overrides the default list completely. Thismeans if you set this property to a subset of the default listthen only those items in the subset will be accepted for upload.Example: sd, so, sde, odc.

  • uploadItemInfoFileExtensionWhitelist – This specifies what filesare allowed to be uploaded through the service iteminfo uploadAPI by identifying the allowable extensions. It should be a listof comma-separated extensions without dots. If this property isnot specified, a default list is used. This is the default list:xml, img, png, gif, jpg, jpeg, bmp.

    Note

    This list overrides the default list completely. This means if youset this property to a subset of the default list then only thoseitems in the subset will be accepted for upload. Example: png, svg,gif, jpg, tiff, bmp.

  • WebContextURL – Defines the web front end as seen by your users.Example:http://mycompany.com/gis

update(properties:str)bool

This operation allows you to update the server properties. See the ServerPropertiesclass description for all possible properties.

Parameter

Description

properties

Required string. A Python dictionary of server properties to be updated.To reset the properties, pass inNone.

Returns:

A boolean indicating success (True).

ItemInformationManager

classarcgis.gis.server.ItemInformationManager(url:str,con:Connection)

Bases:BaseServer

The item information resource stores metadata about a service.Typically, this information is available to clients that want to indexor harvest information about the service.

Item information is represented in JSON. The propertyproperties allowsusers to access the schema and see the current format of the JSON.

delete()bool

Deletes the item information.

Returns:

Boolean

propertymanifest:dict

The service manifest resource documents the data and other resourcesthat define the service origins and power the service. This resourcewill tell you underlying databases and their location along withother supplementary files that make up the service.

The JSON representation of the manifest has the following two sections:

Databases

  • byReference - Indicates whether the service data is referenced from a registered folder or database (true) or it was copied to the server at the time the service was published (false).

  • onPremiseConnectionString - Path to publisher data location.

  • onServerConnectionString - Path to data location after publishing completes.

When both the server machine and the publisher’s machine are usingthe same folder or database, byReference is true and theonPremiseConnectionString and onServerConnectionString propertieshave the same value.

When the server machine and the publisher machine are usingdifferent folders or databases, byReference is true and theonPremiseConnectionString and onServerConnectionString propertieshave different values.

When the data is copied to the server automatically at publish time,byReference is false.

Resources

  • clientName - Machine where ArcGIS Pro or ArcGIS Desktop was used to publish the service.

  • onPremisePath - Path, relative to the ‘clientName’ machine, where the source resource (.mxd, .3dd, .tbx files, geodatabases, and so on) originated.

  • serverPath - Path to the document after publishing completes.

Returns:

Dict

propertyproperties:dict

Gets/Sets the Item Information for a serivce.

Returns:

Dict

upload(info_file:str,folder:str|None=None)dict

Uploads a file associated with the item information to the server.

Parameter

Description

info_file

Required String. The file to upload to the server.

folder

Optional String. The name of the folder on the server to which thefile must be uploaded.

Returns:

Dict

JobManager

classarcgis.gis.server.JobManager(url:str,con:Connection)

Bases:BaseServer

TheJobManager provides operations to locate, monitor, and intervenein current asynchronous jobs being run by the geoprocessing service.

purge()dict

The methodpurge cancels all asynchronous jobs for thegeoprocessing service that currently carry a status of NEW,SUBMITTED, or WAITING.

Returns:

Boolean

search(start_time:datetime=None,end_time:datetime=None,status:str|None=None,username:str|None=None,machine:str|None=None)Job

This operation allows you to query the current jobs for ageoprocessing service, with a range of parameters to find jobs thatmeet specific conditions.

Parameter

Description

start_time

Optional Datetime. The start date/time of the geoprocessing job.

end_time

Optional Datetime. The end date/time of the geoprocessing job.

status

Optional String. The current status of the job. The possiblestatuses are as follows:

  • esriJobNew

  • esriJobSubmitted

  • esriJobExecuting

  • esriJobSucceeded

  • esriJobFailed

  • esriJobCancelling

  • esriJobCancelled

  • esriJobWaiting

username

Optional String. The ArcGIS Server user who submitted the job. Ifthe service is anonymous, this parameter will be unavailable.

machine

Optional String. The machine running the job.

Returns:

List of geoprocessing servicejobs

Job

classarcgis.gis.server.Job(url:str,con:GIS)

Bases:BaseServer

AJob represents the asynchronous execution of an operation by ageoprocessing service.

cancel()bool

Cancels the current job from the server

Returns:

Boolean

delete()bool

Deletes the current job from the server

Returns:

Boolean

Mode

classarcgis.gis.server.Mode(url:str,gis:GIS,initialize:bool=False)

Bases:BaseServer

ArcGIS Server site mode that allows you to control changes to your site.You can set the site mode to READ_ONLY to disallow the publishing of newservices and block most administrative operations. Your existing serviceswill continue to function as they did previously. Note that certainadministrative operations such as adding and removing machines from asite are still available in READ_ONLY mode.

update_mode(site_mode:str,run_async:bool=False,allow_editing:bool=True)bool

The update operation is used to move between the two types of sitemodes. Switching to READ_ONLY mode will restart all your servicesas the default behavior. Moving to EDITABLE mode will not restartservices.

Parameter

Description

site_mode

Required string. The mode you will set your site to. Values:READ_ONLY or EDITABLE.

run_async

Optional boolean. Determines if this operation must run asynchronously.

allow_editing

Optional boolean. Specifies if edits to feature services are allowedwhile a Server is in read-only mode. The default value is true.

Returns:

Boolean

ServiceWebHook

classarcgis.gis.server.ServiceWebHook(url:str,gis:GIS|Connection,initialize:bool=False,**kwargs)

Bases:BaseServer

The webhooks resource returns a list of service webhooks configuredfor a specific geoprocessing or feature service, includingdeactivated and activated webhooks. Webhooks are an ArcGISEnterprise capability that provide other applications or webhookreceivers with event-driven information, delivered as an HTTPS POSTrequest, that can be used to create automated and integrativeworkflows. For more information on how webhooks are supported inArcGIS Enterprise, see Webhooks in ArcGIS Enterprise.

delete()bool

Deletes the current webhook from the system

Returns:

Boolean, True if successful

edit(*,name:str|None=None,change_types:WebHookEvents|str|None=None,hook_url:str|None=None,signature_key:str|None=None,active:bool|None=None,schedule_info:WebHookScheduleInfo|dict[str,Any]|None=None,payload_format:str|None=None,content_type:str|None=None)dict[str,Any]

Updates the existing WebHook’s Properties.

Parameter

Description

name

Optional String. Use valid name for a webhook. This name needs to be unique per service.

hook_url

Optional String. The URL to which the payloads will be delivered.

change_types

OptionalWebHookEvents or String.The default is “*”, which means all events. This is acomma separated list of values that will fire off the web hook. The listeach supported type is below.

signature_key

Optional String. If specified, the key will be used in generating the HMAChex digest of value using sha256 hash function and is return in thex-esriHook-Signature header.

active

Optional bool. Enable or disable call backs when the webhook is triggered.

schedule_info

OptionalWebHookScheduleInfo or Dict.Allows the trigger to be used as a given schedule.

Example Dictionary:

{
“name” : “Every-5seconds”,
“startAt” : 1478280677536,
“state” : “enabled”,
“recurrenceInfo” : {
“frequency” : “second”,
“interval” : 5
}
}

payload_format

Optional String. The payload can be sent in pretty format or standard.The default isjson.

content_type

Optional String. The Content Type is used to indicate the media type of theresource. The media type is a string sent along with the file indicatingthe format of the file.

A list of allowed web hook triggers is shown below.

Name

Triggered When

*

Wildcard event. Any time any event is triggered.

FeaturesCreated

A new feature is created

FeaturesUpdated

Any time a feature is updated

FeaturesDeleted

Any time a feature is deleted

FeaturesEdited

Any time a feature is edited (insert or update or delete)

AttachmentsCreated

Any time adding a new attachment to a feature

AttachmentsUpdated

Any time updating a feature attachment

AttachmentsDeleted

Any time an attachment is deleted from a feature

LayerSchemaChanged

Any time a schema is changed in a layer

LayerDefinitionChanged

Any time a layer definition is changed

FeatureServiceDefinitionChanged

Any time a feature service is changed

Returns:

Response of edit as a dict.

ServiceWebHookManager

classarcgis.gis.server.ServiceWebHookManager(url:str,con:Connection,**kwargs)

Bases:BaseServer

The webhooks resource returns a list of service webhooks configuredfor a specific geoprocessing or feature service, includingdeactivated and activated webhooks. Webhooks are an ArcGISEnterprise capability that provide other applications or webhookreceivers with event-driven information, delivered as an HTTPS POSTrequest, that can be used to create automated and integrativeworkflows. For more information on how webhooks are supported inArcGIS Enterprise, see Webhooks in ArcGIS Enterprise.

create(name:str,hook_url:str,*,change_types:WebHookEvents|str=WebHookEvents.ALL,signature_key:str|None=None,active:bool=False,schedule_info:dict[str,Any]|WebHookScheduleInfo|None=None,payload_format:str='json',content_type:str|None=None)ServiceWebHook

Creates a new Feature Collection Web Hook

Parameter

Description

name

Required String. Use valid name for a webhook. This name needs to be unique per service.

hook_url

Required String. The URL to which the payloads will be delivered.

change_types

Optional WebHookEvents or String. The default is “WebHookEvents.ALL”, which means all events. This is acomma separated list of values that will fire off the web hook. The listeach supported type is below.

signature_key

Optional String. If specified, the key will be used in generating the HMAChex digest of value using sha256 hash function and is return in thex-esriHook-Signature header.

active

Optional bool. Enable or disable call backs when the webhook is triggered.

schedule_info

Optional Dict orWebHookScheduleInfo. Allows the trigger to be used as a given schedule.

Example Dictionary:

{
“name” : “Every-5seconds”,
“startAt” : 1478280677536,
“state” : “enabled”
“recurrenceInfo” : {
“frequency” : “second”,
“interval” : 5
}
}

payload_format

Optional String. The payload can be sent in pretty format or standard.The default isjson.

content_type

Optional String. The Content Type is used to indicate the media type of theresource. The media type is a string sent along with the file indicatingthe format of the file.

A list of allowed web hook triggers is shown below.

Name

Triggered When

*

Wildcard event. Any time any event is triggered.

FeaturesCreated

A new feature is created

FeaturesUpdated

Any time a feature is updated

FeaturesDeleted

Any time a feature is deleted

FeaturesEdited

Any time a feature is edited (insert or update or delete)

AttachmentsCreated

Any time adding a new attachment to a feature

AttachmentsUpdated

Any time updating a feature attachment

AttachmentsDeleted

Any time an attachment is deleted from a feature

LayerSchemaChanged

Any time a schema is changed in a layer

LayerDefinitionChanged

Any time a layer definition is changed

FeatureServiceDefinitionChanged

Any time a feature service is changed

Returns:

AServiceWebHook object

delete_all_hooks()bool

Thedelete_all_hooks operation will permanently remove the specified webhook.

Returns:

Bool, True if successful

disable_hooks()bool

Thedisable_hooks will temporarily deactivate all configured webhooksfor a geoprocessing or feature service. While deactivated, the service’swebhooks will not be invoked and payloads will not be delivered.

Returns:

Bool, True if successful

enable_hooks()bool

Theenable_hooks operation restarts a deactivated webhook. Whenactivated, payloads will be delivered to the payload URL when thewebhook is invoked.

Returns:

Bool, True if successful

propertylist:list[ServiceWebHook]

Lists the existing webhooks

Returns:

list[ServiceWebHook]

AsyncJob

classarcgis.gis.server.AsyncJob(url:str,session:EsriSession)

Bases:object

A job represents the asynchronous execution of an operation. Progressinformation can be acquired by periodically querying this resource.

propertyproperties:dict[str,Any]

returns the object properties

result()dict[str,Any]

This operation will wait until the job has completed beforereturning the results of the operation.

session:EsriSession
url:str=None

Your browser is no longer supported. Please upgrade your browser for the best experience. See ourbrowser deprecation post for more details.


[8]ページ先頭

©2009-2025 Movatter.jp