本文簡要介紹 python 語言中 arcgis.gis.ContentManager.create_service
的用法。
用法:
create_service(name, service_description='', has_static_data=False, max_record_count=1000, supported_query_formats='JSON', capabilities=None, description='', copyright_text='', wkid=102100, create_params=None, service_type='featureService', owner=None, folder=None, item_properties=None, is_view=False, tags=None, snippet=None, item_id=None)
返回:
如果成功創建,則為服務的
Item
;如果不成功,則為 None。
create_service
方法在門戶中創建服務。有關調用create_service
時傳遞的參數列表,請參見下表。Parameter
Description
name
必需的字符串。服務的唯一名稱。
service_description
可選字符串。服務說明。
has_static_data
可選的布爾值。指示數據是否可以更改。默認為 True,不允許更改數據。
max_record_count
可選整數。查詢操作中的最大記錄數。
supported_query_formats
可選字符串。返回查詢結果的格式。
capabilities
可選字符串。指定服務能力。如果未指定,則“Image,Catalog,Metadata,Download,Pixels”用於影像服務,“Query”用於要素服務,否則“Query”
description
可選字符串。對已發布數據集的用戶友好說明。
copyright_text
可選字符串。與數據集關聯的版權信息。
wkid
可選整數。服務的空間參考的眾所周知的 id (WKID)。添加到托管要素服務的所有圖層都需要為要素服務定義相同的空間參考。在未指定空間參考的情況下創建新的空服務時,托管要素服務的空間參考將設置為添加到該要素服務的第一個圖層。
create_params
可選字典。將所有create_service 參數添加到字典中。如果使用此參數,則忽略以上所有參數。
service_type
可選字符串。要創建的服務類型。當前選項是 imageService 或 featureService。
owner
可選字符串。正在創建的服務的所有者的用戶名。
folder
可選字符串。在其中創建服務的文件夾的名稱。
item_properties
可選字典。有關鍵和值,請參見下文
is_view
可選的布爾值。指示服務是否為托管要素圖層視圖
item_id
可選字符串。在ArcGIS Enterprise 10.8.1+ 中可用。在ArcGIS Online 中不可用。此參數允許在創建期間指定所需的項目 ID,這對於克隆和自動內容創建方案很有用。指定的 id 必須是 32 個字符的 GUID 字符串,沒有任何特殊字符。
如果
item_id
已被使用,則會在add
過程中引發錯誤。示例:item_id=9311d21a9a2047d19c0faaebd6f2cca6
tags
可選字符串。以逗號分隔值或字符串列表形式列出的標簽。用於搜索項目。
snippet
可選字符串。提供項目內容的簡短摘要(最多 250 個字符)。
參數item_properties的鍵:值字典選項
Key
Value
type
可選字符串。表示項目的類型,有效值請參見下麵的 URL 1。
typeKeywords
可選字符串。提供所有 sub-types 的列表,請參閱下麵的 URL 1 以獲取有效值。
description
可選字符串。項目的說明。
title
可選字符串。項目的名稱標簽。
url
可選字符串。基於 URL 的項目的 URL。
tags
可選字符串。以逗號分隔值或字符串列表形式列出的標簽。用於搜索項目。
snippet
可選字符串。提供項目內容的簡短摘要(最多 250 個字符)。
extent
可選字符串。為 min x、min y、max x、max y 提供逗號分隔的值。
spatialReference
可選字符串。項目所在的坐標係。
accessInformation
可選字符串。有關內容來源的信息。
licenseInfo
可選字符串。有關內容的任何許可信息或限製。
culture
可選字符串。地區、國家和語言信息。
access
可選字符串。有效值為 private、shared、org 或 public。
commentsEnabled
可選的布爾值。默認為 true,控製評論是允許 (true) 還是不允許 (false)。
culture
可選字符串。語言和國家信息。
例子:
# Usage Example >>> gis.content.create_service("Hurricane Collection")
相關用法
- Python ArcGIS ContentManager.create_folder用法及代碼示例
- Python ArcGIS ContentManager.can_delete用法及代碼示例
- Python ArcGIS ContentManager.clone_items用法及代碼示例
- Python ArcGIS ContentManager.unshare_items用法及代碼示例
- Python ArcGIS ContentManager.delete_folder用法及代碼示例
- Python ArcGIS ContentManager.replace_service用法及代碼示例
- Python ArcGIS ContentManager.advanced_search用法及代碼示例
- Python ArcGIS ContentManager.share_items用法及代碼示例
- Python ArcGIS ContentManager.rename_folder用法及代碼示例
- Python ArcGIS ContentManager.add用法及代碼示例
- Python ArcGIS ContentManager.search用法及代碼示例
- Python ArcGIS ContentManager.bulk_update用法及代碼示例
- Python ArcGIS ContentManager.delete_items用法及代碼示例
- Python ArcGIS ContentManager.generate用法及代碼示例
- Python ArcGIS ContentManager.analyze用法及代碼示例
- Python ArcGIS ContentManager.is_service_name_available用法及代碼示例
- Python ArcGIS Country.enrich用法及代碼示例
- Python ArcGIS Country.subgeographies用法及代碼示例
- Python ArcGIS Country.enrich_variables用法及代碼示例
- Python ArcGIS Country.travel_modes用法及代碼示例
- Python ArcGIS CiscoEdgeIntelligence用法及代碼示例
- Python ArcGIS CategoryManager.add用法及代碼示例
- Python ArcGIS CreditManager用法及代碼示例
- Python ArcGIS CategorySchemaManager.delete用法及代碼示例
- Python ArcGIS CertificateManager.delete用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis.ContentManager.create_service。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。