Refresh Service

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

Description

Refresh Service is used by the service publisher to refresh a GIS service to reflect back-end data changes.

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.

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

Use dark colors for code blocksCopy
1
serviceName=Test_Service

serviceType

(Required)

The type of the service.

Values: ImageServer | FeatureServer | MapServer | SceneServer

serviceFolder

The folder that contains the service.

Use dark colors for code blocksCopy
1
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.

Use dark colors for code blocksCopy
1
2
3
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.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
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

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.