arcgis.gis.mission module

MissionServer

class arcgis.gis.mission.MissionServer(url, gis=None)

Bases: arcgis.gis.mission._base.BaseMissionServer

A Mission Server Instance.

property info

Returns information about the server site itself

Returns

PropertyMap

property logs

Provides access to the Mission server’s logging system

Returns

LogManager

property machine

Provides access to managing the registered machines with ArcGIS Mission Server

Returns

MachineManager

property security

Provides access to managing the ArcGIS Mission Server’s security settings.

Returns

SecurityManager

property system

returns access to the system properties of the ArcGIS Mission Server

Returns

SystemManager

Mission

class arcgis.gis.mission.Mission(url: str, gis: GIS, **kwargs)

Bases: object

A single registered Mission on the Enterprise.

add_report(title: str, description: str = None, tags: str = None, questions: dict = None, display_field: str = None, drawing_info: dict = None, locale: str = 'en', share_as_template: bool = False) → dict

Argument

Description

title

Required String. The name of the report.

description

Optional String. A description of the report.

tags

Optional. A comma-separated list of strings. Used to add tags to the report.

questions

Optional Dict. A dictionary containing questions and their fields. If an empty array is passed, the request is rejected. Used to represent the desired questions and their fields. Question types are based on Survey123 question type fields. Available question types: Single Line Text, Single Choice, Number, Image, Multiline Text, Dropdown, Multiple Choice, and Date/Time. See https://doc.arcgis.com/en/survey123/browser/create-surveys/quickreferencecreatesurveys.htm#GUID-2D96112F-85B1-4C41-9C6F-A85BB6026A51 for details.

display_field

Optional String. The name of the report feature layer’s display field. Normally this is the field name of one of the report questions. If absent, the report feature layer’s display field will be the first question’s field name.

drawing_info

Optional. JSON Object. Defines the report feature layer’s drawing info, including a feature renderer. See: https://developers.arcgis.com/documentation/common-data-types/drawinginfo.htm

locale

Optional. String. The locale used to generate the report. Must be a valid IETF BCP 47 language tag. Defaults to en

share_as_template

Optional Boolean. Shares the report as a template.

Returns

Dict

delete() → bool

Deletes a Mission from the server.

Returns

Boolean

properties
property reports

Returns a List of Mission Report Items associated with the Mission

Returns

List[Item]

MissionCatalog

class arcgis.gis.mission.MissionCatalog(gis: GIS)

Bases: object

The ArcGIS Mission Server catalog.

create_mission(title: str, snippet: str = None, description: str = None, license_info: str = None, tags: str = None, extent: list = None, template_item: Optional[arcgis.gis.Item] = None, locale: str = 'en', base_map: dict = None, wm_description: str = None, webmap_id: Union[str, arcgis.gis.Item] = None) → arcgis.gis.mission.api.MissionJob

Creates a new Mission on the enterprise.

Argument

Description

title

Required. String. The title of the mission. This is the human readable title that is displayed to users.

snippet

Optional String. A short summary description of the item.

description

Optional String. Mission description.

license_info

Optional String. Any license information or restrictions.

tags

Optional. Comma-separated list of strings used to tag the mission. Format: tag1,tag2,…,tagN

extent

Optional String. Comma-separated list that defines the bounding rectangle of the mission. Should always be in WGS84. The default is -180, -90, 180, 90.

Format: <xmin>, <ymin>, <xmax>, <ymax>

webmap_id

Optional String. The portal item id of the web map to use as a template for the mission.

locale

Optional String. The locale in which to generate Mission assets with. Must be a valid IETF BCP 47 language tag. Defaults to en

base_map

Optional JSON Object. The basemap to add to the mission. See: https://developers.arcgis.com/documentation/common-data-types/basemap.htm

wm_description

Optional string. The description of the web map added to the mission.

Returns

MissionJob

property jobs

returns a list of jobs on the server

property missions

returns a list of missions on the server

Returns

List

properties

MissionJob

class arcgis.gis.mission.MissionJob(url: str, gis: GIS, **kwargs)

Bases: object

Represents a Single Job operation for Mission Server

properties
result() → arcgis.gis.mission.api.Mission

Returns the results of the process

property status

Returns the status

Returns

string

DirectoryManager

class arcgis.gis.mission._system.DirectoryManager(url, gis)

A manages and maintains a collection of all server directories.

list()

returns the current registered directories

Returns

List

property properties

returns the properties of the resource

register(name, path, directory_type)

This operation registers a new data directory from your local machine with the ArcGIS Mission Server site. Registering a local folder as a data directory allows your mission authors to work with files in the folder.

Parameter

Description

name

The name of the directory.

path

The full path to the directory on your machine.

directory_type

The type of directory. Values: DATA | WORKSPACE | OUTPUT

Returns

boolean

unregister(directory_id)

This operation unregisters an existing directory from the ArcGIS Mission Server site.

Parameter

Description

directory_id

Required String. The directory ID to remove.

Returns

boolean

LogManager

class arcgis.gis.mission._logs.LogManager(url, gis)

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

clean()

Deletes all the log files on all server machines in the site. This is an irreversible operation.

This operation forces the server to clean the logs, which has the effect of freeing up disk space. However, it is not required that you invoke this operation because the server periodically purges old logs.

Returns

Boolean. True if successful else False.

property properties

returns the properties of the resource

query(start_time=None, end_time=None, since_server_start=False, level='WARNING', services='*', machines='*', server='*', codes=None, process_IDs=None, export=False, export_type='CSV', out_path=None)

The query operation on the logs resource provides a way to aggregate, filter, and page through logs across the entire site.

Argument

Description

start_time

Optional string/datetime.dateime. The most recent time to query. Default is now. Time can be specified in milliseconds since UNIX epoch, or as an ArcGIS Server timestamp. For example { “startTime”: “2011-08-01T15:17:20,123”, … }, { “startTime”: 1312237040123, … }, respectively.

end_time

Optional string/datetime.dateime. The oldest time to include in the result set. You can use this to limit the query to the last n minutes or hours as needed. Default is the beginning of all logging.

since_server_start

Optional Boolean. Gets only the records written since the server started (True). The default is False.

level

Optional string. Gets only the records with a log level at or more severe than the level declared here. Can be one of (in severity order): DEBUG, VERBOSE, FINE, INFO, WARNING, SEVERE. The default is WARNING.

services

Optional string. Query records related to a specific service. The default is all.

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 string. Gets only the records with the specified code. The default is all. See http://server.arcgis.com/en/server/latest/administer/windows/log-codes-overview.htm

process_IDs

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

export

Optional string. Boolean indicating whether to export the query results. The default is False (don’t export).

export_type

Optional string. The export file type. CSV or TAB are the choices, CSV is the default.

out_path

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

Returns

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

property settings

Get/set the current log settings.

Argument

Description

value

dict. A dictionary with the key/values pairs to modify settings.

Returns

PropertyMap

Machine

class arcgis.gis.mission._machines.Machine(url, gis)

This resource provides information about the machine in your ArcGIS Mission Server site. You can update some of these properties using the Edit Machine operation.

create_self_signed_cert(alias, keysize, common_name, org_unit, organization, city, state, country, keyalg='RSA', sigalg='SHA1withRSA', validity=90, san=None)

Use this operation to create a self-signed certificate or as a starting point for getting a production-ready CA-signed certificate. ArcGIS Mission Server will generate a certificate for you and store it in its keystore. The certificate generated should only be used in development and staging environments.

Argument

Description

alias

Required String. A unique name that easily identifies the certificate.

keyalg

Optional String. The algorithm used to generate the key pairs. The default is RSA.

keysize

Required String. Specifies the size in bits to use when generating the cryptographic keys used to create the certificate. The larger the key size, the harder it is to break the encryption; however, the time to decrypt encrypted data increases with key size. For DSA, the key size can be between 512 and 1,024. For RSA, the recommended key size is 2,048 or greater.

sigalg

Optional String. Use the default (SHA1withRSA). If your organization has specific security restrictions, then one of the following algorithms can be used for DSA: SHA256withRSA, SHA384withRSA, SHA512withRSA, SHA1withDSA.

common_name

Required String. Use the domain name of your server name as the common name. If your server will be accessed on the Internet through the URL https://www.Missionserver.com:11443/arcgis/, use www.Missionserver.com as the common name.If your server will only be accessible on your local area network (LAN) through the URL https://Missionserver.domain.com:11443/arcgis/, use Missionserver as the common name.

org_unit

Required String. The name of your organizational unit, for example, GIS Department.

organization

Required String. The name of your organization, for example, Esri.

city

Required String. The name of the city or locality, for example, Redlands.

state

Required String. The full name of your state or province, for example, California.

country

Required String. The abbreviated code for your country, for example, US.

validity

Required Integer. The total time in days during which this certificate will be valid, for example, 365. The default is 90.

san

Optional String. The subject alternative name (SAN) is an optional parameter that defines alternatives to the common name (CN) specified in the SSL certificate. There cannot be any spaces in the SAN parameter value. If no SAN is defined, a website can only be accessed (without SSL certificate errors) by using the common name in the URL. If a SAN is defined and a DNS name is present, the website can only be accessed by what is listed in the SAN. Multiple DNS names can be specified if desired. For example, the URLs https://www.esri.com, https://esri, and https://10.60.1.16 can be used to access the same site if the SSL certificate is created using the following SAN parameter value: DNS:www.esri.com,DNS:esri,IP:10.60.1.16

Returns

Bool

delete_certificate(certificate)

Deletes a SSL certificate using the certificate alias.

Argument

Description

certificate

Required string. The name of the certificate to delete

Returns

boolean

export_certificate(certificate)

Downloads an SSL certificate. The file returned by the server is an X.509 certificate. The downloaded certificate can then be imported into a client that is making HTTP requests.

Argument

Description

certificate

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

Returns

The SSL certificate object.

generate_CSR(certificate)

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

Argument

Description

certificate

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

Returns

The CSR.

property hardware

This resource displays hardware information for the machine in your ArcGIS Mission Server site. It updates the information when it detects any change to the configuration of your machine, as well as each time the machine is restarted.

Returns

dict

import_CA_signed_certificate(certificate, ca_signed_certificate)

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

Argument

Description

certificate

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

ca_signed_certificate

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

Returns

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

import_existing_server_certificate(alias, cert_password, cert_file)

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

Argument

Description

alias

Required string. A unique name for the certificate that easily identifies 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, root_CA_certificate)

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

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

Argument

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).

property properties

Get/Set the properties of the resource

Set operation allows you to update properties on the ArcGIS Mission Server machine.

ArcGIS Mission Server uses port 11443 for communication. When you create a site, this is assigned as the default. You must ensure that your firewall allows communication through port 11443.

ssl_certificate(certificate)

Provides the self-signed certificate object.

Note

Even though a self-signed certificate can be used to enable SSL, it is recommended that you use a self-signed certificate only on staging or development servers.

Argument

Description

certificate

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

Returns

The certificate object.

property ssl_certificates

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

unregister()

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

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

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

Returns

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

MachineManager

class arcgis.gis.mission._machines.MachineManager(url, gis)

This resource provides the name and URL of the ArcGIS Mission Server machine in the site.

list()

returns all machine instances

property properties

returns the properties of the resource

SecurityManager

class arcgis.gis.mission._security.SecurityManager(url, gis)

This resource is a container for all resources and operations pertaining to security in your ArcGIS Mission Server site.

property configuration

This resource returns the currently active security configuration of your ArcGIS Mission Server site. A security configuration involves the following pieces of information, and can be modified using the setter.

Configuration Properties

Key

Description

allowedAdminAccessIPs

(Allowed Administration Access IPs). A comma separated list of client machine IP addresses that are allowed access to ArcGIS Server. This can be used as an additional security measure to prevent unauthorized access to the site.

allowDirectAccess

(Allow direct administrator access). A boolean that indicates if a user with administrator privileges can access the server through port 6080. If true, all users with administrative access are allowed to access the Administrator Directory and ArcGIS Server Manager through port 6080. If false, users in the identity store are blocked from accessing the server through port 6080. This forces users to access the site through ArcGIS Web Adaptor. The default value is true.

Before disabling administrative access on port 6080, ArcGIS Server must be configured to use web tier authentication (WEB_ADAPTOR) and at least one user in the identity store must have administrator privileges to the site. The primary site administrator account will still be able to administer the site through port 6080.

To fully disable access on port 6080, you can optionally disabled the primary site administrator account. If ArcGIS Server Manager becomes unavailable or the web server is unable to authenticate users that have administrator privileges, you will be unable to administer your site. To recover from this site, re-enable the primary site administrator account and connect to the site through port 6080 with this account.

authenticationMode

(Authentication Mode). Specifies the authentication mode used by ArcGIS Server. When ArcGIS Server is federated with Portal for ArcGIS, this property can be included and set to ARCGIS_PORTAL_TOKEN. The default value is ARCGIS_TOKEN.

Values: ARCGIS_TOKEN | ARCGIS_PORTAL_TOKEN | WEB_ADAPTOR_AUTHENTICATION

authenticationTier

(Authentication Tier). The tier at which requests to access GIS services will be authenticated. It is recommended that you do not modify these values using the Administrator Directory. Instead, use ArcGIS Server Manager to configure web tier authentication or use the Portal for ArcGIS website to federate ArcGIS Server with your portal.

Values: WEB_ADAPTOR | GIS_SERVER | ARCGIS_PORTAL

HSTSEnabled

(HSTS Enabled). A boolean that indicates if HTTP Strict Transport Security (HSTS) is being used by the site. See Enforce strict HTTPS communication for more information. In order for this property to be enabled, the Protocol property must already be set to use HTTPS only.

httpEnabled

(HTTP Enabled). A boolean that indicates if the site is accessible over HTTP.

Protocol

(Protocol). Specifies the HTTP protocol to be used for communication to and from the ArcGIS Server site. If set to HTTP, all communication to and from the site will be over HTTP, with HTTPS communication being unavailable. If HTTP_AND_HTTPS is set, users and client may use either HTTP or HTTPS to connect to the site. If HTTPS, all communication to and from the site will be over HTTPS. Any call made using HTTP will be redirected to use HTTPS instead. When you initially create your ArcGIS Server site, all communication in the site is sent over HTTP, which is not secure. This means that your credentials sent over an internal network or the Internet are not encrypted and can be intercepted. To prevent the interception of any communication, it’s recommended that you configure ArcGIS Server and ArcGIS Server Manager (if installed) to enforce Secure Sockets Layer (SSL). When you initially create your site, you’ll see a warning-level message in the logs recommending that you update the communication protocol of your site to use SSL.

Values: HTTP | HTTP_AND_HTTPS | HTTPS

roleStoreConfig

(Role Store). Connection information about the currently active role store.

securityEnabled

(Security Enabled). A boolean that indicates if security is enabled for any GIS service. The default value is true.

sslEnabled

(SSL Enabled). A boolean that indicates if the site is accessible over HTTPS (SSL). The default value is false.

userStoreConfig

(User Store). Connection information about the currently active user store.

virtualDirsSecurityEnabled

(Virtual Directories Security Enabled). A boolean that indicates if the server’s virtual directories are secured and require authentication. If true, accessing the content in the arcgisoutput, arcgisjobs, and arcgisinput directories over HTTP will require user authentication. This will negatively impact performance. The default value is false.

portalProperties

(Portal Properties). Specified when federating ArcGIS Server with Portal for ArcGIS. See the Portal properties for more information.

Portal Properties

Portal Keys

Description

portalMode

Must be set as ARCGIS_PORTAL_FEDERATION.

portalSecretKey

The key obtained after federating ArcGIS Server with Portal for ArcGIS.

portalURL

The URL of Portal for ArcGIS.

referer

The referer specified when generating the token.

serverId

The ID of the server federated with the portal.

serverURL

External URL of the server federated with the portal in the following format:

token

A token obtained from Portal for ArcGIS for use by ArcGIS Server for initial validation.

SiteManager

SystemManager

class arcgis.gis.mission._system.SystemManager(url, gis)

The System resource is a collection of server-wide resources in your ArcGIS Mission Server site. Within this resource, you can access information and perform operations pertaining to licenses, Web Adaptors, containers, server properties, directories, Jobs, and the configuration store.

property config_store

The configuration store maintains configurations for ArcGIS Mission Server. Typical configurations include all the resources such as machines and security rules that are required to power the site. In a way, the configuration store is a physical representation of a site.

Every ArcGIS Mission Server machine, when it joins the site, is provided with a connection to the configuration store and it can thereafter participate in the management of the site. You can change the store’s properties during runtime using the edit operation.

The Administrator API that runs on every server machine is capable of reading and writing to the store. As a result, the store must be accessible to every server machine within the site. The default implementation is built on top of a file system and stores all the configurations in a hierarchy of folders and files.

Returns

dict

property directories

Provides access to registering directories

property licenses

Gets the license resource list. The licenses resource lists the current license level of ArcGIS Mission Sever and all authorized extensions. Contact Esri Customer Service if you have questions about license levels or expiration properties.

property properties

ArcGIS Mission Server has configuration properties that govern some of its intricate behavior. This resource is a container for these properties. The properties are available to all server objects and extensions through the server environment interface.

Returns

PropertyMap

property web_adaptors

returns a list of web adapters

Returns

List

WebAdaptor

class arcgis.gis.mission._system.WebAdaptor(url, gis)

This resource provides information about the ArcGIS Web Adaptor configured with your ArcGIS Mission Server site. ArcGIS Web Adaptor is a web application that runs in a front-end web server. One of the Web Adaptor’s primary responsibilities is to forward HTTP requests from end users to ArcGIS Mission Server in a round-robin fashion. The Web Adaptor acts a reverse proxy, providing the end users with an entry point into the system, hiding the server itself, and providing some degree of immunity from back-end failures.

The front-end web server could authenticate incoming requests against your enterprise identity stores and provide specific authentication schemes like Integrated Windows Authentication (IWA), HTTP Basic or Digest.

Most importantly, ArcGIS Web Adaptor provides your end users with a well-defined entry point into your system without exposing the internal details of your server site. ArcGIS Mission Server will trust requests being forwarded by ArcGIS Web Adaptor and will not challenge the user for any credentials. However, the authorization of the request (by looking up roles and permissions) is still enforced by the server site.

ArcGIS Mission Server use the WebSocket protocol for communication. You can update the maximum size of the file sent using WebSocket by updating your site’s webSocketMaxHeapSize property.

unregister()

Unregisters a WebAdapter for the Mission Server :return: boolean

WebAdaptorManager

class arcgis.gis.mission._system.WebAdaptorManager(url, gis)

Manages and configures web adaptors for the ArcGIS Mission Server.

property config

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

list()

Returns all registered Web Adapters

Returns

List

property properties

returns the properties of the resource

register(name, ip, webadapter_url, http_port, https_port, description='')

Registers a new web adapter.

Argument

Description

name

Required String. The name of the web adapter

ip

Required String. The IP of the web adapter.

webadapter_url

Required String. The URI endpoint of the web adpater.

http_port

Required Integer. The port number of the web adapter

https_port

Required Integer. The secure port of the web adapter.

description

Optional String. The optional web adapter description.

Returns

Boolean