Summary
Returns a list of the folders or databases registered with an ArcGIS Server site.
Syntax
ListDataStoreItems (connection_file, datastore_type)
Parameter | Explanation | Data Type |
connection_file | For a hosting server, provide the server URL or use the MY_HOSTED_SERVICES keyword. For a stand-alone server, an ArcGIS Server connection file (.ags) representing the server with which you want to register the data. | String |
datastore_type | The type of data that you want to list.
| String |
Data Type | Explanation |
String | Returns the registered folders or databases as a list of lists of strings in the format [store_name, server_data, publisher_data, type].
|
Code sample
Prints all folders registered with the ArcGIS Server site (a stand-alone server).
import arcpy
print("Registered FOLDER items are:")
for item in arcpy.ListDataStoreItems("GIS Servers/MyConnection.ags", "FOLDER"):
print("Name: {}".format(item[0]))
print("Server's path: {}".format(item[1]))
print("Publisher's path: {}".format(item[2]))
if item[3] == "managed":
print("This is ArcGIS Server's Managed Database")
Prints all databases registered with the ArcGIS Server site (a stand-alone server).
import arcpy
print("Registered databases items are:")
for item in arcpy.ListDataStoreItems("MY_HOSTED_SERVICES", "DATABASE"):
print("Name: {}".format(item[0]))
print("Database Connection Properties for Server: {}".format(item[1]))
print("Database Connection Properties for Publisher: {}".format(item[2]))
if item[3] == "managed":
print("This is ArcGIS Server's Managed Database")