2

Is it possible to retrieve a list of REST Services from an ArcGIS Server along with their MXD, and data sources (DB)??

I am using ArcGIS Enterprise 10.7.1

1
  • The MXD and data sources drill pretty far into the weeds, but the list of services is just https://server:port/arcgis/admin/services{/foldername} with a URLEncoded token=... and f=pjson.
    – Vince
    Commented Oct 25, 2019 at 18:25

1 Answer 1

1

You can get a list of layers from the root endpoint of an ArcGIS Server: http://server/arcgis/rest/services?f=pjson

"services": [
  {
   "name": "addressLocator",
   "type": "GeocodeServer"
  },
  {
   "name": "MyMap",
   "type": "MapServer"
  },

If you want the layers that make up the service, you'll need to drill in to each service individually: http://server/arcgis/rest/services/ServiceName/MapServer?f=pjson

"layers": [
  {
   "id": 0,
   "name": "Layer 1",
   "parentLayerId": -1,
   "defaultVisibility": false,
   "subLayerIds": null,
   "minScale": 2311168,
   "maxScale": 0
  },
  {
   "id": 1,
   "name": "Layer 2",
   "parentLayerId": -1,
   "defaultVisibility": false,
   "subLayerIds": null,
   "minScale": 2311168,
   "maxScale": 0
  },

If you want the mxd the service comes from, you're out of luck when using the REST end point. The best you can do is make use of the Admin end point (which requires credentials) and you can get the MSD that powers the service. https://server/arcgis/admin/services/ServiceName.MapServer

  "properties": {
"c:\\arcgiserver\\directories\\arcgissystem\\arcgisinput\\ServiceName.MapServer\\extracted\\v101\\ServiceName.msd",

So you'd need access to the server itself to get real data information. You can't get access to this file through a HTTP request. However, if you can get on the server, you should be able to use that file to start looking for where the data comes from.

However, if you have Admin credentials, you can login to Manager and see the workspaces that a service uses. So Manager will give you insight into where the data is coming from (fGDB, Enterprise geodatabase, etc)

1
  • Thanks for answer. I have a lot of services running. I need a python script which can get a list of all services and thier MXD, that is pulished from, plus the root of data something like this: MXD : \\webgis\ArcGIS MXD\01-Beboet Enheder.MXD source: [email protected]/GeoData.ADMINISTRATION.Beboet
    – Azad. P
    Commented Oct 25, 2019 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.