Администрирование ArcGIS Server

Импорт модулей

In [1]:
import arcgis
from arcgis.gis.server import Server
from arcgis.gis.server import SiteManager

Подключение к серверу

In [2]:
server = Server('http://prometheus:6080/arcgis/admin', username='name', password='pass')

Получаем список сервисов

In [3]:
server.services.list()
Out[3]:
[<Service at http://prometheus:6080/arcgis/admin/services/CompositeBatch.GeocodeServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/FindRoutes.GPServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/FindRoutesTomTom.GPServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/footprints.MapServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/gas.MapServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/HexTool.GPServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/ImportCustomers.GPServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/NAVTEQ_base.MapServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/test.MapServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/tracks.MapServer>,
 <Service at http://prometheus:6080/arcgis/admin/services/UniversalGeocoder.GPServer>]

Выбираем определенный сервис

In [5]:
selected = server.services.list()[7]
selected
Out[5]:
<Service at http://prometheus:6080/arcgis/admin/services/NAVTEQ_base.MapServer>

Перезапускаем выбранный сервис. Также есть возможность оставовки/запуска сервиса, удаления, переименования или обновления свойств

In [6]:
selected.restart()
Out[6]:
True

Читаем журналы сервера

In [36]:
server.logs.query();

Подключаемся к сайту

In [40]:
mysite = SiteManager(server)
mysite
Out[40]:
<SiteManager at http://prometheus:6080/arcgis/admin>

Сохранение конфигурации сайта на диск

In [ ]:
mysite.export('d:\site_backup')