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
>>> arcgis.gis.server.Server(args)
And as suggested in this post, I tried with importing arcgis.gis. But same error occured.
>>> from arcgis importgis
>>> gis.server.Server(args)
Any help would be greatly appreciated.
Still getting 'folders' key error at v1.3.0
from arcgis.gis import server
url = r"https://<server>.<domain>.org:6443/arcgis/admin/
site = server.Server(url,username="<usr>",password="<pw>")
srvdir = site.content
#Will return a MapImage layer
queries = srvdir.get("<name>",folder="<folder>")
srvdir = server.ServicesDirectory(url,username="<usr>",password="<pw>")
#returns error
srvdir.get("<name>",folder="<folder>")
...
KeyError: 'folders'
I suppose i'll try to upgrade to 1.4...
For anyone trying to get at the service object, this worked for me at 1.4:
from arcgis.gis import server
url = r"https://<server>.spokanecounty.org:<port>/arcgis/admin/"
site = server.Server(url,username="<usr>",password="<pw>")
admin = site.content.admin adminServices = admin.services
servicelist = adminServices.list(folder="<folderName>")
for x in servicelist:
print(x.statistics)