Service list Empty?

464
5
10-04-2017 10:43 AM
JamesGustine
New Contributor III

Running to another roadblock playing around with this API. 

This gets me a list of servers nicely...

 gis_servers = gis.admin.servers.list()

This gets me at the server I want...

dev = gis_servers[0]

This validates to True nicely..

gis.admin.servers.validate()

I can check if a service exists...

>>> dev.services.exists("rwpc", "rwpc_auditissues", "MapServer")
True

but this returns an empty list?

>>> dev.services.list()
[]

I need the list to get the service object, so I can start, stop, delete, etc.

Anyone see this on thier end?

I have a freshly upgraded API and am connected with an Admin account. 

 Thanks in advance....again. 

James

0 Kudos
5 Replies
AndrewChapkowski
Esri Regular Contributor

What version of Server/Portal are you using?

Thanks

0 Kudos
JamesGustine
New Contributor III

10.4.1

0 Kudos
SandeepKuniel1
New Contributor III

In 10.6 calling the list throws an exception

agsServiceManager=agsServer.services
agsServiceManager.list()
Traceback (most recent call last):
File "C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\server\_common\_base.py", line 83, in __getattr__
return self._properties.__getitem__(name)
File "C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_mixins.py", line 340, in __getitem__
return self._mapping[key]
KeyError: '_services_list'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\server\admin\_services.py", line 124, in list
return self._services_list
File "C:\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\server\_common\_base.py", line 88, in __getattr__
raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name))
AttributeError: 'ServiceManager' object has no attribute '_services_list'

0 Kudos
AtmaMani
Esri Contributor

This issue was fixed in version 1.3 (released in mid Dec 2017). Could you upgrade the arcgis package and try again? Install and set up | ArcGIS for Developers 

SandeepKuniel1
New Contributor III

Wonderful Atma Mani, that seems to have worked, took me some time to get upgraded to 1.3, had to do a manual install:)

0 Kudos