Following the 1.3 documentation, there is a arcgis.gis.server submodule nested under arcgis.gis.
However when I try use it, I get an error saying "`arcgis.gis` has no attribute `server`". Souce code as shown below.
>>> import arcgis
And as suggested in this post, I tried with importing arcgis.gis. But same error occured.
>>> from arcgis importgis
Any help would be greatly appreciated.
Spencer and Joshua,
Thank you for your comment/reply on using the Server class.
Here is the best way to access your server:
gis = GIS(url="https://mysite.com/portal", username='*****')
servers = gis.admin.servers.list()
Andrew, the OP never stated whether the desired connection was to a federated or unfederated server, my guess is the latter.
What's new in version 1.3
- Added support for unfederated ArcGIS Server instances from the
I can't speak for others, but reading that strongly implies to me that one should use arcgis.gis.server when connecting to an unfederated GIS server. Furthermore, the documentation for arcgis.gis module — arcgis 1.4.0 documentation doesn't mention anything about connecting to an unfederated GIS server. I have discovered, through trial and error, that I can use the unfederated server's administrator REST endpoint (/arcgis/admin) to connect using the GIS class.
If the ArcGIS API for Python team wants users to use GIS as the starting point, it would be helpful to clarify and/or expand the documentation to point users in that direction.
Here is one method I have tried (edited to remove redundant code)
from arcgis.gis import server
url = r"https://<server>.<domain>.org:6443/arcgis/admin/"
srv = server.catalog.ServicesDirectory(url,username="<usr>",password="<pw>")