ValidateDataStoreItem (arcpy)

摘要

验证文件夹或数据库是否已成功注册至 ArcGIS Server 站点。

讨论

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

语法

ValidateDataStoreItem (connection_file, datastore_type, connection_name)
参数说明数据类型
connection_file

An ArcGIS Server connection file (.ags) for the server whose registered database or folder is being validated. 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 validated.

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

The name by which the folder or database being validated is registered with the ArcGIS Server site.

String
返回值
数据类型说明
String

代码实例

ValidateDataStoreItem 示例

打印在 ArcGIS Server 站点注册的所有文件夹或数据库的有效证明。

import arcpy

conn = "GIS Servers/MyConnection.ags"
for storetype in ["FOLDER", "DATABASE"]:
    print("Validating data store items of type " + storetype)
    for i in arcpy.ListDataStoreItems(conn, storetype):
        validity = arcpy.ValidateDataStoreItem(conn, storetype, i[0])
        print "The data item '" + i[0] + "' is " + validity
    print("")

相关主题

9/15/2013