- URL:http:// <catalog-url>/System/PublishingTools/GPServer/Refresh Service
- Version Introduced:10.3
Refresh Service is a new task in the existing out-of-the-box PublishingTools geoprocessing service used by the service publisher to refresh a GIS service to reflect backend data changes.
At 10.3, only image services are supported by this tool. Valid imput image services must have been configured hasLiveData:true thorugh ArcGIS Server Manager.
Use cases and example workflow
When new rasters are added to the backend mosaic dataset of an image service, the image service info (such as source resolution, spatial extent, multidimensional info and time extent) maybe outdated, and needs to be refreshed to reflect data changes. While this can be done by restarting the service, many applications require the service to run without downtime --- This Refresh Service tool can fullfill this requirement.
A typical "Live Image Service" workflow involves the following:
- The service publisher prepare a mosaic dataset in SDE and publish as an image service. The image service is configured with the following properties: "hasLiveData":"true" through ArcGIS Server Manager.
Routine updates (may be automated):
- A monitoring program knows when new data is available. This can be monitoring an incoming data folder, or notified by other data processing scripts.
- New data is added to the backend mosaic dataset, other necessary processing steps are taken and indexes are rebuilt.You may want to turn off geoprocessing history metadata update if there're a lot of routine updates as otherwise it increases the overhead of using the mosaic dataset.
- If the new rasters alters the mosaic dataset's resolution, extent, time extent, or multidimensional info, RefreshService task needs to be invoked. The service does not need to be restarted and the new rasters in the mosaic dataset are accessible to clients right away.
- Optionally, the service publisher may advertise the changes to in-use clients through other mechanisms (e.g. a websocket).
required.The name of the service
required. The type of the service, e.g. "ImageServer"
The folder that contains the service.
Additional options to refresh the service
Arcpy example (requires publisher/admin privileges):
import arcpy arcpy.ImportToolbox(r'c:\ags\host.ags;System/Publishing Tools') arcpy.PublishingTools.RefreshService("Portland","ImageServer","#","#")
REST example (requires publisher/admin privileges):
Submit job: url: http://localhost:6080/arcgis/rest/services/System/PublishingTools/GPServer/Refresh Service/submitJob post content: serviceName=MY_Service_Name&serviceType=ImageServer&serviceFolder=MY_Service_Folder&f=json&token=My_ags_token Pool job status: url: http://localhost:6080/arcgis/rest/services/System/PublishingTools/GPServer/Refresh Service/jobs/My_job_id post content: f=json&token=My_ags_token