AddDataStoreItem (arcpy)

摘要

在 ArcGIS Server 站点注册文件夹或数据库。有关应注册数据的时间和原因,请参阅关于将您的数据注册到服务器

讨论

有关应在 ArcGIS Server 上注册数据的时间和原因,请参阅关于将您的数据注册到服务器

语法

AddDataStoreItem (connection_file, datastore_type, connection_name, server_path, {client_path}, {hostname})
参数说明数据类型
connection_file

An ArcGIS Server connection file (.ags) representing the server with which you want to register the data. If you've made a connection in ArcCatalog you can use the connection file found in your user profile directory. Alternatively, you can create a connection file from scratch using the function CreateGISServerConnectionFile.

String
datastore_type

The type of data being registered.

  • DATABASEThe data resides in an enterprise database.
  • FOLDERThe data is file-based.
String
connection_name

A name for this folder or database that publishers or administrators will see when they view the server properties.

String
server_path

The path or connection to the data as seen by the server.

If you are registering a DATABASE, this is the path to a database connection file (.sde) or a string containing the database connection parameters.

If you are registering a FOLDER, this is the path to the folder.

String
client_path

The path or connection to the data as seen by the publisher's machine, if different from the information used by the server. In some cases the publisher and the server may be referencing physically distinct databases or folders. When you provide the publisher path and the server path, ArcGIS Server automatically corrects the paths at publish time when your map documents and other resources are transferred to the server.

If you are registering a DATABASE, provide the path to a database connection file (.sde) or a string containing the database connection parameters.

If you are registering a FOLDER, provide the path to the folder.

String
hostname

The name of the publisher or client machine that will use this registered folder or database. If left blank, the name of the machine running the script will be used.

String

代码实例

AddDataStoreItem 示例

在 ArcGIS Server 上注册本地文件夹 C:\temp。假设已在 ArcMap 的目录 窗口创建了与服务器的连接,并重命名为 MyConnection。

import arcpy

conn = "GIS Servers/MyConnection.ags"
path = "C:/temp"

print arcpy.AddDataStoreItem(conn, "FOLDER", "My local data folder", path, path)

相关主题

9/15/2013