From 88f7726bdd6a805309fe0a1ce1e898ca818a7a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Fri, 5 May 2023 11:18:20 +0200 Subject: [PATCH] feat(core): improve Purge task documentation --- .../io/kestra/core/tasks/storages/Purge.java | 18 ++++++++++-------- .../core/tasks/storages/PurgeExecution.java | 5 ++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/io/kestra/core/tasks/storages/Purge.java b/core/src/main/java/io/kestra/core/tasks/storages/Purge.java index e70cbf98616..72e773eb89b 100644 --- a/core/src/main/java/io/kestra/core/tasks/storages/Purge.java +++ b/core/src/main/java/io/kestra/core/tasks/storages/Purge.java @@ -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: ", @@ -40,21 +42,21 @@ public class Purge extends Task implements RunnableTask { @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; @@ -66,28 +68,28 @@ public class Purge extends Task implements RunnableTask { private List 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 diff --git a/core/src/main/java/io/kestra/core/tasks/storages/PurgeExecution.java b/core/src/main/java/io/kestra/core/tasks/storages/PurgeExecution.java index eb6b83ffda2..66961a87fb2 100644 --- a/core/src/main/java/io/kestra/core/tasks/storages/PurgeExecution.java +++ b/core/src/main/java/io/kestra/core/tasks/storages/PurgeExecution.java @@ -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 = {