AGOL data source copied or referenced?

400
4
Jump to solution
05-14-2018 08:29 AM
KevinBell1
New Contributor III

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? 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JonathanQuinn
Esri Frequent Contributor

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:

https://<server>.<domain>.com:6443/arcgis/admin/services/<service>.MapServer/iteminfo/manifest/manif...

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.

View solution in original post

4 Replies
JakeSkinner
Esri Esteemed Contributor

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'))
KevinBell1
New Contributor III

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?

0 Kudos
JonathanQuinn
Esri Frequent Contributor

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:

https://<server>.<domain>.com:6443/arcgis/admin/services/<service>.MapServer/iteminfo/manifest/manif...

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.

KevinBell1
New Contributor III

Much thanks!  That'll give me a big head start when I get time to jump into this!

Kev

0 Kudos