Just starting to play around with the ArcGIS API for Python. I am stuck trying to call server submodule under the admin module. My install can't seem to find either. Just running thru this code on the reference page doesn't work for me.
from arcgis.gis import GIS gis = GIS("https://portalname.domain.com/portal", "username")gis_servers = gis.admin.servers.list() print (gis_servers)
gis doesn't give me access to an admin propertyAttributeError: 'GIS' object has no attribute 'admin' Any clues as to where I am going wrong here would be awesome. Probably something super simple but thanks in advance. James
Solved! Go to Solution.
Double check which version of the API you are using. The releases come fast enough that I have been tripped up by following the documentation when I forgot to upgrade to the latest version.
My first thought is permissions. What permissions does username have in Portal?
same one, different page, mine is the api reference section
Its an admin account with full rights. Seems to be able to get to and manage portal stuff just can't get the servers. to note:
I'm connecting thru the web adaptor url and the servers are federated. I've tried putting in the FQ server name but that doesn't seem to make a difference.
Thanks.
Double check which version of the API you are using. The releases come fast enough that I have been tripped up by following the documentation when I forgot to upgrade to the latest version.
That did it Josh. Had to run the update from conda
conda upgrade -c esri arcgis
I was trying to upgrade from the python package manager in Pro, but apparently that didn't do it.
Thanks again man.
Where does one enter this? I've tried entering it in the python window and get an "Invalid Syntax" message.
Thank you,
Randy McGregor
You run the command in Command Prompt (Windows) or Terminal (Mac/Linux) after activating the Conda environment that you are using.