Skip To Content

Cleanup Assets (Feature Service/Layer)

  • URL:https://<featurelayer-url>/cleanupAssets
  • Required Capability:Admin privileges
  • Version Introduced:11.1

Description

The cleanupAssets operation cleans unused assets and reclaims space. As assets are never deleted, they may become unnecessary when the asset map is updated. When an asset map updates, it deletes the last reference from the asset map to a specific asset.

Note:

A user-configurable, periodic task similar to the Directory Cleaner administrator plug-in will perform frequent asset cleanup. As such, the cleanupAssets operation should not need to be invoked on a regular basis.

Unused assets can be purposefully created using the uploadAssets operation. These assets would be added to the asset map at a later time with an applyEdits request. To avoid deleting these assets, the cleanupAssets operation can be used to set a retention period. The retention period limits asset deletion to assets that are older than the specified period, preserving assets that do not exceed the retention period.

Request parameters

ParameterDetails
retentionPeriod

A numerical value representing the retention period. Only unused assets older than this value are deleted.

retentionPeriodUnit

Specifies the units of the retention period.

Values: days | hours | minutes | seconds

f

The response format. The default response format is html.

Values: html | json | pjson

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 | false>",
  "error": {"code": <error code>, "description": "<error description>"}   
}

JSON Response example


{
  "success": "true"
}