本文簡要介紹 python 語言中 arcgis.gis._impl._datastores.PortalDataStore.describe
的用法。
用法:
describe(item, server_id, path, store_type='datastore')
返回:
StatusJob
對象
describe
方法用於列出作為數據存儲項添加到 Enterprise 的數據存儲的內容。客戶端可以多次使用此方法來逐步發現數據存儲的內容。例如,客戶端可以請求根文件夾的說明,然後請求子文件夾。Parameter
Description
item
必填項目。數據存儲
Item
來說明。server_id
必需的字符串。項目注冊到的服務器的唯一 ID。
注意:您可以從聯合返回的字典中檢索
server_id
值。# Retrieve server ids >>> gis_federation = gis.admin.federation.servers >>> >>> server_list = gis_federation["servers"] >>> server_list >>> >>> [{'id': 'W2ozgK50Le9CjrI4', 'name': 'mymachine.domain.com:6443', 'url': 'https://mymachine.domain.com/mywebadaptor_name', 'isHosted': True, 'adminUrl': 'https://mymachine.domain.com:6443/arcgis', 'serverRole': 'HOSTING_SERVER', 'serverFunction': '', 'webgisServerTrustKey': ''}] >>> >>> host_id = server_list[0]["id"]
path
必需的字符串。任何數據存儲根 (“/”) 的路徑,或根內 sub-folder 或實體的路徑。
store_type
必需的字符串。對於根資源,對象類型應為
datastore
,對於 sub-entities,該值取決於數據存儲的數據類型。可以通過查看describe()
返回的type
值來確定值例子:
# Usage Example: Data store item added using an enterprise geodatabase >>> ds_items = gis.content.search("*", item_type="Data Store") >>> >>> for ds_item in ds_items: >>> print(f"{ds_item.title:33}{ds_item.id}{' '*2}{ds_item.get_data()['type']}") >>> City_Service ea9a628b037........7cf29eda554d3 bigDataFileShare CityParks2 Datastore Item API a188c1f5b42........eb1f8dea03a8e egdb various_imagery c6971f24a25........fe22d7142f835 folder >>> >>> egdb_dsitem = ds_items[1] >>> >>> portal_ds = gis.datastore >>> >>> describe_job = portal_ds.describe(item=egdb_dsitem, server_id=host_id, path="/", store_type="datastore") >>> >>> while describe_job.status == "processing": >>> continue >>> if describe_job.status == "succeeded": >>> describe_egdb = describe_job.result() >>> else: >>> print(f"Job status: {describe_job.status}") >>> print(f"Job messages: {describe_job.messages}") >>> >>> describe_egdb {'id': '6bd436223f2b433285f58cf1df5bccef', 'definition': {'operation': 'describe', 'datastoreId': 'a25ae2f4c4674bf4799eb2f4fdae3b8f', 'serverId': 'K2ozgC10aL6ECdm2', 'path': '/', 'type': 'datastore'}, 'status': 'succeeded', 'created': 166512637...1, 'modified': 16574263...8, 'messages': [], 'result': {'datastore': {'name': 'world_db_0klt50rsl52d4', 'type': 'egdb', 'path': '/', 'datastoreId': 'a25ae2f4c4674bf4799eb2f4fdae3b8f'}, 'children': [{'name': 'world.DATAo.World_Data', 'displayName': 'World_Data', 'type': 'featureDataset', 'datastoreId': 'a25ae2f4c4674bf4799eb2f4fdae3b8f', 'path': '/world.DATAo.World_Data'}, {'name': 'world.DATAo.Forest_Landscapes', 'displayName': 'Forest_Landscapes', 'type': 'featureDataset', 'datastoreId': 'a25ae2f4c4674bf4799eb2f4fdae3b8f', 'path': '/world.DATAo.Forest_Landscapes'}]}} >>> >>> # describe sub-entity of the database data store >>> >>> describe_job_sub = portal_ds.describe(item=egdb_dsitem, server_id=host_id, path="/world.DATAo.Forest_Landscapes'", store_type="featureDataset")
相關用法
- Python ArcGIS PortalDataStore.delete_layers用法及代碼示例
- Python ArcGIS PortalDataStore.register用法及代碼示例
- Python ArcGIS PortalDataStore.unregister用法及代碼示例
- Python ArcGIS PortalDataStore.servers用法及代碼示例
- Python ArcGIS PortalDataStore.layers用法及代碼示例
- Python ArcGIS PortalDataStore.validate用法及代碼示例
- Python ArcGIS PortalDataStore.publish用法及代碼示例
- Python ArcGIS PortalDataStore.refresh_server用法及代碼示例
- Python ArcGIS PortalDataStore.publish_layers用法及代碼示例
- Python ArcGIS PortalDataStore用法及代碼示例
- Python ArcGIS PortalLicense.update用法及代碼示例
- Python ArcGIS PortalAdminManager.mode用法及代碼示例
- Python ArcGIS Polygon.coordinates用法及代碼示例
- Python ArcGIS Point3DLayer用法及代碼示例
- Python ArcGIS Point.coordinates用法及代碼示例
- Python ArcGIS PointCloudLayer用法及代碼示例
- Python ArcGIS Polyline.coordinates用法及代碼示例
- Python ArcGIS PageManager.link用法及代碼示例
- Python ArcGIS Project用法及代碼示例
- Python ArcGIS ProfileManager.create用法及代碼示例
- Python ArcGIS ProfileManager.get用法及代碼示例
- Python ArcGIS PageManager.clone用法及代碼示例
- Python ArcGIS ProfileManager.save_as用法及代碼示例
- Python ArcGIS Page.delete用法及代碼示例
- Python ArcGIS PageManager.add用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis._impl._datastores.PortalDataStore.describe。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。