Created
March 14, 2024 21:58
-
-
Save jtroe/dfad2144f8accbb200755244315bb13e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| portal = arcgis.GIS(profile='my_portal') | |
| server = portal.admin.servers.list()[0] | |
| svc = server.services.list(folder='Hosted')[0] | |
| datastore_name = svc.properties.jsonProperties.adminServiceInfo.database.datasource.name | |
| datastore = server.datastores.list()[0] # instead search by datastore_name | |
| # if it's a database | |
| jdbc_server = datastore.properties.info.JDBCConnection.url | |
| jdbc_username = datastore.properties.info.JDBCConnection.username | |
| # datastore.properties.info.filePath if it's not a database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment