Following this doc here: Managing your GIS servers | ArcGIS Developer
I am trying to build a list of all GIS Servers federated to my Portal. Running Enterprise 1081.
from arcgis.gis import GIS
gis = GIS("http://siteurl.mysite.com/portal", "username")
gis_servers = gis.admin.servers.list()
gis_servers
Gives me this:
[<Server at https://pythonapi.playground.esri.com/server/admin>,
<Server at https://python-ga.playground.esri.com/server/admin>,
<Server at https://python-ra.playground.esri.com/arcgis/admin>]
What I need is the URL for the Server, not the admin endpoint. Looks like the list() method does not provide this. Looking in https://portal.domain.com/arcgis/portaladmin/federation/servers/servername I can see the URL attribute.
Can I get the server URLs using the arcgis python api?
Solved! Go to Solution.
Hi @tigerwoulds ,
Try the script below which gives you both urls:
gis_servers_properties = gis.admin.servers.properties
for server in gis_servers_properties.servers:
print(f"Server URL: {server.url}, Server Admin URL: {server.adminurl}")
Hi @tigerwoulds ,
Try the script below which gives you both urls:
gis_servers_properties = gis.admin.servers.properties
for server in gis_servers_properties.servers:
print(f"Server URL: {server.url}, Server Admin URL: {server.adminurl}")
Thank you much! Worked like a charm.
Not a problem, @tigerwoulds.