diff options
-rw-r--r-- | config.py | 12 | ||||
-rw-r--r-- | modules/nifi/nifi_utils.py | 8 |
2 files changed, 11 insertions, 9 deletions
@@ -1,5 +1,5 @@ -INTERACTIVE_MODE=False -PLATFORM="Telegraf" +INTERACTIVE_MODE=True +#PLATFORM="Telegraf" #### Nifi specific #### @@ -10,12 +10,12 @@ NIFI_DEPLOY=True NIFI_USER="lab08nifiuser" NIFI_PASS="tartunifi2023" -MEASUREMENT_NAME="Tartu_ilmaandmed" +MEASUREMENT_NAME="EurDol_kurss" ## Database DB_URL="http://influxdb:8086" #DB_NAME="nifi_weatherData" -DB_NAME="telegraf_weatherData" +DB_NAME="nifi_valuuta" DB_USER="admin" DB_PASS="admin" @@ -24,10 +24,10 @@ DB_PASS="admin" ## Needed if Interactive mode turned off #API_URL="https://api.open-meteo.com/v1/forecast?latitude=37.9838&longitude=23.7275¤t_weather=true" -API_URL="https://api.openweathermap.org/data/2.5/weather?q=Tartu&units=metric&lang=en&appid=01786b7e8b623a1d2112d672ecae1d0d" +API_URL="https://v6.exchangerate-api.com/v6/78660310eae8ed2c9ab662f8/latest/USD" #API_FIELDS={'temperature': '.current_weather.temperature', 'windspeed': '.current_weather.windspeed'} API_FIELDS={'temp': '.main.temp', 'winds': '.wind.speed'} API_USERNAME="rasmus.luha" API_PASSWORD="Placeholder" PIPELINE_SCHEDULING_PERIOD="10" -PIPELINE_NAME="OpenWeather_pipeline" +PIPELINE_NAME="ExchangeRate_pipeline" diff --git a/modules/nifi/nifi_utils.py b/modules/nifi/nifi_utils.py index 1871940..6028003 100644 --- a/modules/nifi/nifi_utils.py +++ b/modules/nifi/nifi_utils.py @@ -3,7 +3,9 @@ import config import requests import sys import json +import urllib3 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) def update_template(file_path, dot_path, new_key, new_value): @@ -25,12 +27,12 @@ def update_template(file_path, dot_path, new_key, new_value): # Step 4: Add or update the key current[new_key] = new_value - print(f"🛠Added '{new_key}': '{new_value}' at path '{dot_path}'") + #print(f"🛠Added '{new_key}': '{new_value}' at path '{dot_path}'") # Step 5: Save back the JSON with open(file_path, "w") as f: json.dump(data, f, indent=2) - print("✅ Changes saved.") + #print("✅ Changes saved.") def set_database_credentials(file_path,dot_path): ## Update URL @@ -87,4 +89,4 @@ def upload_nifi_pipeline(token, pipeline_path, processorGroup_name, username=con ) upload_resp.raise_for_status() - print(f"✅ Uploaded process group '{processorGroup_name}' successfully!") + print(f"✅ Andmekonveier '{processorGroup_name}' on edukalt ka Nifi platvormile paigaldatud!") |