Skip to content

Commit

Permalink
feat(core): improve Purge task documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu authored and tchiotludo committed May 5, 2023
1 parent 6e11a20 commit 88f7726
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
18 changes: 10 additions & 8 deletions core/src/main/java/io/kestra/core/tasks/storages/Purge.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Purge execution, logs or storage files."
title = "Purge executions, logs, metrics, and storage files.",
description = "This task can be used to purge flow executions data for all flows, for a specific namespace, or for a specific flow."
)
@Plugin(
examples = {
@Example(
title = "Purge all flow execution data for flows ended more than one month ago.",
code = {
"endDate: \"{{ now() | dateAdd(-1, 'MONTHS') }}\"",
"states: ",
Expand All @@ -40,21 +42,21 @@
public class Purge extends Task implements RunnableTask<Purge.Output> {
@Schema(
title = "Namespace to purge or namespace for a flow",
description = "If `flowId` isn't provide, this is a namespace prefix, else the namespace of flow"
description = "If `flowId` isn't provided, this is a namespace prefix, else the namespace of the flow."
)
@PluginProperty(dynamic = true)
private String namespace;

@Schema(
title = "The flow id to purge",
description = "You need to provide the `namespace` properties if you want to purge a flow"
description = "You need to provide the `namespace` properties if you want to purge a flow."
)
@PluginProperty(dynamic = true)
private String flowId;

@Schema(
title = "The max date to purge",
description = "All date after this date will be purged."
description = "All data of flows executed before this date will be purged."
)
@PluginProperty(dynamic = true)
private String endDate;
Expand All @@ -66,28 +68,28 @@ public class Purge extends Task implements RunnableTask<Purge.Output> {
private List<State.Type> states;

@Schema(
title = "Purge execution from repository"
title = "Purge executions from the repository."
)
@PluginProperty
@Builder.Default
private boolean purgeExecution = true;

@Schema(
title = "Purge log from repository"
title = "Purge logs from the repository."
)
@PluginProperty
@Builder.Default
private boolean purgeLog = true;

@Schema(
title = "Purge metric from repository"
title = "Purge metrics from the repository."
)
@PluginProperty
@Builder.Default
private boolean purgeMetric = true;

@Schema(
title = "Purge file from internal storage"
title = "Purge files from the internal storage."
)
@PluginProperty
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
@NoArgsConstructor
@Schema(
title = "Purge all files from the internal storage created by this execution.",
description = "Will delete all the generated files from a flow for this current execution. This will delete:\n+" +
description = "Will delete all the generated files from a flow for this current execution. This will delete all files from:\n+" +
"- inputs\n" +
"- outputs\n" +
"- triggers\n\n + " +
"If the current execution don't have any generated files, the task will not failed.\n" +
"If you pass an internal storage URI from another execution, it **will not** be deleted, only files from the current execution are deleted."
"If the current execution don't have any generated files, the task will not failed."
)
@Plugin(
examples = {
Expand Down

0 comments on commit 88f7726

Please sign in to comment.