arcgis.gis.nb module
NotebookServer
- classarcgis.gis.nb.NotebookServer(url,gis)
Bases:
object
Provides access to the ArcGIS Notebook Server administration API.
- propertydata_access:NotebookDataAccess
Provides access to managing files stored on notebook server.
- Returns:
NotebookDataAccess
object
- propertyhealth_check:bool
Thehealth_check verifies that your ArcGIS Notebook Server sitehas been created, and that its Docker environment has beencorrectly configured.
This is only available if the site can be accessed around the web adapter
- Returns:
Boolean
- propertymachine
Provides access to managing the registered machines with ArcGISNotebook Server
- Returns:
NotebookManager
- classarcgis.gis.nb.NotebookManager(url,gis,nbs)
Bases:
object
Provides access to managing a site’s notebooks. An object of thisclass can be created using
notebooks
property of theNotebookServer
class- execute_notebook(item:Item,update_portal_item:bool=True,parameters:list|None=None,save_parameters:bool=False,future:bool=False)
The Execute Notebook operation allows administrators and users withtheCreate and Edit Notebooks privilege to remotelyrun a notebook that they own. The notebook pecified in the operation willbe run with all cells in order.
Using this operation, you can schedule the execution of a notebook,either once or with a regular occurrence. This allows you toautomate repeating tasks such as data collection and cleaning,content updates, and portal administration. On Linux machines, usea cron job to schedule the executeNotebook operation; on Windowsmachines, you can use the Task Scheduler.
Note
To run this operation in ArcGIS Enterprise, you must log in withan Enterprise account. You cannot execute notebooks using theArcGIS Notebook Server primary site administrator account.
You can specify parameters to be used in the notebook at executiontime. If you’ve specified one or more parameters, they’ll beinserted into the notebook as a new cell. This cell will be placedat the beginning of the notebook, unless you have added theparameters tag to a cell.
SeeExecute Notebookfor full administration details.
Parameter
Description
item
Required notebook
Item
. Opens the existing portalnotebook.update_portal_item
Optional Boolean. Specifies whether you want to update thenotebook’s portal item after execution. The default isTrue. You maywant to specify true when the notebook you’re executing containsinformation that needs to be updated, such as a workflow thatcollects the most recent version of a dataset. It may not beimportant to update the portal item if the notebook won’t store anynew information after executing, such as an administrative notebookthat emails reminders to inactive users.
parameters
Optional Dictionary. Defines the parameters to add to thenotebook for this execution. The parameters will be inserted as anew cell directly after the cell you have taggedparameters.Separate parameters with a comma. Use formats:
“x”:1 when defining number parameters
“y”:”text” when defining string parameters
SeePrepare the Notebookfor detailed explanation.
save_parameters
Optional Boolean. Specifies whether the notebook parameters cellshould be saved in the notebook for future use. The default isFalse.
future
Optional boolean.
IfTrue, afuture object will be returned and the process runsasynchronously, allowing for other work to be done whileprocessing completes.
IfFalse, which is the default, the process waits for resultsbefore continuing.
- Returns:
Iffuture=False, a Python dictionary
Iffuture = True, then the result is aconcurrent.futures.Futureobject. Callresult() on the object to get the response
# Usage Example:>>>fromarcgis.gisimportGIS>>>gis=GIS("home")>>>nb_server=gis.notebook_server[0]>>>notebook_item=gis.content.get('<notebook_item_id>')>>>nb_mgr=nb_server.notebooks>>>nb_mgr.execute_notebook(notebook_item)
- list()
Returns a list of notebook instances on the Notebook Server
- Returns:
List of
Notebook
objects
- open_notebook(itemid:str,templateid:str|None=None,nb_runtimeid:str|None=None,template_nb:str|None=None,*,future:bool=False)
Opens a notebook on the notebook server
Parameter
Description
itemid
Required String. Opens an existing portal item.
templateid
Optional String. The id of the portal notebook template. To get thesystem templates, look at the sample notebooks group:
>>>fromarcgis.gisimportGIS>>>gis=GIS()>>>grp=gis.groups.search("title:(esri sample notebooks) AND>>>owner:"esri_notebook")[0]>>>grp.content
nb_runtimeid
Optional String. The runtime to use to generate a new notebook.
template_nb
Optional String. The start up template for the notebook.
future
Optional Bool. If True, the job will run asynchronously.
- Returns:
Dict or Job
- restore_runtime()
This operation restores the two default notebook runtimes in ArcGISNotebook Server - ArcGIS Notebook Python 3 Standard and ArcGISNotebook Python 3 Advanced - to their original settings.
Notebook
- classarcgis.gis.nb.Notebook(url,item_id,properties=None,gis=None)
Bases:
object
This represents an individual notebook resource in the notebook server.
Runtime
- classarcgis.gis.nb.Runtime(url,gis)
Bases:
object
Provides information about the properties of a specific notebook runtime in your ArcGIS Notebook Server site
- propertymanifest
This resource returns a JSON representation of all the Pythonlibraries supported in the specified notebook runtime. Notebookauthors who open notebooks using this runtime are able to importany of the libraries in the manifest into their notebooks.
- Returns:
List of Dictionaries
- update(name:str|None=None,image_id:str|None=None,max_cpu:float|None=None,max_memory:float|None=None,memory_unit:str|None=None,max_swap_memory:str|None=None,swap_memory_unit:str|None=None,shared_memory:str|None=None,docker_runtime:str|None=None,shared_unit:str|None=None,version:str|None=None,container_type:str|None=None,pull_string:str|None=None,require_advanced_priv:bool|None=None,manifest:str|None=None)
This operation allows you to update the properties of a notebookruntime in ArcGIS Notebook Server. These settings will be appliedto every container to which the runtime is applied.
You can use this operation to update the resource limits of theruntime, such as maximum CPU and maximum memory. You can also useit to extend either of the default notebook runtimes, in order tomake additional Python modules available to your notebook authors,or as a step in making ArcGIS Notebook Server able to use graphicalprocessing units (GPUs).
SnapshotManager
- classarcgis.gis.nb.SnapshotManager(url,gis)
Bases:
object
Allows for management and creation of snapshots (save points) for ArcGIS Notebooks.
- create(item:Item,name:str,description:str|None=None,notebook_json:dict|None=None,access:bool=False)
Creates a Snapshot of a Given Item.
Parameter
Description
item
Required Item. The ‘Notebook’ typed item to create a snapshot for.
name
Required String. The name of the snapshot. This is the identifierused to identify the snapshot.
description
Optional String. An piece of text that describes the snapshot.
notebook_json
Optional Dict. If you want to store different JSON text otherthan what is in the current notebook provide it here.
access
Optional Bool. When false, the snapshot will not be publicly available.
- Returns:
Dict
SnapShot
- classarcgis.gis.nb.SnapShot(item:Item,sm:SnapshotManager,properties:dict)
Bases:
object
A single snapshot instance for a Notebook item.
- delete()
Deletes a snapshot associated with the notebook item
Parameter
Description
item
Required Item. The ‘Notebook’ typed item to remove snapshots from.
snapshot
Required String. The name of the snapshot.
- Returns:
Boolean
- restore(title:str|None=None,preserve:bool=True,description:str|None=None)
Rolls back the notebook to a previous snapshot state
Parameter
Description
title
Optional string. The Item’s title.
preserve
Optional Bool. If True, the current notebook version is preserved as a snapshot.
description
Optional String. Text describing the restoration point.
- Returns:
Dict
SystemManager
- classarcgis.gis.nb.SystemManager(url:str,gis:GIS)
Bases:
object
The System resource is a collection of server-wide resources in yourArcGIS Notebook Server site. Within this resource, you can accessinformation and perform operations pertaining to licenses, WebAdaptors, containers, server properties, directories, Jobs, and theconfiguration store.
- propertyconfig_store:Dict[str,Any]
The configuration store maintains configurations for ArcGIS NotebookServer. Typical configurations include all the resources such asmachines and security rules that are required to power the site. Ina way, the configuration store is a physical representation of a site.
Every ArcGIS Notebook Server machine, when it joins the site, isprovided with a connection to the configuration store and it canthereafter participate in the management of the site. You can changethe store’s properties during runtime using the edit operation.
The Administrator API that runs on every server machine is capableof reading and writing to the store. As a result, the store must beaccessible to every server machine within the site. The defaultimplementation is built on top of a file system and stores all theconfigurations in a hierarchy of folders and files.
- Returns:
Dict
- propertycontainers:List[Container]
Returns a list of active containers.
- Returns:
List of
containers
- delete_all_jobs()→bool
Administrators can clean up an open notebook and execute notebookjobs on demand. Administrators can view and delete all jobs.Non-administrative users with create and edit notebook privilegescan only view and delete their own jobs.Only jobs in completed or failed states will be cleaned up.
- Returns:
Boolean
- propertydirectories:DirectoryManager
Provides access to registering directories
- Returns:
- job_details(job_id:str)→Dict[str,Any]
A job represents the asynchronous execution of an operation inArcGIS Notebook Server. You can acquire progress information byperiodically querying the job.
Parameter
Description
job_id
Required String. The unique identifier of the job.
- Returns:
Dict
- propertyjobs:List[Dict[str,Any]]
This resource is a collection of all the administrative jobs(asynchronous operations) created within your site. When operationsthat support asynchronous execution are run, ArcGIS Notebook Servercreates a new job entry that can be queried for its current statusand messages.
- Returns:
List
- propertylicenses:Dict[str,Any]
Gets the license resource list. The licenses resource lists thecurrent license level of ArcGIS Notebook Sever and all authorizedextensions. Contact Esri Customer Service if you have questionsabout license levels or expiration properties.
- list_jobs(num:int=100,details:bool=False)→List[Dict[str,Any]]
This resource is a collection of all the administrative jobs(asynchronous operations) created within your site. When operationsthat support asynchronous execution are run, ArcGIS Notebook Servercreates a new job entry that can be queried for its current statusand messages. This is used for Notebook Server 10.9+
Parameter
Description
details
Optional Bool. For 10.9+ Notebook Servers, to get the expandeddetails of a Job, set the details toTrue.False will provideback a shortened job status.
num
Optional Integer. The number of jobs to return. The default is 100.This is only valid on 10.9+.
- Returns:
List
- propertyproperties:PropertyMap
ArcGIS Notebook Server has configuration properties that governsome of its intricate behavior. This resource is a container forthese properties. The properties are available to all serverobjects and extensions through the server environment interface.
You can use this property to get and/or set the available properties.
#Usage Example to set property:>>>nbserver=gis.notebook_server[0]>>>nbserver.system.properties={"webSocketSize":32}
See the REST API documention forNotebook Server System propertiesfor current complete list of available properties.
- Returns:
dictionary-like PropertyMap
- propertyrecent_statistics:Dict[str,Any]
returns statistics about the current state of the notebook server
- Returns:
Dictionary
- propertyweb_adaptors:WebAdaptorManager
returns a list of web adapters
- Returns:
List
Container
- classarcgis.gis.nb.Container(url,gis)
Bases:
object
This represents a single hosted notebook container.
- propertynotebooks:List[ContainerNotebook]
A list of all notebooks currently open in the container
- Returns:
List of
ContainerNotebook
objects
- propertysessions
When an ArcGIS Notebook is opened in a container, a computationalengine called a kernel is launched; the kernel runs while the notebookis active and executes all the work done by the notebook. Thisresource tracks the active kernels running in the specified containerto provide information about current notebook sessions.
- Returns:
List of Dict
Response
Description
ID
The unique ID string for the container session.
path
The working path to the running ArcGIS Notebook, ending in .ipynb.
kernel
Properties describing the kernel. They are as follows:
last_activity: The date and time of the most recent action performed by the kernel.
name: The name of the kernel. At 10.7, this value is python3.
id: The unique ID string for the kernel.
execution_state: Whether the kernel is currently executing an action or is idle.
connections: The number of users currently accessing the notebook.
ContainerNotebook
- classarcgis.gis.nb.ContainerNotebook(url:str,gis:GIS)
Bases:
object
Represents an individual notebook container
DirectoryManager
- classarcgis.gis.nb.DirectoryManager(url:str,gis:GIS)
Bases:
object
Manages and maintains a collection of all server directories.
- register(name:str,path:str,directory_type:str)→bool
This operation registers a new data directory from your localmachine with the ArcGIS Notebook Server site. Registering a localfolder as a data directory allows your notebook authors to work withfiles 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
WebAdaptor
- classarcgis.gis.nb.WebAdaptor(url,gis)
Bases:
object
This resource provides information about the ArcGIS Web Adaptorconfigured with your ArcGIS Notebook Server site. ArcGIS Web Adaptoris a web application that runs in a front-end web server. One of theWeb Adaptor’s primary responsibilities is to forward HTTP requestsfrom end users to ArcGIS Notebook Server in a round-robin fashion.The Web Adaptor acts a reverse proxy, providing the end users withan entry point into the system, hiding the server itself, andproviding some degree of immunity from back-end failures.
The front-end web server could authenticate incoming requests againstyour enterprise identity stores and provide specific authenticationschemes like Integrated Windows Authentication (IWA), HTTP Basic orDigest.
Most importantly, ArcGIS Web Adaptor provides your end users with awell-defined entry point into your system without exposing the internaldetails of your server site. ArcGIS Notebook Server will trust requestsbeing forwarded by ArcGIS Web Adaptor and will not challenge the userfor any credentials. However, the authorization of the request (bylooking up roles and permissions) is still enforced by the server site.
ArcGIS Notebooks use the WebSocket protocol for communication. You canupdate the maximum size of the file sent using WebSocket by updating yoursite’s webSocketMaxHeapSize property.
WebAdaptorManager
- classarcgis.gis.nb.WebAdaptorManager(url:str,gis:GIS)
Bases:
object
Manages and configures web adaptors for the ArcGIS Notebook Server.
- propertyconfig:Dict[str,Any]
This is a property that allows for the retreival and manipulation of web adaptors.
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 dict. 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.
- list()→List[WebAdaptor]
Returns all registered Web Adapters
- Returns:
List of
WebAdaptor
objects
- register(name:str,ip:str,webadaptor_url:str,http_port:int,https_port:int,description:str|None='')
Registers a new
webadapter
.Parameter
Description
name
Required String. The name of the web adapter
ip
Required String. The IP of the web adapter.
webadaptor_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
SiteManager
- classarcgis.gis.nb.SiteManager(url,notebook,gis)
Bases:
object
Provides the ability to update and restore notebook sites. An object of thisclass can be created using
site
property of theNotebookServer
class- export_site(location:str)
ArcGIS Notebook Server provides this operation to back up the site’sconfiguration store, along with the importSite operation to restorea site configuration from a backup. The configuration store hostsessential information about the ArcGIS Notebook Server site and itsmachines.
The output of this operation is a ZIP file with the .agssite fileextension.
There are many items and directories that are not backed up by thisoperation. Among them:
Notebooks
Container settings
Jobs directory
If desired, you can create your own file system backups for these items.
Parameter
Description
location
Required String. The folder to save the site to.
- Returns:
string
- import_site(location:str)
ArcGIS Notebook Server provides this operation to restore a siteconfiguration from a backup. The backup will have been created andexported by the exportSite operation as a ZIP file with the.agssite file extension.
Performing this operation will overwrite the current contents ofyour ArcGIS Notebook Server site’s configuration store with thecontents from the backup. You can use it to restore a siteconfiguration in the event of machine failure or human error.
The import operation may take a while to complete. When you executethe operation, keep the tab open on your browser until theoperation completes, as a report will be delivered to the page.
Parameter
Description
location
Required String. Path to the backup site file.
- Returns:
Boolean
LogManager
- classarcgis.gis.nb.LogManager(url,gis)
Bases:
object
Logs are the records written by the various components of Notebook server.You can query the logs and change various log settings. An object of thisclass can be created using
logs
property of theNotebookServer
class- clean()
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:
Boolean
- query(start_time:str|None=None,end_time:str|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)
The query operation on the logs resource provides a way toaggregate, filter, and page through logs across the entire site.
Parameter
Description
start_time
Optional string/integer. The most recent time to query. Default is now.Time can be specified in milliseconds since UNIX epoch, or as anArcGIS Server timestamp.
Example for string:“startTime”: “2011-08-01T15:17:20”
Example for integer:“startTime”: 1312237040123
end_time
Optional string. The oldest time to include in the result set. Youcan use this to limit the query to the last n minutes or hours asneeded. Default is the beginning of all logging.
since_server_start
Optional string. Gets only the records written since the serverstarted (True). The default is False.
level
Optional string. Gets only the records with a log level at or moresevere than the level declared here. Can be one of (in severityorder): DEBUG, VERBOSE, FINE, INFO, WARNING, SEVERE. Thedefault is WARNING.
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. Seehttp://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 queryresults. 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, theoutput log file path is returned.
MachineManager
- classarcgis.gis.nb.MachineManager(url,gis)
Bases:
object
This resource provides the name and URL of the ArcGIS NotebookServer machine in the site. An object of thisclass can be created using
machine
property of theNotebookServer
class- list()
returns all
Machine
instances
Machine
- classarcgis.gis.nb.Machine(url,gis)
Bases:
object
This resource provides information about the machine in your ArcGISNotebook Server site. You can update some of these propertiesusing the Edit Machine operation.
- create_self_signed_cert(alias:str,keysize:str,common_name:str,org_unit:str,organization:str,city:str,state:str,country:str,keyalg:str='RSA',sigalg:str='SHA1withRSA',validity:int=90,san:str|None=None)
Use this operation to create a self-signed certificate or as astarting point for getting a production-ready CA-signed certificate.ArcGIS Notebook Server will generate a certificate for you and storeit in its keystore. The certificate generated should only be used indevelopment and staging environments.
Parameter
Description
alias
Required String. A unique name that easily identifies the certificate.
keyalg
Optional String. The algorithm used to generate the key pairs. Thedefault is RSA.
keysize
Required String. Specifies the size in bits to use when generatingthe cryptographic keys used to create the certificate. The largerthe key size, the harder it is to break the encryption; however, thetime to decrypt encrypted data increases with key size. For DSA, thekey size can be between 512 and 1,024. For RSA, the recommended keysize is 2,048 or greater.
sigalg
Optional String. Use the default (SHA1withRSA). If your organizationhas specific security restrictions, then one of the followingalgorithms can be used for DSA: SHA256withRSA, SHA384withRSA,SHA512withRSA, SHA1withDSA.
common_name
Required String. Use the domain name of your server name as thecommon name. If your server will be accessed on the Internet throughthe URL
https://www.notebookserver.com:11443/arcgis/
, usewww.notebookserver.com
as the common name.If your server will onlybe accessible on your local area network (LAN) through the URLhttps://notebookserver.domain.com:11443/arcgis/
, use notebookserveras 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, forexample, California.
country
Required String. The abbreviated code for your country, forexample, US.
validity
Required Integer. The total time in days during which thiscertificate will be valid, for example, 365. The default is 90.
san
Optional String. The subject alternative name (SAN) is an optionalparameter that defines alternatives to the common name (CN)specified in the SSL certificate. There cannot be any spaces in theSAN parameter value. If no SAN is defined, a website can only beaccessed (without SSL certificate errors) by using the common namein the URL. If a SAN is defined and a DNS name is present, thewebsite can only be accessed by what is listed in the SAN. MultipleDNS names can be specified if desired. For example, the URLs
https://www.esri.com
,https://esri
, andhttps://10.60.1.16
can beused to access the same site if the SSL certificate is createdusing the following SAN parametervalue:DNS:www.esri.com,DNS:esri,IP:10.60.1.16
- Returns:
Boolean
- delete_certificate(certificate:str)
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)
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)
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
This resource displays hardware information for the machine in yourArcGIS Notebook Server site. It updates the information when itdetects any change to the configuration of your machine, as wellas each time the machine is restarted.
- Returns:
Dict
- import_CA_signed_certificate(certificate:str,ca_signed_certificate:str)
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)
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)
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).
- propertyproperties
Get/Set the properties on the ArcGIS Notebook Server machine.
Set operation allows you to update properties on the ArcGISNotebook Server machine.
ArcGIS Notebook Server uses port 11443 for communication. When youcreate a site, this is assigned as the default. You must ensure thatyour firewall allows communication through port 11443.
- 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
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.
- unregister()
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).
SecurityManager
- classarcgis.gis.nb.SecurityManager(url,gis)
Bases:
object
This resource is a container for all resources and operationspertaining to security in your ArcGIS Notebook Server site. An object of thisclass can be created using
security
property of theNotebookServer
class- propertyconfiguration
This resource returns the currently active security configurationof your ArcGIS Notebook Server site. A security configurationinvolves the following pieces of information, and can be modifiedusing the Update operation.
Configuration Properties
Parameter
Description
httpsProtocols
The TLS protocols ArcGIS Notebook Server will use. Values must be comma-separated.
cipherSuites
The cipher suites ArcGIS Notebook Server will use. Values must be comma-separated.
authenticationMode
Specifies the authentication mode used by ArcGIS Notebook Server. When ArcGIS Notebook Server is federated with an Enterprise portal, this property can be included and set to ARCGIS_PORTAL_TOKENValues: ARCGIS_TOKEN | ARCGIS_PORTAL_TOKEN
authenticationTier
The tier at which requests to access GIS services will be authenticated. You should not use this directory to modify your setting. The default value when your site is first created is NOTEBOOK_SERVER, but when you federate the site with your portal, the value is changed to ARCGIS_PORTAL.
tokenServiceKey
The key used to encrypt tokens.
Portal Properties
Parameter
Description
portalMode
Must be the value ARCGIS_PORTAL_FEDERATION
portalSecretKey
The key obtained after federating ArcGIS Notebook Server with portal.
portalURL
The URL of your portal, in the format
https://webadaptorhost.domain.com/webadaptorname
referer
The referer specified when generating the token.
serverId
The ID of the server federated with the portal.
serverUrl
The external URL of the federated ArcGIS Notebook Server, in the format
https://webadaptorhost.domain.com/webadaptorname
token
A token obtained from the portal for initial validation of the ArcGIS Notebook Server.
webgisServerTrustKey
A key for establishing trust between servers that are federated with the same portal.
privateHostingServerUrl
The private URL of the portal’s hosting server.
privatePortalUrl
The private URL of the portal.
When Setting theconfiguration the following must be defined and provided as a dictionary.
Key
Value
portalProperties
Required Dict. Portal properties represented as a JSON object.
httpsProtocols
Required String. The TLS protocols ArcGIS Server will use. Valid options are TLSv1, TLSv1.1, and TLSv1.2; values must be comma separated. By default, only TLSv1.2 is enabled.
cipherSuites
Required String. The cipher suites ArcGIS Notebook Server will use. Valid options are: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, and TLS_RSA_WITH_3DES_EDE_CBC_SHA.By default, all of the above options are enabled. Values must be comma separated
authenticationTier
Required String. The tier at which requests to access GIS services will be authenticated. You should only indicate your setting here, rather than using this operation to modify your setting. The default value when your site is first created is NOTEBOOK_SERVER, but when you federate the site with your portal, the value is changed to ARCGIS_PORTAL. Values: WEB_ADAPTOR | NOTEBOOK_SERVER | ARCGIS_PORTAL
NotebookDataAccess
- classarcgis.gis.nb._dataaccess.NotebookDataAccess(url,gis)
Bases:
object
The Data Access Workspace Directory allows notebook authors to manage files used in their notebooks.
- create_folder(folder:str)→bool
create a folder in your/arcgis/home notebook workspace directory.
Parameter
Description
folder
Required String. The name of the folder to create.
NotebookFile
- classarcgis.gis.nb._dataaccess.NotebookFile(definition:Dict[str,Any],da:NotebookDataAccess)
Bases:
object
Represents a Single File on the ArcGIS Notebook Server
NBServicesManager
- classarcgis.gis.nb._services.NBServicesManager(url:str,gis:GIS,nbs:NotebookServer)
Bases:
object
TheNBServicesManager is used to manage the container of services published on the notebook server. An object of thisclass can be created using
services()
method of theNotebookServer
class- create(item:Item,title:str,description:str=None)→Item
ArcGIS Notebook Server supports publishing a geoprocessing servicefrom a notebook. Thecreate operation creates a service when aJSON representation of the service is submitted to it.
To publish a service on Notebook Server, you must be anadministrator or a user with Notebook and Publish Web Toolsprivileges. The notebook must belong to the user publishing the service.
A notebook-to-web tool relationship is created for maintaining therelation between the notebook and the associated web tool createdfor the service. This relationship ensures that ownership andsharing permissions are the same for both. When a notebook isdeleted, the associated web tool is also deleted.
Parameter
Description
item
Required Item. The notebook Item to create a service from.
title
Required string. The name of the GP tool
description
Required string. The description of the tool.
- Returns:
Item
of the tool.
- propertyservices:tuple[NBService]
Returns a tuple of all
NBService
created by the Notebook Server.- Returns:
tuple
- propertytypes:dict
The types resource provides metadata and extensions that can beenabled on GPServer service types supported in ArcGIS NotebookServer. The services framework uses this information to validate aservice and construct the objects in the service. The metadatacontains identifiers for each object, a default list ofcapabilities, properties, and other resource information. Typeinformation for a specific service type can be accessed byappending the type name (GPServer, for example) to this URL.
- Returns:
Dict