ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

ListDataStoreItems

  • Summary
  • Syntax
  • Code sample

Summary

Returns a list of the folders or databases registered with an ArcGIS Server site.

Syntax

ListDataStoreItems (connection_file, datastore_type)
ParameterExplanationData Type
connection_file

An ArcGIS Server connection file (.ags) for the server whose registered databases or folders you want to list. If you've made a connection in the Catalog window of ArcMap, 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 that you want to list.

  • DATABASE —Enterprise databases registered with the server will be listed.
  • FOLDER —File-based data sources registered with the server will be listed.
String

Return Value

Data TypeExplanation
String

Returns the registered folders or databases as a list of lists of strings in the format [store_name, server_data, publisher_data, type].

  • store_name—The alias of the folder or database as it is registered with the ArcGIS Server site.
  • server_data—When listing folders, the path to the folder as seen by the server. When listing databases, the connection properties as seen by the server.
  • publisher_data—When listing folders, the path to the folder as seen by the publisher's machine. When listing databases, the connection properties as seen by the publisher's machine.
  • type—If the publisher's machine and the server read the data out of the same physical location, this is shared. If the publisher and server read the data out of different physical locations, this is replicated. If the data location is registered as ArcGIS Server's Managed Database, this is managed.

Code sample

ListDataStoreItems example

Prints all folders registered with the ArcGIS Server site.

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")

Related topics

  • AddDataStoreItem
  • RemoveDataStoreItem
  • ValidateDataStoreItem

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal