ValidateDataStoreItem

Synthèse

Validates whether a folder or database has been successfully registered with an ArcGIS Server site.

Syntaxe

ValidateDataStoreItem (connection_file, datastore_type, connection_name)
ParamètreExplicationType de données
connection_file

For a hosting server, provide the server URL or use the MY_HOSTED_SERVICES keyword. For a stand-alone server, use an ArcGIS Server connection file (.ags) representing the server with which you want to register the data.

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
Valeur renvoyée
Type de donnéesExplication
String

If the data store item is valid, returns valid; if invalid, returns invalid.

Exemple de code

ValidateDataStoreItem example

Prints the validity of all folders and databases registered with an ArcGIS Server site.

import arcpy

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

Rubriques connexes