Skip To Content
ArcGIS Developers
Dashboard

Refresh Service

  • URL:https://<catalog-url>/System/PublishingTools/GPServer/Refresh Service
  • Version Introduced:10.3

Description

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 back-end data changes.

At 10.3, only image services are supported by this tool. Valid input image services must have been configured as hasLiveData:true through ArcGIS Server Manager Manager.

Use cases and example workflow

When new rasters are added to the back-end mosaic dataset of an image service, the image service information (such as source resolution, spatial extent, multidimensional information, and time extent) may be 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. The RefreshService task can fulfill this requirement.

A typical live image service workflow involves the following the initial configuration and routine updates, which may be automated. For initial configuration, the service publisher prepares a mosaic dataset in SDE and publishes as an image service. The image service is configured with the property hasLiveData set as true.

Four route updates, a monitoring program recognizes when new data is available. It can monitor an incoming data folder or be notified by other data processing scripts. New data is added to the back-end mosaic dataset; other necessary processing steps are taken and indexes are rebuilt.

Note:

You may want to turn off geoprocessing history metadata updates if there are many routine updates; otherwise, it increases the overhead of using the mosaic dataset.

If the new rasters alter the mosaic dataset's resolution, extent, time extent, or multidimensional information, the RefreshService task needs to be invoked. The service does not need to be restarted, and the new rasters in the mosaic datasets are accessible to clients immediately. Optionally, the service publisher can advertise the changes to in-use clients through other mechanisms, such as WebSocket.

Request parameters

ParameterDetails
serviceName

(Required)

The name of the service.

Example

serviceName=Test_Service
serviceType

(Required)

The type of the service.

Values: ImageServer | FeatureServer | MapServer | SceneServer

serviceFolder

The folder that contains the service.

serviceFolder=Hosted
refreshOptions

Additional options to refresh the service.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

Example one: arcpy example

Below is a sample arcpy request. This operation requires either publisher or administrator privileges.

import arcpy
arcpy.ImportToolbox(r'c:\ags\host.ags;System/PublishingTools')
arcpy.PublishingTools.RefreshService("Portland","ImageServer","#","#")

Example two: REST example

Below is a sample REST request. This operation requires either publisher or administrator privileges.

Submit job:
url: https://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: https://localhost:6080/arcgis/rest/services/System/PublishingTools/GPServer/Refresh 
Service/jobs/My_job_id

post content:
f=json&token=My_ags_token