Cleaning up stale applications in Application Engine

There are two ways to clean up stale applications in the Application Engine for Application Designer. You can rely on a scheduled job to periodically delete the applications, or you can use REST API calls.

Deleting stale applications in Application Engine for Application Designer does not delete your application project from Application Designer. Deleting the application frees up resources on the Application Engine. When you preview your application again in Application Designer, your application is republished to the Application Engine for Application Designer.

Scheduled job

To free up resources in the Application Engine for Application Designer, stale applications can be periodically removed based on the following settings in your custom resource YAML file.

bastudio_configuration:
playback_server:
env:
purge_stale_apps_interval:  Interval for the purging job to run.  Default is 86400000 ms.
apps_threshold:  Minimum number of existing applications for job to start purging applications.  Default is 100 applications.
stale_threshold:  Age of the applications to be considered as stale.  Default is 172800000 ms.

REST API

In some scenarios, you might need to manually start application deletion. You can use a REST API call to delete stale applications if your user ID is a member of the administrator group.

Call the REST API PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps

The following examples illustrate how to use the REST API to delete stale applications:
Note: The threshold is in milliseconds.
  • Delete stale applications by using setting the custom resource definition that you configured during installation:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps
  • Delete all applications:
    PUT http://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=0&staleThreshold=0
  • Delete stale applications when the number of applications is over 50 by using the staleThreshold that you configured during installation:
    PUT http://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=50
  • Delete stale applications that were published over an hour ago by using appsThreshold that you configured during installation:
    PUT http://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?staleThreshold=3600000
  • Purge stale applications that were published over an hour ago and when the number of applications is over 50:
    PUT http://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=50&staleThreshold=3600000