From 6a44324cc9b8facd0d41369b538b7f8356933bf3 Mon Sep 17 00:00:00 2001 From: Marcelo Arocha Date: Thu, 12 Dec 2024 16:34:45 -0300 Subject: [PATCH] nifi add update property --- models/enums.py | 1 + services/admin/admin_integration_remote_service.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/models/enums.py b/models/enums.py index 18e352e2..2fc675c8 100644 --- a/models/enums.py +++ b/models/enums.py @@ -130,6 +130,7 @@ class NifiQueueActionTypeEnum(Enum): TERMINATE_PROCESS = "TERMINATE_PROCESS" CUSTOM_CALLBACK = "CUSTOM_CALLBACK" REFRESH_TEMPLATE = "REFRESH_TEMPLATE" + UPDATE_PROPERTY = "UPDATE_PROPERTY" class DrugAlertTypeEnum(Enum): diff --git a/services/admin/admin_integration_remote_service.py b/services/admin/admin_integration_remote_service.py index 7bf7479d..7d99e230 100644 --- a/services/admin/admin_integration_remote_service.py +++ b/services/admin/admin_integration_remote_service.py @@ -247,6 +247,13 @@ def _get_new_queue(id_processor: str, action_type: str, data: dict): elif NifiQueueActionTypeEnum.REFRESH_TEMPLATE.value == action_type: queue.url = f"nifi-api/system-diagnostics" queue.method = "GET" + elif NifiQueueActionTypeEnum.UPDATE_PROPERTY.value == action_type: + queue.url = f"nifi-api/processors/{escape(id_processor)}" + queue.method = "PUT" + queue.body = { + "id": id_processor, + "config": {"properties": data["properties"]}, + } return queue