HOW TO

Identify the database source of a service in ArcGIS Enterprise using ArcGIS API for Python

Last Published: August 23, 2022

Summary

A service can be published to ArcGIS Server from multiple sources, for example, from ArcGIS Pro or direct file uploads to Portal for ArcGIS. Refer to ArcGIS Enterprise: Publishing in ArcGIS Enterprise for more information. To identify a database source, users can manually check the manifest.json file in the following directory:

C:\arcgis\arcgisserver\config-store\services\<Service Folder>\<Service Name>\esriinfo\manifest

Another way to identify the database source of a service is using ArcGIS API for Python. This article describes the procedure to identify the database source of a service using a Python script.

Procedure

  1. Import the necessary modules.
from arcgis.gis import GIS
import pprint
  1. Specify the credentials for the portal and connect.
gis = GIS('https://<machine>.<domain>/<web adaptor name>', 'username', 'password', verify_cert=False)
print('Connected')
  1. List the available servers in the portal.
servers = gis.admin.servers.list()
print(servers)
  1. Specify the folder containing the services and select the service. The following example demonstrates the first service in the folder.
server1 = servers[0]
services = server1.services.list(folder="<Folder Name>")
service = services[0]
  1. Get the service information and properties, and return the result in the console.
ii = service.iteminformation
manifest = ii.manifest
pprint.pprint(manifest)

properties = ii.properties
pprint.pprint(properties)

The code block below demonstrates the full working script.

from arcgis.gis import GIS
import pprint

gis = GIS('https://machine.esri.com/portal', 'username', 'password', verify_cert=False)
print('Connected')

servers = gis.admin.servers.list()
print(servers)

server1 = servers[0]
services = server1.services.list(folder="Test_Folder")
service = services[0]

ii = service.iteminformation
manifest = ii.manifest
pprint.pprint(manifest)

properties = ii.properties
pprint.pprint(properties)

Article ID: 000028180

Software:
  • Portal for ArcGIS
  • ArcGIS Server

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options