AddDataStoreItem (arcpy)
Resumen
Registers a folder or database with an ArcGIS Server site. See About registering your data with the server to learn more about when and why you should register your data.
Debate
See About registering your data with the server to learn more about when and why you should register your data with ArcGIS Server.
Sintaxis
Parámetro | Explicación | Tipo de datos |
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.
| 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 |
Ejemplo de código
Registers a local folder C:\temp with ArcGIS Server. Assumes that a connection to the server has been created in the Catalog window of ArcMap and renamed MyConnection.
import arcpy
conn = "GIS Servers/MyConnection.ags"
path = "C:/temp"
print arcpy.AddDataStoreItem(conn, "FOLDER", "My local data folder", path, path)