本文简要介绍 python 语言中 arcgis.gis._impl._datastores.PortalDataStore.register
的用法。
用法:
register(item, server_id, bind=False)
返回:
指示成功 (True) 或失败 (False) 的布尔值
register
方法允许已添加到企业门户的数据存储Item
注册到企业服务器。注意:
在注册数据存储
Item
之前,建议您在服务器上validate()
。Parameter
Description
item
所需的数据存储
Item
或项目 ID 字符串。注意:数据存储
Item
可以在多个服务器上注册。server_id
必需的字符串。您想要向其注册数据存储项的服务器的唯一 ID。
bind
可选布尔值。指定是否将数据存储项绑定到联合服务器。有关将数据存储绑定到其他联合服务器的更多信息,请参阅下面的注释。默认值为
False
。例子:
# Usage Example: adding data store item sourced by an enterprise # geodatabase and registering with server >>> # Get the server id value for registration >>> servers_dict = gis.admin.federation.servers >>> server_list = servers_dict["servers"] >>> host_id = [srvr["id"] >>> for srvr in server_list >>> if srvr["serverRole"] == "HOSTING_SERVER"][0] >>> >>> # Get the host server's DataStoreManager to create an >>> # encrypted password string for the database >>> host = gis.admin.servers.get(role="HOSTING_SERVER")[0] >>> host_dsmgr = host.datastores >>> conn_file_sql = r"/pathway/to/connection_file/your_connection.sde" >>> conn_string = host_dsmgr.generate_connection_string(conn_file_sql) >>> >>> # Add the data store item to the Enterprise Portal >>> text_param = {"info": {"isManaged": "false", >>> "dataStoreConnectionType": "shared", >>> "connectionString": conn_string}, >>> "type": "egdb", >>> "path": "/enterpriseDatabases/sql_server_datastore"} >>> item_properties = {"title": "SqlServer Datastore Item API", >>> "type": "Data Store", >>> "tags": "api_created,datastore_item,bulk_publishing", >>> "snippet": "Adding a datastore item to use api for management."} >>> >>> ds_item = gis.content.add(item_properties=item_properties, >>> text=text_param) >>> >>> # Get the Enteprises PortalDataStore and register with the server >>> portal_ds = gis.datastore >>> >>> portal_ds.register(item=ds_item, >>> server_id=host_id, >>> bind=False)
注意:
要从先前在企业服务器中注册的数据存储创建数据存储
Item
,请参阅企业门户文档中的Create a data store item from an existing data store 页面。
相关用法
- Python ArcGIS PortalDataStore.refresh_server用法及代码示例
- Python ArcGIS PortalDataStore.unregister用法及代码示例
- Python ArcGIS PortalDataStore.servers用法及代码示例
- Python ArcGIS PortalDataStore.describe用法及代码示例
- Python ArcGIS PortalDataStore.layers用法及代码示例
- Python ArcGIS PortalDataStore.validate用法及代码示例
- Python ArcGIS PortalDataStore.publish用法及代码示例
- Python ArcGIS PortalDataStore.delete_layers用法及代码示例
- 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.register。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。