I'd like to test all of my map services to see if the data source was copied to the server of if it's referenced. I haven't found the property in the python API just yet. Does anyone know where to find such a thing?
Solved! Go to Solution.
If you have referenced data in a service, then I assume you have ArcGIS Server so if you were to open Manager, all SOC based services have a Service Workspaces button:
From here, you can see the referenced, replaced, and copied data sets:
If you monitor the HTTP traffic, the request goes to the manifest.xml of the service:
This returns JSON that can be parsed for the information you need:
Ex.
{
"databases": [{
"byReference": false,
"onServerWorkspaceFactoryProgID": "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
"onServerConnectionString": "DATABASE=C:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\pgsde.gdb",
"onPremiseConnectionString": "DATABASE=C:\\arcgisserver_old\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\pgsde.gdb",
"onServerName": "pgsde.gdb",
"onPremisePath": "",
"datasets": [{
"onServerName": "BR"
}]
}],
"resources": [{
"onPremisePath": "C:\\arcgisserver_old\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\S1.mxd",
"clientName": "<client>",
"serverPath": "C:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\S1.msd"
}]
}
The sample above is from a single data source in a referenced geodatabase.
Hi Kevin,
Services that are copied will be placed in the Hosted folder within ArcGIS Server, since they are hosted feature services. You can query to see all the services in this folder:
from arcgis import GIS
gis = GIS(url="https://portal.domain.com/portal", username='admin', password='gis12345', verify_cert=False)
gis_servers = gis.admin.servers.list()
server1 = gis_servers[0]
print(server1.services.list(folder='Hosted'))
Thanks. So what if I have a service that has some data copied to the server, and some data reference to sde that's registered in the datastore? I'd like to be able to get copied/referenced per layer in the service. Any idea on that?
If you have referenced data in a service, then I assume you have ArcGIS Server so if you were to open Manager, all SOC based services have a Service Workspaces button:
From here, you can see the referenced, replaced, and copied data sets:
If you monitor the HTTP traffic, the request goes to the manifest.xml of the service:
This returns JSON that can be parsed for the information you need:
Ex.
{
"databases": [{
"byReference": false,
"onServerWorkspaceFactoryProgID": "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
"onServerConnectionString": "DATABASE=C:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\pgsde.gdb",
"onPremiseConnectionString": "DATABASE=C:\\arcgisserver_old\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\pgsde.gdb",
"onServerName": "pgsde.gdb",
"onPremisePath": "",
"datasets": [{
"onServerName": "BR"
}]
}],
"resources": [{
"onPremisePath": "C:\\arcgisserver_old\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\S1.mxd",
"clientName": "<client>",
"serverPath": "C:\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\S1.MapServer\\extracted\\v101\\S1.msd"
}]
}
The sample above is from a single data source in a referenced geodatabase.
Much thanks! That'll give me a big head start when I get time to jump into this!
Kev