summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@ut.ee>2025-05-05 00:55:07 +0300
committerRasmus Luha <rasmus.luha@ut.ee>2025-05-05 00:55:07 +0300
commitab4d535e4caf1d5fc1ed8097407b13bf8a0d98af (patch)
treed3b325d37823d4ea1ede768bcbb7eeb4adcf7189
parent737f498e1f402a5a41068a37ab20f34cabd4b052 (diff)
fix nifi pipeline deployment
-rw-r--r--.gitignore1
-rw-r--r--config.py12
-rw-r--r--modules/nifi/core.py4
3 files changed, 9 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index cc1f513..262d871 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
TODO.txt
pipelines/*
venv/
+generate_pipelines.py
__pycache__/
diff --git a/config.py b/config.py
index a2911a5..e1a34e1 100644
--- a/config.py
+++ b/config.py
@@ -1,22 +1,22 @@
INTERACTIVE_MODE=False
-#PLATFORM="Nifi"
+PLATFORM="Nifi"
#### Nifi ####
NIFI_HOST="https://127.0.0.1.nip.io"
-NIFI_DEPLOY=False
+NIFI_DEPLOY=True
NIFI_USER="lab08nifiuser"
NIFI_PASS="tartunifi2023"
-MEASUREMENT_NAME="test_measurementName"
+MEASUREMENT_NAME="Ateena_ilm"
## Database
#DB_URL="http://influxdb:8086/write?db=nifi_weatherData"
DB_URL="http://influxdb:8086"
#DB_NAME="nifi_weatherData"
-DB_NAME="telegraf_weatherData"
+DB_NAME="nifi_weatherData"
DB_USER="admin"
DB_PASS="admin"
@@ -29,9 +29,9 @@ DB_PASS="admin"
#### Over all ####
## Needed if Interactive mode turned off
-API_URL="https://api.open-meteo.com/v1/forecast?latitude=58.38&longitude=26.72&current_weather=true"
+API_URL="https://api.open-meteo.com/v1/forecast?latitude=37.9838&longitude=23.7275&current_weather=true"
API_FIELDS={'temperature': '.current_weather.temperature', 'windspeed': '.current_weather.windspeed'}
API_USERNAME="Placeholder"
API_PASSWORD="Placehoder"
PIPELINE_SCHEDULING_PERIOD="10"
-PIPELINE_NAME="test_pipeline"
+PIPELINE_NAME="Ateena"
diff --git a/modules/nifi/core.py b/modules/nifi/core.py
index bcf50c0..79ab5b9 100644
--- a/modules/nifi/core.py
+++ b/modules/nifi/core.py
@@ -114,9 +114,9 @@ def build_pipeline():
## Pipeline Deployment
if (config.NIFI_DEPLOY):
token = nifi_utils.get_access_token()
- nifi_utils.upload_nifi_pipeline(token, "pipelines/test_pipeline.json", "test_pipeline", username=config.NIFI_USER, password=config.NIFI_PASS, nifi_url=config.NIFI_HOST, position_x=0, position_y=0)
+ nifi_utils.upload_nifi_pipeline(token, f"pipelines/{new_pipeline_name}", new_pipeline_name.split(".")[0], username=config.NIFI_USER, password=config.NIFI_PASS, nifi_url=config.NIFI_HOST, position_x=0, position_y=0)
else:
choice = common.ask_binary_input(prompt="\nKas soovid genereeritud andmekonveieri nifi platvormile paigaldada?(jah/ei): ",valikud=["jah","ei"]).strip().lower()
if choice == "jah":
token = nifi_utils.get_access_token()
- nifi_utils.upload_nifi_pipeline(token, "pipelines/test_pipeline.json", "test_pipeline", username=config.NIFI_USER, password=config.NIFI_PASS, nifi_url=config.NIFI_HOST, position_x=0, position_y=0)
+ nifi_utils.upload_nifi_pipeline(token, f"pipelines/{new_pipeline_name}", new_pipeline_name.split(".")[0], username=config.NIFI_USER, password=config.NIFI_PASS, nifi_url=config.NIFI_HOST, position_x=0, position_y=0)