From a5f230ba6ce9880a7a3d3b256e42a96fa1ce6884 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Tue, 2 Mar 2021 11:21:00 +0100
Subject: [PATCH] TMSS-261: added cleanup task/subtask templates, initially
 with no parameters

---
 .../backend/src/tmss/tmssapp/models/scheduling.py    |  2 +-
 .../tmssapp/schemas/subtask_template-cleanup-1.json  | 12 ++++++++++++
 .../tmssapp/schemas/task_template-cleanup-1.json     | 12 ++++++++++++
 .../backend/src/tmss/tmssapp/schemas/templates.json  | 10 ++++++++++
 4 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template-cleanup-1.json
 create mode 100644 SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-cleanup-1.json

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py b/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
index 9535b3c3d97..d5a0964b579 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/models/scheduling.py
@@ -61,7 +61,7 @@ class SubtaskType(AbstractChoice):
         INSPECTION = "inspection"
         QA_FILES = "qa_files" # task which creates "adder" QA h5 file(s) from a MeasurementSet of beamformed data
         QA_PLOTS = "qa_plots" # task which creates "adder" QA plots from an "adder" QA h5 file h5
-        DELETION = "deletion"
+        CLEANUP = "cleanup"
         MANUAL = 'manual'
         OTHER = 'other'
 
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template-cleanup-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template-cleanup-1.json
new file mode 100644
index 00000000000..b0244ed9f92
--- /dev/null
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/subtask_template-cleanup-1.json
@@ -0,0 +1,12 @@
+{
+  "$id":"http://tmss.lofar.org/api/schemas/subtasktemplate/cleanup/1#",
+  "$schema": "http://json-schema.org/draft-06/schema#",
+  "title":"cleanup",
+  "description":"This schema defines the parameters to setup and control a dataproducts cleanup subtask.",
+  "version":1,
+  "type": "object",
+  "properties": {
+  },
+  "required": [
+  ]
+}
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-cleanup-1.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-cleanup-1.json
new file mode 100644
index 00000000000..993e48bf638
--- /dev/null
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/task_template-cleanup-1.json
@@ -0,0 +1,12 @@
+{
+  "$id": "http://tmss.lofar.org/api/schemas/tasktemplate/cleanup/1#",
+  "$schema": "http://json-schema.org/draft-06/schema#",
+  "title": "cleanup",
+  "description": "This schema defines the parameters to setup a dataproduct(s) cleanup task.",
+  "version": 1,
+  "type": "object",
+  "properties": {
+  },
+  "required": [
+  ]
+}
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/templates.json b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/templates.json
index 480d7a4abb7..e0415332592 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/schemas/templates.json
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/schemas/templates.json
@@ -159,11 +159,21 @@
     "template": "subtask_template",
     "type": "ingest"
   },
+  {
+    "file_name": "subtask_template-cleanup-1.json",
+    "template": "subtask_template",
+    "type": "cleanup"
+  },
   {
     "file_name": "task_template-ingest-1.json",
     "template": "task_template",
     "type": "ingest"
   },
+  {
+    "file_name": "task_template-cleanup-1.json",
+    "template": "task_template",
+    "type": "cleanup"
+  },
   {
     "file_name": "reservation_template-reservation-1.json",
     "template": "reservation_template"
-- 
GitLab