Start/stop service on non-portal site

907
3
Jump to solution
03-01-2018 07:04 AM
ChrisMathers1
Occasional Contributor II

Ok Im tired of trying to figure this out based on the documentation for the API. All I want to do is stop a geocoding service so I can rebuild the locators and then restart it. We are not using portal here. Running the lines below returns "AttributeError: 'Server' object has no attribute 'services'" even though dir(site) shows that "services" is there. I am on v1.3.0 of the API. This is the best result I have gotten. Trying to import arcgis or from arcgis import gis and creating the server object by arcgis.gis.server.Server() always just gets me "AttributeError: module 'arcgis.gis' has no attribute 'server'".

from arcgis.gis import server
site = server.Server(url='',
                     username = '',
                     password='')
site.services.list()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
1 Solution

Accepted Solutions
ChrisMathers1
Occasional Contributor II

I was wrong it does work, just not in Jupyter. I thought I would try Jupyter out since I hadnt really used it much and it turns out it was boggling the module up. So creating a Server object like that works just fine in idle and returns the all of the related classes and methods like it is supposed to.

View solution in original post

3 Replies
RebeccaStrauch__GISP
MVP Emeritus

Being that this is posted in the API site, you probably are looking for that solution, and not an alternative...but just in case the need is more important than the how, have you looked at http://www.arcgis.com/home/item.html?id=12dde73e0e784e47818162b4d41ee340     the "Administrative tools for ArcGIS Server. Stop, start services, change logging, rename a service and more..."

 

ChrisMathers1
Occasional Contributor II

Interesting, I havnt seen this before. I'll dig into it and see if it will work better for me.

0 Kudos
ChrisMathers1
Occasional Contributor II

I was wrong it does work, just not in Jupyter. I thought I would try Jupyter out since I hadnt really used it much and it turns out it was boggling the module up. So creating a Server object like that works just fine in idle and returns the all of the related classes and methods like it is supposed to.