507 lines
14 KiB
JSON
507 lines
14 KiB
JSON
[
|
|
{
|
|
"id": "f6f2187d.f17ca8",
|
|
"type": "tab",
|
|
"label": "Data Processing",
|
|
"disabled": false,
|
|
"info": " - Reads the ingested/downloaded data\n - Adds division information to each group\n - Calculates the total archive volume for a division\n - Handles error in a detailed way"
|
|
},
|
|
{
|
|
"id": "2d3b86fbe21570a6",
|
|
"type": "tab",
|
|
"label": "Data Ingest",
|
|
"disabled": false,
|
|
"info": " - Downloads the group data from the metabase server in form of a json file\n - Sets a link to this downloaded file for further reference\n - Handles errors that occur during the download process",
|
|
"env": []
|
|
},
|
|
{
|
|
"id": "c87ef57b2517bbd5",
|
|
"type": "global-config",
|
|
"env": [],
|
|
"modules": {}
|
|
},
|
|
{
|
|
"id": "3cc11d24.ff01a2",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "WARNING: please check you have started this container with a volume that is mounted to /data\\n otherwise any flow changes are lost when you redeploy or upgrade the container\\n (e.g. upgrade to a more recent node-red docker image).\\n If you are using named volumes you can ignore this warning.\\n Double click or see info side panel to learn how to start Node-RED in Docker to save your work",
|
|
"info": "\nTo start docker with a bind mount volume (-v option), for example:\n\n```\ndocker run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red\n```\n\nwhere `/home/user/node_red_data` is a directory on your host machine where you want to store your flows.\n\nIf you do not do this then you can experiment and redploy flows, but if you restart or upgrade the container the flows will be disconnected and lost. \n\nThey will still exist in a hidden data volume, which can be recovered using standard docker techniques, but that is much more complex than just starting with a named volume as described above.",
|
|
"x": 350,
|
|
"y": 80,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "732389b81410a14f",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Inputdefinition",
|
|
"info": "# Definition der Inputquellen",
|
|
"x": 130,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "10a15fe29b7bbd63",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get p-Groupinfos",
|
|
"info": "Read p-group information from metabase. \nThis is ownerGroup and copies. You get\nit in json format.",
|
|
"x": 340,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "6bb0a9c575f23c40",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get a-Groupinfos",
|
|
"info": "Read a-group information from metabase. \nThis is ownerGroup and copies. You get\nit in json format.",
|
|
"x": 580,
|
|
"y": 260,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "d8e7dea75d135eef",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Total Archived Volume",
|
|
"info": "Calculate the total volume of all the \narchived data.",
|
|
"x": 160,
|
|
"y": 380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "44bed35c7d56824d",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get p-Group Division",
|
|
"info": "To each p-group get the according division\nwhich is the same as the payment unit.",
|
|
"x": 440,
|
|
"y": 380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "6d8993194484d836",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Get a-Group Division",
|
|
"info": "To each a-group get the according division\nwhich is the same as the payment unit.",
|
|
"x": 720,
|
|
"y": 380,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "339116af234ce323",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Assign Division",
|
|
"info": "To each archive group assign the\nright division.",
|
|
"x": 160,
|
|
"y": 500,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "b01709df41cdc5a4",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Calculate Division Archivevolume",
|
|
"info": "For each division calculate the total\nvolume of the archived data.",
|
|
"x": 430,
|
|
"y": 500,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "9e16c8b2a2782747",
|
|
"type": "comment",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Store Result",
|
|
"info": "Store the result in a json file by\npreserving previous calculated values.",
|
|
"x": 730,
|
|
"y": 500,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "e06ddee93749c977",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 2",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "false",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 560,
|
|
"y": 1100,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "a918100ba6063585",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 240,
|
|
"y": 620,
|
|
"wires": [
|
|
[
|
|
"fb9ff82281dc83e0"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "e8f1570441f300ee",
|
|
"type": "json",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Convert JSON text to JSON obejct",
|
|
"property": "payload",
|
|
"action": "",
|
|
"pretty": false,
|
|
"x": 840,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"8f50bc0cb9009461"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "69cad106adee2e2e",
|
|
"type": "function",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "function 2",
|
|
"func": "if (Array.isArray(msg.payload)) {\n msg.payload = msg.payload.map(item => {\n return {\n ...item,\n // Wir nutzen 'ownerGroup', weil 'id' in deinen Daten fehlt\n \"tralala\": \"tralala-\" + item.ownerGroup || \"n/a\" \n };\n });\n}\nreturn msg;",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 340,
|
|
"y": 1100,
|
|
"wires": [
|
|
[
|
|
"e06ddee93749c977"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "fb9ff82281dc83e0",
|
|
"type": "exec",
|
|
"z": "f6f2187d.f17ca8",
|
|
"command": "python3 /data/scripts/ad_lookup.py",
|
|
"addpay": "",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "",
|
|
"x": 540,
|
|
"y": 620,
|
|
"wires": [
|
|
[
|
|
"dd3574493b97a5f4"
|
|
],
|
|
[
|
|
"444c29de997bd1b6"
|
|
],
|
|
[]
|
|
]
|
|
},
|
|
{
|
|
"id": "426e46f53063d368",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 3",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "false",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1240,
|
|
"y": 620,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "444c29de997bd1b6",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 4",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "false",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 920,
|
|
"y": 700,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "dd3574493b97a5f4",
|
|
"type": "file",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Write the new JSON object to cache",
|
|
"filename": "\"/data/results/\" & $env(\"JSON_CACHE\")",
|
|
"filenameType": "jsonata",
|
|
"appendNewline": true,
|
|
"createDir": false,
|
|
"overwriteFile": "true",
|
|
"encoding": "utf8",
|
|
"x": 970,
|
|
"y": 620,
|
|
"wires": [
|
|
[
|
|
"426e46f53063d368"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "5c695a90a30b61d5",
|
|
"type": "file in",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "Read cached json file",
|
|
"filename": "\"/data/results/\" & $env(\"JSON_CACHE\")",
|
|
"filenameType": "jsonata",
|
|
"format": "utf8",
|
|
"chunk": false,
|
|
"sendError": false,
|
|
"encoding": "utf8",
|
|
"allProps": false,
|
|
"x": 480,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"e8f1570441f300ee"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "6c8e4b6960b242ec",
|
|
"type": "inject",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 200,
|
|
"y": 880,
|
|
"wires": [
|
|
[
|
|
"5c695a90a30b61d5"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "8f50bc0cb9009461",
|
|
"type": "debug",
|
|
"z": "f6f2187d.f17ca8",
|
|
"name": "debug 1",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "false",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1120,
|
|
"y": 880,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "363ce76bec0e6649",
|
|
"type": "comment",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "TODO: Download groupinformation",
|
|
"info": "- Download the available information for each archive group from the metabase server as json file",
|
|
"x": 340,
|
|
"y": 280,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "5c0cb04a9df89849",
|
|
"type": "exec",
|
|
"z": "2d3b86fbe21570a6",
|
|
"command": "cd /data; ln -sf $(ls $BEGIN_NAME_GROUPINFO_JSON_FILE*.json | sort | tail -n 1) $GROUPINFO_JSON_LNK_NAME",
|
|
"addpay": "",
|
|
"append": "",
|
|
"useSpawn": "false",
|
|
"timer": "",
|
|
"winHide": false,
|
|
"oldrc": false,
|
|
"name": "create link to newest archivegroup information json",
|
|
"x": 630,
|
|
"y": 400,
|
|
"wires": [
|
|
[
|
|
"639948c846411d05"
|
|
],
|
|
[
|
|
"78de4d0de4d2af52"
|
|
],
|
|
[
|
|
"639948c846411d05"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "3a5dd77cc1bc7e89",
|
|
"type": "inject",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "",
|
|
"props": [
|
|
{
|
|
"p": "payload"
|
|
},
|
|
{
|
|
"p": "topic",
|
|
"vt": "str"
|
|
}
|
|
],
|
|
"repeat": "",
|
|
"crontab": "",
|
|
"once": false,
|
|
"onceDelay": 0.1,
|
|
"topic": "",
|
|
"payload": "",
|
|
"payloadType": "date",
|
|
"x": 240,
|
|
"y": 400,
|
|
"wires": [
|
|
[
|
|
"5c0cb04a9df89849"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "639948c846411d05",
|
|
"type": "debug",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "end of workflow",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "payload",
|
|
"targetType": "msg",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1000,
|
|
"y": 360,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "becf6cea4027743f",
|
|
"type": "file",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "write log error",
|
|
"filename": "\"/data/\" & $env(\"ERROR_LOGFILE\")",
|
|
"filenameType": "jsonata",
|
|
"appendNewline": false,
|
|
"createDir": false,
|
|
"overwriteFile": "false",
|
|
"encoding": "none",
|
|
"x": 840,
|
|
"y": 540,
|
|
"wires": [
|
|
[
|
|
"2349d802aa58a575"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "78de4d0de4d2af52",
|
|
"type": "change",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "",
|
|
"rules": [
|
|
{
|
|
"t": "set",
|
|
"p": "payload",
|
|
"pt": "msg",
|
|
"to": "$now() & \" - ERROR in node: 'create link to newest archivegroup information'\" & \" - message: \" & payload",
|
|
"tot": "jsonata"
|
|
}
|
|
],
|
|
"action": "",
|
|
"property": "",
|
|
"from": "",
|
|
"to": "",
|
|
"reg": false,
|
|
"x": 620,
|
|
"y": 540,
|
|
"wires": [
|
|
[
|
|
"becf6cea4027743f"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"id": "2349d802aa58a575",
|
|
"type": "debug",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "data ingest error debug",
|
|
"active": true,
|
|
"tosidebar": true,
|
|
"console": false,
|
|
"tostatus": false,
|
|
"complete": "payload",
|
|
"targetType": "msg",
|
|
"statusVal": "",
|
|
"statusType": "auto",
|
|
"x": 1090,
|
|
"y": 540,
|
|
"wires": []
|
|
},
|
|
{
|
|
"id": "02e10d7f4b7f6f40",
|
|
"type": "function",
|
|
"z": "2d3b86fbe21570a6",
|
|
"name": "function 1",
|
|
"func": "node.error(\"Test-Alarm!\", msg);\n",
|
|
"outputs": 1,
|
|
"timeout": 0,
|
|
"noerr": 0,
|
|
"initialize": "",
|
|
"finalize": "",
|
|
"libs": [],
|
|
"x": 640,
|
|
"y": 300,
|
|
"wires": [
|
|
[]
|
|
]
|
|
}
|
|
] |