本文簡要介紹 python 語言中 arcgis.gis.nb.NotebookManager.execute_notebook
的用法。
用法:
execute_notebook(item, update_portal_item=True, parameters=None, save_parameters=False, future=False)
返回:
字典 else If
future = True
,則結果是 concurrent.futures.Future 對象。調用result()
獲取響應
執行筆記本操作允許管理員和具有
Create and Edit Notebooks
權限的用戶遠程運行他們擁有的筆記本。操作中指定的筆記本將按順序運行所有單元。使用此操作,您可以安排筆記本的執行一次或定期執行。這使您可以自動執行重複任務,例如數據收集和清理、內容更新和門戶管理。在Linux機器上,使用cron作業來安排executeNotebook操作;在 Windows 計算機上,您可以使用任務計劃程序應用程序。
注意:
要在 ArcGIS Enterprise 中運行此操作,您必須使用 Enterprise 帳戶登錄。您無法使用 ArcGIS Notebook Server 主站點管理員帳戶執行筆記本。
您可以指定執行時要在筆記本中使用的參數。如果您指定了一個或多個參數,它們將作為新單元格插入到筆記本中。該單元格將放置在筆記本的開頭,除非您已將標簽參數添加到單元格中。
Parameter
Description
item
必需
Item
。打開現有的門戶項目。update_portal_item
可選布爾值。指定是否要在執行後更新筆記本的門戶項目。默認為 true。當您正在執行的筆記本包含需要更新的信息(例如收集最新版本的數據集的工作流)時,您可能需要指定 true。如果筆記本在執行後不會存儲任何新信息,例如通過電子郵件向不活動用戶發送提醒的管理筆記本,則更新門戶項目可能並不重要。
parameters
可選列表。要添加到筆記本以執行此執行的可選參數數組。這些參數將作為新單元格直接插入到您標記為
parameters
的單元格之後。用逗號分隔參數。使用數字定義參數時使用格式“x”:1,使用文本字符串定義參數時使用格式“y”:”text”。save_parameters
可選布爾值。指定筆記本參數單元是否應保存在筆記本中以供將來使用。默認為 false。
future
可選布爾值。如果為 True,將返回一個 Job 對象,並且進程不會等待任務完成。默認為False,表示等待結果。
例子:
# Usage Example: >>> from arcgis.gis import GIS >>> 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)
相關用法
- Python ArcGIS power用法及代碼示例
- Python ArcGIS APIKeyManager.get用法及代碼示例
- Python ArcGIS KnowledgeGraph.named_object_type_delete用法及代碼示例
- Python ArcGIS ContentManager.unshare_items用法及代碼示例
- Python ArcGIS ImageryLayer.thumbnail用法及代碼示例
- Python ArcGIS FormFieldElement用法及代碼示例
- Python ArcGIS Geometry.true_centroid用法及代碼示例
- Python ArcGIS Site.delete用法及代碼示例
- Python ArcGIS GeoAccessor.bbox用法及代碼示例
- Python arcgis.apps.hub.Initiative.update用法及代碼示例
- Python ArcGIS generate_service_areas用法及代碼示例
- Python ArcGIS build_overview用法及代碼示例
- Python ArcGIS RunInterval用法及代碼示例
- Python ArcGIS describe_dataset用法及代碼示例
- Python ArcGIS acos用法及代碼示例
- Python ArcGIS Item.publish用法及代碼示例
- Python ArcGIS MapImageLayer.find用法及代碼示例
- Python ArcGIS Group.get_members用法及代碼示例
- Python ArcGIS Geometry.last_point用法及代碼示例
- Python ArcGIS Worker用法及代碼示例
- Python ArcGIS ContentManager.delete_folder用法及代碼示例
- Python ArcGIS train_classifier用法及代碼示例
- Python ArcGIS APIKeyManager.create用法及代碼示例
- Python ArcGIS negate用法及代碼示例
- Python ArcGIS add_image用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis.nb.NotebookManager.execute_notebook。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。