Refresh Service

URL:
https://<root>/System/PublishingTools/GPServer/Refresh Service
Methods:
GETPOST
Version Introduced:
10.3

Description

The Refresh Service operation refreshes image services, or the snapshots of map image layers and feature layers, to reflect backend data changes.

When new rasters are added to the backend mosaic dataset of an image service, the image service information may become outdated and need to be refreshed to reflect those changes. While this can be done by restarting the service, many applications require the service to run without downtime.

The Refresh Service operation refreshes a service to reflect data changes without restarting the service, and once the refresh is complete the new rasters in the mosaic dataset are immediately accessible to clients. Optionally, the service publisher can advertise the changes to in-use clients through other mechanisms, such as WebSocket.

A typical live image service involves the following configuration:

  • For the initial configuration, the service publisher prepares a mosaic dataset in SDE and publishes as an image service.
  • The image service is configured with the hasLiveData property set as true.

For routine updates, a monitoring program can be used to recognize when new data is available. The program can either monitor the incoming data folder, or be notified by other data processing scripts when new data is added to the backend mosaic dataset.

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.

Example

Use dark colors for code blocksCopy
1
serviceFolder=Hosted

refreshOptions

A set of additional options for the request. At this time, no options are available or supported.

returnZ

(Optional)

A Boolean that determines if z-values are included as part of the result. If true, z-values will be included in the results if the features have z-values. Otherwise, z-values will not be returned. The default is false.

Values: true | false

returnTrueCurves

(Optional)

A Boolean that specifies whether true curves will be returned in the output geometries (true). When false, curves will be converted to densified polylines or polygons. The default value is false.

Values: true | false

simplifyFeatures

(Optional)

A Boolean that specifies whether geometries should be simplified (true). Simplifying can siginificantly reduce the size of the response while fulfiling the accuracy needs for most analysis, espeically for complex and large geometries. The default value is false.

Values: true | false

context

(Optional)

Additional settings that affect the result of the operation:

  • outSR is the spatial reference of the output geometries.
  • processSR is the spatial reference that the model will use to perform geometry operations.
  • extent will only process features that overlap the specified extent. The output features will have an extent that is the same or larger than the extent value.

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following are sample requests (GET and POST) for the Refresh Service operation:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Refresh%20Service/submitJob?serviceName=My_Service_Name&serviceType=ImageServer&serviceFolder=MY_Service_Folder&refreshOptions=&returnZ=false&returnM=false&returnTrueCurves=false&simplifyFeatures=true&context=&f=pjson

JSON Response example

When the Refresh Service job request is submitted, the following JSON response is returned:

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "j5f3aa768e0a24dcfbdff45f379870553",
  "jobStatus": "esriJobSubmitted"
}

The value for jobId can be appended to a modified version of the request URL (shown below) to access the job resource:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/System/PublishingTools/GPServer/Refresh%20Service/jobs/j5f3aa768e0a24dcfbdff45f379870553?f=pjson

The job resource can be polled to check the status of the Refresh Service job.

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