- URL:
- https://<adminservicecatalog-url>/services/<serviceName>/FeatureServer/cleanupChangeTracking
- Methods:
POST
- Version Introduced:
- 11.5
Description
The cleanup
operation removes archived entries of changes made to a hosted feature service that fall outside of a specified window of time. Changes made within the specified window are not removed.
Hosted features can be configured to keep track of changes. Operations such as sync and automatic tile generation rely on the archived information that the system maintains. Over time, as edits are applied and the archive grows, the size of the underlying dataset will increase. When running cleanup
, archived entries that are older than a specific date are removed thus reducing the size of the underlying dataset.
In ArcGIS Enterprise, the cleanup
operation is available for hosted feature services running on a relational data store that have Sync
capability enabled.
In ArcGIS Online, the cleanup
operation is available for feature services that have the either the Sync
or Change
capabilities enabled.
Prior to performing this operation, ensure hosted feature services are synced or that older replicas have been removed, including replicas that were not synced prior the start date or time in which archived entries will be removed.
Request parameters
Parameter | Details |
---|---|
| The list of layers and tables in which to run the operation. Syntax
Examples
|
| The period of time, starting from the current moment, in which archived information is maintained. Any changes in the archive that are older than the retention period will be removed. The units of time are defined by the Syntax
|
| The units of time for the Values: |
| Any changes made prior to the time specified by Syntax
Example
|
| A replica ID. Changes for the replica specified in this parameter will be preserved, while all other changes will be removed. |
| This parameter specifies whether the operation will run synchronously or asynchronously. If Values: |
| The response format. The default format is Values: |
Example usage
The following is a sample POST request for the cleanup
operation:
POST /<context>/rest/admin/services/example/FeatureServer/cleanupChangeTracking HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
layers=0&retentionPeriod=15&retentionPeriodUnits=days&async=false&f=json
JSON Response examples
The following response is returned when async
is false
:
{
"success": true
}
When async
is true
, the request is processed as an asynchronous job and the response returns a URL that a client can use to check the job's status:
{
"statusUrl": "https://organization.example.com/<context>/rest/services/Hosted/myservice/FeatureServer/jobs/j085d6261-67b5-42fe-ba1b-41de4fa3903e"
}
The response below is returned from the status
resource once the job has completed successfully:
{
"success": true,
"operationName": "cleanupChangeTracking",
"lastUpdatedTime": 1743396252860,
"serviceName": "Hosted/volcano_roop",
"submissionTime": 1743396250231,
"status": "COMPLETED"
}