ArcGIS includes the ArcPy site package that you can use for managing data store items and publishing service definitions with Python.
ArcPy complements the server administration operations in the ArcGIS REST API. For example, using ArcPy, you can convert map documents into service definitions and upload them to the server, change the paths of layers in a map document, or even add additional layers and then publish a service.
Here are some ways you can use ArcPy with ArcGIS Server:
- Register databases and folders with ArcGIS Server.
- Analyze your map documents and create a service definitions out of them.
- Analyze your imagery or geoprocessing model results and create service definitions from them.
- Publish a service definition as an ArcGIS Server service.
- Publish all service definitions in a folder to ArcGIS Server.
See the code examples in this help book to learn how to work with services using ArcPy.