Frequently asked question
When sharing data to ArcGIS Enterprise as a referenced feature layer for offline use by enabling the sync capability from ArcGIS Pro, users have the following options to specify the version creation behavior, as shown in the next image:
The version creation option determines whether or not a new version will be created whenever the data is taken offline.
In some cases, a user may want to get a report on what version creation option has been set for each of the published services in the ArcGIS Enterprise deployment. Using the ArcGIS API for Python we can iterate over the services published to a server and get the current syncVersionCreationRule property value for each feature service. The syncVersionCreationRule indicates what version creation option has been configured for the published service.
The below sample script can be used to print the syncVersionCreationRule property for each service in ArcGIS Enterprise:
from arcgis.gis import GIS
gis = GIS("https://machine.domain/webadaptor", "userName", "password")
gis_servers = gis.admin.servers.list()
server = gis_servers[0]
services = server.services.list(folder='/')
for service in services:
serviceUrl = service.url
serviceName = service.properties.serviceName
for extension in service.extensions:
if extension.typeName == 'FeatureServer':
properties = extension.properties
if 'syncVersionCreationRule' in properties.keys():
syncVersionCreationRule = properties['syncVersionCreationRule']
print("Version create option for {0} is: {1}".format(serviceName, syncVersionCreationRule))
The script can be run by copying and pasting the sample code into a Python IDE such as PyCharm or a new Notebook in ArcGIS Pro. An example Notebook is shown in the next image.
Details on how to create a Notebook in ArcGIS Pro can be found in this reference: Notebooks in ArcGIS Pro
Get help from ArcGIS experts
Download the Esri Support App