
Kestra Plugin PurgeAssets
CertifiedPurges assets from the catalog based on retention policies
Kestra Plugin PurgeAssets
Purges assets from the catalog based on retention policies
By default, the task purges assets, asset usage events (execution view), and asset lineage events (for asset exporters) matching the filters. You can configure it to only purge specific types of records. Asset lineage event purging currently does not support filtering by asset ID, type or metadata. Asset usage event purging currently does not support filtering by asset type or metadata.
type: io.kestra.plugin.kestra.ee.assets.PurgeAssetsExamples
Purge old staging tables
id: purge_staging_assets
namespace: company.data
tasks:
- id: cleanup_staging
type: io.kestra.plugin.kestra.ee.assets.PurgeAssets
namespace: company.data
assetType:
- io.kestra.plugin.ee.assets.Table
metadata:
model_layer: staging
endDate: "{{ now() | dateAdd(-90, 'DAYS') }}"
Scheduled retention policy
id: asset_retention_policy
namespace: company.infra
triggers:
- id: monthly_cleanup
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 0 1 * *"
tasks:
- id: purge_old_vms
type: io.kestra.plugin.kestra.ee.assets.PurgeAssets
assetType:
- io.kestra.plugin.ee.assets.VM
endDate: "{{ now() | dateAdd(-180, 'DAYS') }}"
Properties
endDate *Requiredstring
Purge assets created or updated before this date (ISO 8601)
assetId string
Filter assets by id
assetType array
Filter by asset types
auth Non-dynamic
Select API authentication
Use either an API token or HTTP Basic (username/password); do not provide both.
io.kestra.plugin.kestra.AbstractKestraTask-Auth
API token for bearer auth
trueAutomatically retrieve credentials from Kestra's configuration if available
The default configuration can be configured globally inside the Kestra configuration file:
- Set
kestra.tasks.sdk.authentication.api-tokento use an API token - Set
kestra.tasks.sdk.authentication.usernameandkestra.tasks.sdk.authentication.passwordfor HTTP basic authentication The Enterprise edition also provides setting a default configuration at the Namespace of Tenant level by an administrator.
Password for HTTP Basic auth
Username for HTTP Basic auth
kestraUrl string
Override Kestra API endpoint
URL used for calls to the Kestra API. When null, renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.
metadataQuery array
Metadata filters
io.kestra.plugin.kestra.ee.assets.FieldQuery
EQUAL_TONOT_EQUAL_TOnamespace string
Filter assets by namespace
Exact match or prefix with .*
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
purgeAssetLineages booleanstring
trueWhether to purge asset lineage events (for asset exporters) matching the filters
purgeAssetUsages booleanstring
trueWhether to purge asset usage events (execution view) matching the filters
purgeAssets booleanstring
trueWhether to purge assets matching the filters
tenantId string
Override target tenant
Tenant identifier applied to API calls; defaults to the current execution tenant.
Outputs
purgedAssetLineagesCount integer
Number of asset lineages purged
purgedAssetUsagesCount integer
Number of asset usages purged
purgedAssetsCount integer
Number of assets purged