Cleanup Assets (Feature Service/Layer)
- URL:https://<featurelayer-url>/cleanupAssets
- Required Capability:Admin privileges
- Version Introduced:11.1
Description
The cleanupAssets operation is used to clean up orphaned assets. Because assets are never deleted, they may become orphans when the last reference from the asset map to a specific asset is deleted (i.e., the asset map is updated). In order to reclaim space, these orphan assets need to be cleaned up.
Orphaned assets may also be created on purpose with uploadAssets, to be added to the asset map later during an applyEdits operation. To avoid deleting such assets, a retentionPeriod can be set that limits asset deletion to assets that are older than the retentionPeriod.
A user configurable, periodic task similar to the Directory Cleaner administrator plugin will perform regular asset cleanups, so clients should rarely need to use the cleanupAssets operation.
Request parameters
Parameter | Details |
---|---|
retentionPeriod | A numerical value. Only orphan assets which are older than the retentionPeriod are deleted. |
retentionPeriodUnit | The units of the retention period. Values: days | hours | minutes | seconds |
f | The response format. The default response format is html. Values: html | json |
Example usage
The following is a sample request URL used to access the cleanupAssets endpoint:
https://machine.domain.com/webadaptor/rest/services/City_Park_Assets/FeatureServer/0/cleanupAssets
JSON Response syntax
{
"success":"true"
}
or
{
"success":"false",
"error": {"code": <error code>, "description": "<error description>"}
}
JSON Response example
{
"success":"true"
}