Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

ArcGIS API for PythonAPI Reference

arcgis.gis.agonb module

AGOLNotebookManager

classarcgis.gis.agonb.AGOLNotebookManager(url:str,gis:GIS)

Bases:object

propertycontainers:ContainerManager

Provides the ability to manage containers and the notebooks within them

Returns:

ContainerManager

propertyinstance_preferences:InstancePreference

Provides information about the available instances for notebooks

Returns:

InstancePreference

propertynotebooksmanager:NotebookManager

Manages the run and execution of notebooks

Returns:

NotebookManager

propertyruntimes:RuntimeManager

Provides information about the available runtimes on the notebook server

Returns:

RuntimeManager

propertyservices

returns the service manager.

propertysnaphots:SnapshotManager

Returns tools to work with snapshots on notebooks

Returns:

SnapshotManager

ContainerManager

classarcgis.gis.agonb.ContainerManager(url:str,gis:GIS)

Bases:object

Parameter

Description

url

Required String. The base url for the ContainerManager endpoints.

gis

RequiredGIS. The ArcGIS Online connection object.

get(id:str)Container

Gets an instance of a container

list()list[dict[str,Any]]

Returns a list of containers

start(runtime:str,instance_type:str|None=None)dict[K,V]

starts a container

InstancePreference

classarcgis.gis.agonb.InstancePreference(url:str,gis:GIS)

Bases:object

Provides information about the available instances for notebook containers.

Parameter

Description

url

Required String. The base url for the InstancePreference endpoints.

gis

RequiredGIS. The ArcGIS Online connection object.

propertyavailable:dict[T,V]

Returns Information on the available notebook instances.

Returns:

dict[T,V]

propertyinstances:dict[T,V]

Returns a dictionary containing the available instance types for the system

Returns:

dict[T,V]

NotebookManager

classarcgis.gis.agonb.NotebookManager(url,gis,nbs)

Bases:object

Provides access to managing a site’s notebooks. An object of thisclass can be created usingnotebooks property of theNotebookServer class

execute_notebook(item:Item,update_portal_item:bool=True,parameters:list|None=None,save_parameters:bool=False,instance_type:str|None=None,timeout:float|int=50,future:bool=False)

The Execute Notebook operation allows administrators to remotelyrun a notebook in their ArcGIS Notebook Server site. The notebookspecified in the operation will be 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 app.

Note

To run this operation, you must be logged in with an ArcGISEnterprise portal account. You cannot execute notebooks fromthe ArcGIS Notebook Server primary site administratoraccount.

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 the tagparameters to a cell.

Parameter

Description

item

RequiredItem. Opens an existing portal item.

update_portal_item

Optional Boolean. Specifies whether you want to update thenotebook’s portal item after execution. The default is true. 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 List. An optional array of 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 the format “x”:1 whendefining parameters with numbers, and “y”:”text” when definingparameters with text strings.

save_parameters

Optional Boolean. Specifies whether the notebook parameters cellshould be saved in the notebook for future use. The default isfalse.

instance_type

Optional String. The instance type.

timeout

Optional Int. The number of minutes to run the instance before timeout.

future

Optional boolean. If True, a Job object will be returned and the processwill not wait for the task to complete. The default is False, which means wait for results.

Returns:

Dict, else Iffuture=True, then the result isaconcurrent.futures.Future object.Callresult() to get the response

open_notebook(itemid:str,templateid:str|None=None,nb_runtimeid:str|None=None,template_nb:str|None=None,instance_type: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.

instance_type

Optional String. The name of the instance type.

future

Optional Bool.

Returns:

Dict

RuntimeManager

classarcgis.gis.agonb.RuntimeManager(url:str,gis:GIS)

Bases:object

Provides information about the Runtimes in the Notebook Server

Parameter

Description

url

Required String. The base url for the RuntimeManager endpoints.

gis

RequiredGIS. The ArcGIS Online connection object.

list()list[dict[T,V]]

returns a list of runtimes on the system

Returns:

list[dict[T,V]]

manifest(id:str)dict[T,V]

returns a dictionary containing all the libraries for that runtime

Returns:

dict[T,V]

propertyproperties:dict[T,V]

Returns the runtimes on the GIS

Returns:

dict[T,V]

SnapshotManager

classarcgis.gis.agonb.SnapshotManager(url:str,gis: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

list(item:Item)

Returns a list of SnapShots for a notebook item.

Parameter

Description

item

Required Item. The NotebookItem to get allsnapshots for.

Returns:

List ofSnapShot objects

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