For some reason the 2 steps for setting the hosting_server you have didn't work for me. BUT, finally figured out how to get it to work and why the old code doesn't work anymore. I'm at 1.9.1 now. At some point it changed from being able to use the Server object to having to use the ServerManager for federated sites to get the ability to use the list() on services. So instead of the old: gis = GIS(portal_url, user_name, user_pass)
gis_servers = gis.admin.servers.list()
server1 = gis_servers[0] It changed to gis = GIS(portal_url, user_name, user_pass)
server1 = gis.admin.servers.get(role="HOSTING_SERVER")[0]
#note, don't use the .url as that is only a url reference versus the object, but definately use the [0] which isn't in the help as otherwise its just a list. And this is the object so you don't need another line to get it. Finally all my start/stop, response time queries, and other scripts are working again! References: https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html#server https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html#arcgis.gis.server.ServerManager.list
... View more