Commit 7afc5a71 authored by mohammed.shibili's avatar mohammed.shibili

first commit

parents
SERVICE_HOST=127.0.0.1
SERVICE_PORT=8000
WORKERS=1
PROJECT_NAME=EMS-Automation
DB_NAME=ilens_widget
LOG_PATH=log
LOG_LEVEL=INFO
BACKUP_COUNT=5
MAX_BYTES=10000000
CONFIG_PATH=DATA/Config/
CONFIG_FILE_NAME=config.yml
UPLOAD_LOG_PATH=/DATA/Config/
#staging_new
#BASE_URL=https://rtmi.aarti-industries.unifytwin.com/
#USER_ID=CZ8vXWpJLza8TXXnpN2sFo
#PROJECT_ID=project_101
#LOGIN_TOKEN=9d858dfff7564571b191b4c6eb7f5ab8
#BASE_URL=https://staging.unifytwin.com/
#USER_ID=56jyuX7Z9M4HkoeGfTNJWk
#PROJECT_ID=project_445
#LOGIN_TOKEN=1a54e0de3a81494ab95ae56d0c24a1af
BASE_URL=https://staging.unifytwin.com/
USER_ID=7BYVRyxnzE4MS33Gv8Y6eB
PROJECT_ID=project_437
LOGIN_TOKEN=d102d0403da94627a812836c7e2a66f8
NEW_BASE_URL=https://staging.unifytwin.com/
NEW_USER_ID=56jyuX7Z9M4HkoeGfTNJWk
NEW_PROJECT_ID=project_445
NEW_LOGIN_TOKEN=8eeb913e1d1e4da9bcdcfd788f3e037e
# Default ignored files
/shelf/
/workspace.xml
from scripts.config import Services
from scripts.logging.logger import logger
import uvicorn
import argparse
__author__ = 'H115-925 MOHAMMED SHIBILI O'
__date__ = '17 January 2024'
ap = argparse.ArgumentParser()
if __name__ == "__main__":
try:
logger.info(f"****Starting {Services.PROJECT_NAME} ***")
print(f"****************************Starting {Services.PROJECT_NAME}****************************")
ap.add_argument(
"--port",
"-p",
required=False,
default=Services.SERVICE_PORT,
help="Port to start the application.",
)
ap.add_argument(
"--bind",
"-b",
required=False,
default=Services.SERVICE_HOST,
help="IF to start the application.",
)
ap.add_argument(
"--workers",
"-w",
type=int,
default=Services.WORKERS,
help="Number of worker processes to use.",
)
arguments = vars(ap.parse_args())
logger.info(f"App Starting at {arguments['bind']}:{arguments['port']} with {arguments['workers']} workers.")
uvicorn.run(
"main:app",
host=arguments["bind"],
port=int(arguments["port"]),
workers=arguments["workers"]
)
except Exception as e:
logger.error(f"Error from app - {e}")
File added
2024-01-17 12:27:29 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 12:27:29 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 12:27:31 - ERROR - [<module>(): 46] - Error from app - Form data requires "python-multipart" to be installed.
You can install "python-multipart" with:
pip install python-multipart
2024-01-17 12:28:06 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 12:28:06 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:11:33 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:11:33 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:11:54 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:11:54 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:15:55 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:15:55 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:17:05 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:17:05 - ERROR - [create_dashboard(): 35] - error while creating dashboard Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.
Traceback (most recent call last):
File "E:\Arti dashboards\venv\lib\site-packages\pandas\compat\_optional.py", line 132, in import_optional_dependency
module = importlib.import_module(name)
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'openpyxl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 28, in create_dashboard
with pd.ExcelFile(file.filename, engine="openpyxl") as xls:
File "E:\Arti dashboards\venv\lib\site-packages\pandas\io\excel\_base.py", line 1580, in __init__
self._reader = self._engines[engine](
File "E:\Arti dashboards\venv\lib\site-packages\pandas\io\excel\_openpyxl.py", line 552, in __init__
import_optional_dependency("openpyxl")
File "E:\Arti dashboards\venv\lib\site-packages\pandas\compat\_optional.py", line 135, in import_optional_dependency
raise ImportError(msg)
ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.
2024-01-17 15:18:03 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:18:03 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:18:34 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:18:35 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:19:13 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:19:13 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:19:36 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:19:37 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:21:49 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:21:49 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:24:05 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:24:06 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:28:32 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:28:32 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:28:50 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:28:51 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:29:09 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:29:09 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:29:33 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:29:34 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:30:42 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:30:42 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:30:56 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:30:57 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:32:00 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:32:00 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:32:20 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:32:21 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:33:08 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:33:08 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:33:15 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:33:16 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:33:33 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:33:33 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:33:49 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:33:51 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:34:49 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:34:49 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:35:02 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:35:03 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 15:35:55 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 15:35:55 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 15:36:12 - INFO - [create_dashboard(): 25] - service started in creating dashboard
2024-01-17 15:36:13 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 16:02:54 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 16:02:54 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 16:03:00 - INFO - [create_dashboard(): 27] - service started in creating dashboard
2024-01-17 16:03:01 - INFO - [get_dashboard_details(): 13] - service started in getting the dashboard reference
2024-01-17 16:03:01 - INFO - [get_widget_details(): 8] - service started in getting the widget data
2024-01-17 16:17:13 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-17 16:17:13 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-17 16:17:38 - INFO - [create_dashboard(): 27] - service started in creating dashboard
2024-01-17 16:17:39 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-17 16:17:40 - INFO - [get_widget_details(): 15] - service started in getting the widget data
2024-01-18 11:15:13 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 11:15:13 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 11:16:33 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 11:30:31 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 11:30:31 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 11:31:07 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:43:36 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:43:36 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:45:01 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:45:01 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:45:55 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:45:56 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:45:56 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details [Errno 11001] getaddrinfo failed
Traceback (most recent call last):
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_exceptions.py", line 10, in map_exceptions
yield
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_backends\sync.py", line 206, in connect_tcp
sock = socket.create_connection(
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\socket.py", line 823, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 67, in map_httpcore_exceptions
yield
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
resp = self._pool.handle_request(req)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 268, in handle_request
raise exc
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 251, in handle_request
response = connection.handle_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 99, in handle_request
raise exc
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 76, in handle_request
stream = self._connect(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 124, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_backends\sync.py", line 213, in connect_tcp
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 21, in get_dashboard_details
dashboard_lists = httpx.post(url=list_url, cookies=cookies, json=list_dashboard_payload)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_api.py", line 317, in post
return request(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_api.py", line 104, in request
return client.request(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 828, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 915, in send
response = self._send_handling_auth(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 943, in _send_handling_auth
response = self._send_handling_redirects(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 980, in _send_handling_redirects
response = self._send_single_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 1016, in _send_single_request
response = transport.handle_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
resp = self._pool.handle_request(req)
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 84, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 11001] getaddrinfo failed
2024-01-18 14:46:40 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:46:40 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:46:46 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:48:37 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:48:37 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:49:39 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:49:40 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:49:40 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details [Errno 11001] getaddrinfo failed
Traceback (most recent call last):
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_exceptions.py", line 10, in map_exceptions
yield
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_backends\sync.py", line 206, in connect_tcp
sock = socket.create_connection(
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\socket.py", line 823, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 67, in map_httpcore_exceptions
yield
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
resp = self._pool.handle_request(req)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 268, in handle_request
raise exc
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection_pool.py", line 251, in handle_request
response = connection.handle_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 99, in handle_request
raise exc
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 76, in handle_request
stream = self._connect(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_sync\connection.py", line 124, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_backends\sync.py", line 213, in connect_tcp
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "E:\Arti dashboards\venv\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 21, in get_dashboard_details
dashboard_lists = httpx.post(url=list_url, cookies=cookies, json=list_dashboard_payload)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_api.py", line 317, in post
return request(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_api.py", line 104, in request
return client.request(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 828, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 915, in send
response = self._send_handling_auth(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 943, in _send_handling_auth
response = self._send_handling_redirects(
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 980, in _send_handling_redirects
response = self._send_single_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_client.py", line 1016, in _send_single_request
response = transport.handle_request(request)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 231, in handle_request
resp = self._pool.handle_request(req)
File "C:\Users\mohammed.shibili\AppData\Local\Programs\Python\Python39\lib\contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "E:\Arti dashboards\venv\lib\site-packages\httpx\_transports\default.py", line 84, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 11001] getaddrinfo failed
2024-01-18 14:49:51 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:49:51 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:49:58 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:50:16 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:51:44 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:51:44 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:51:49 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:51:50 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:51:50 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 14:51:51 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 14:51:51 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:51:51 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details string indices must be integers
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 17, in get_dashboard_details
existing_dashboard["searchText"] = dashboard_name["dashboard_name"]
TypeError: string indices must be integers
2024-01-18 14:51:51 - ERROR - [create_new_dashboard(): 72] - error while creating new dashboard 'NoneType' object is not iterable
2024-01-18 14:54:03 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:54:03 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:54:07 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:54:08 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:54:09 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 14:54:09 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 14:54:09 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:54:10 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:54:11 - ERROR - [create_new_dashboard(): 72] - error while creating new dashboard 'str' object has no attribute 'get'
2024-01-18 14:56:08 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:56:08 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:56:15 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:56:22 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:56:59 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 14:57:08 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 14:57:08 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 14:59:40 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 14:59:40 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 14:59:45 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 14:59:54 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:00:02 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:00:05 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:00:05 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:00:13 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:01:57 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:01:57 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:02:07 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:02:12 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:02:19 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:02:20 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:02:20 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:02:42 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:03:20 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> 8jbFmAoWQqfHup4nW2grQP
2024-01-18 15:03:32 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:03:32 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:03:34 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:15:35 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:15:35 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:15:42 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:15:43 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:15:44 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:15:44 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:15:44 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:15:45 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:15:46 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> AXjeKCcs3nmr5jN2z2xvpC
2024-01-18 15:15:46 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:15:46 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:15:50 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:17:45 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:17:45 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:19:44 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:19:44 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:19:52 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:19:53 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:19:54 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:19:54 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:19:54 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:19:55 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:19:56 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> NupFDRNoxdL3rFbSU9gC8U
2024-01-18 15:19:56 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:19:56 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:25:52 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:25:52 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:26:11 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:26:13 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:26:13 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:26:14 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:26:14 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:26:15 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:26:16 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> TTX2UU9pydYERbfYNABe2e
2024-01-18 15:26:16 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:26:16 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:32:08 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:32:08 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:32:30 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:32:32 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:32:32 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:32:33 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:32:33 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:32:34 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:32:34 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> Q6PMjgLZJbLvHD3aHMCgWd
2024-01-18 15:32:34 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:32:34 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:36:45 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:36:45 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:36:49 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:36:50 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:36:51 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:36:51 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:36:51 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:36:52 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:36:53 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> G9avYRLQE8Ymbg8RyCmHvG
2024-01-18 15:36:53 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:36:53 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:36:55 - INFO - [create_pyload(): 56] - service started in creating payload
2024-01-18 15:37:32 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:37:32 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:39:12 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:39:12 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:52:56 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:52:58 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:52:59 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:52:59 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:52:59 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:53:00 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:53:01 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> kkeaVSgEQnhM2vrMbrxVEc
2024-01-18 15:53:01 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:53:01 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 15:55:52 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:55:52 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:55:58 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:55:59 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:55:59 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:56:00 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:56:00 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:56:01 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:56:02 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> ZJfrzFupSEzjA4YygusqeL
2024-01-18 15:56:02 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:56:02 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 15:56:04 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 15:56:43 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 15:56:43 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 15:57:07 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 15:57:09 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:57:10 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 15:57:11 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 15:57:11 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:57:12 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 15:57:13 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> MBoGjxLnYEwpUVsmRb6H3L
2024-01-18 15:57:13 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 15:57:13 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:01:40 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:01:40 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:01:47 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:01:49 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:01:49 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:01:50 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:01:50 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:01:51 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:01:52 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> JGxAe4nCQveTsoF793haNZ
2024-01-18 16:01:52 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:01:52 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:01:54 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:02:24 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:02:24 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:02:25 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:02:26 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:02:26 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:02:27 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:02:27 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> j25EMBLrNuqaUHEMyvCVZJ
2024-01-18 16:02:27 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:02:27 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:02:30 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:04:09 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:04:09 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:04:25 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:04:26 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:04:27 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:04:28 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:04:28 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:04:29 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:04:30 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> GEbfW2MgKCLxSjPdUgDu6K
2024-01-18 16:04:30 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:04:30 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:04:32 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:05:00 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:05:00 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:05:12 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:05:13 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:05:13 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:05:14 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:05:14 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:05:15 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:05:16 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> YEVvXHVHFdQzq4agPxk6ZY
2024-01-18 16:05:16 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:05:16 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:05:18 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:07:52 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:07:52 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:08:06 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:08:07 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:08:07 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:08:08 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:08:08 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:08:09 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:08:10 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> JdG9saVFsgmUNgFtXXFZ7X
2024-01-18 16:08:10 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:08:10 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:08:12 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:21:44 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:21:44 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:21:55 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:21:56 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:21:57 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:21:57 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:21:57 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:21:59 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:21:59 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> jFKGD8bHnFtDiLhfBfbZ8M
2024-01-18 16:21:59 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:21:59 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:22:01 - ERROR - [create_pyload(): 192] - error while creating payload 'dict' object cannot be interpreted as an integer
2024-01-18 16:22:01 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:22:03 - ERROR - [create_pyload(): 192] - error while creating payload 'dict' object cannot be interpreted as an integer
2024-01-18 16:27:11 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:27:11 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:27:24 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:27:25 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:27:25 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-18 16:27:26 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:27:26 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:27:27 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:27:28 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> 9cCJmMptYyAUi9KeqVEj3N
2024-01-18 16:27:28 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-18 16:27:28 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-18 16:27:30 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-18 16:28:54 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:28:54 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:30:28 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:30:28 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:30:48 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:30:48 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:31:04 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:31:06 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:31:07 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:31:07 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:31:07 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:31:09 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:31:09 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> XAKBEGTBEzLTTGbf8X3a37
2024-01-18 16:31:09 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:31:09 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 16:36:52 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 16:36:52 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 16:37:04 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 16:37:07 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:37:07 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 16:37:08 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 16:37:08 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:37:09 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 16:37:09 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> HxxkqpCScZLmBf5pSyLxzP
2024-01-18 16:37:09 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 16:37:09 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 17:58:17 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 17:58:17 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 17:58:25 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 17:58:27 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 17:58:28 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details 'data'
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 23, in get_dashboard_details
list_of_dashboards = json_response["data"]["body_content"]
KeyError: 'data'
2024-01-18 18:02:59 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 18:02:59 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 18:03:21 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 18:03:21 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 18:03:29 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 18:03:32 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 18:03:32 - INFO - [get_widget_details(): 17] - service started in getting the widget data
2024-01-18 18:03:33 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 18:03:33 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 18:03:34 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 18:03:34 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> NJMdp5GcAT6JrQk84SVvdq
2024-01-18 18:03:34 - INFO - [create_new_widgets(): 35] - service started in creating new widgets
2024-01-18 18:03:34 - INFO - [create_pyload(): 57] - service started in creating payload
2024-01-18 19:08:56 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 19:08:56 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 19:09:05 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 19:09:06 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:09:06 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details 'data'
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 23, in get_dashboard_details
list_of_dashboards = json_response["data"]["body_content"]
KeyError: 'data'
2024-01-18 19:10:10 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-18 19:10:10 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-18 19:10:24 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 19:10:26 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:10:26 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-18 19:10:27 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 19:10:27 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:10:28 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:10:28 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> fEJj7tqBRnz6tZqURMGa2H
2024-01-18 19:10:28 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-18 19:10:28 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-18 19:10:31 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-18 19:18:02 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-18 19:18:02 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:18:03 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-18 19:18:04 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-18 19:18:04 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:18:05 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-18 19:18:05 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> XUkNGkAT4ByrcHjxhWJEKE
2024-01-18 19:18:05 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-18 19:18:05 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-18 19:18:07 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 09:44:40 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 09:44:40 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 09:44:51 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 09:44:53 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-19 09:44:54 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 09:44:54 - INFO - [create_new_dashboard(): 38] - service started in creating new dashboard
2024-01-19 09:44:54 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-19 09:44:55 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-19 09:44:56 - INFO - [create_new_dashboard(): 52] - dashboard id >>>> D8nLA2oUnQr3sikC5M8qBM
2024-01-19 09:44:56 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 09:44:56 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 09:44:57 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 10:54:00 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 10:54:00 - INFO - [get_dashboard_details(): 15] - service started in getting the dashboard reference
2024-01-19 10:54:01 - ERROR - [get_dashboard_details(): 32] - error while fetching the dashboard details 'data'
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 23, in get_dashboard_details
if dashboard_lists.status_code != 200:
KeyError: 'data'
2024-01-19 10:54:51 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 10:54:51 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 10:55:00 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 10:55:02 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 10:55:02 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 10:55:03 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 10:55:03 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 10:55:04 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 10:55:04 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> YjEeGVkWsGXNAV7WAmSgxp
2024-01-19 10:55:04 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 10:55:04 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 10:55:06 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 10:55:08 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:09:35 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 11:09:35 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:09:36 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 11:09:36 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 11:09:36 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:09:37 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:09:38 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 6QmgRkBai3C9Q4HYoyEZFS
2024-01-19 11:09:38 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 11:09:38 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:09:40 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:17:47 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 11:17:47 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:17:47 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 11:17:48 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 11:17:48 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:17:49 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:17:50 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> VhqNHTZnpSmiXGVz3Z4bdj
2024-01-19 11:17:50 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 11:17:50 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:17:52 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:21:46 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 11:21:46 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:21:47 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 11:21:47 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 11:21:47 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:21:49 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:21:49 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> iCnGN8GfPjC4TgsZvBmHRJ
2024-01-19 11:21:49 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 11:21:49 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:21:52 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:30:42 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 11:30:42 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:30:43 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 11:30:43 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 11:30:43 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:30:44 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 11:30:45 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 4LGLcHPSk4TBUjbDjbYGPV
2024-01-19 11:30:45 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 11:30:45 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 11:30:47 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 12:17:56 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 12:17:56 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 12:18:13 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 12:18:14 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 12:18:15 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 12:18:15 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 12:18:15 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 12:18:16 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 12:18:17 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> htYEznxW93G4uMD4XhMPxh
2024-01-19 12:18:17 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 12:18:17 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 12:18:19 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 14:50:17 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 14:50:17 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 15:26:49 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 15:26:51 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:26:51 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 15:26:52 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 15:26:52 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:26:53 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:26:53 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> bVoBo86gDzxbxg9uyXcVyH
2024-01-19 15:26:53 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 15:26:53 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 15:26:58 - ERROR - [create_pyload(): 197] - error while creating payload The read operation timed out
2024-01-19 15:28:29 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 15:28:29 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 15:28:35 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 15:28:37 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:28:37 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 15:28:38 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 15:28:38 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:28:39 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:28:39 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> XKwgbfh65T5xn3tWt7cypg
2024-01-19 15:28:39 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 15:28:39 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 15:28:44 - ERROR - [create_pyload(): 201] - error while creating payload The read operation timed out
2024-01-19 15:29:56 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 15:29:56 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 15:30:03 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 15:30:04 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:30:04 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 15:30:05 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 15:30:05 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:30:06 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:30:06 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> XKwgbfh65T5xn3tWt7cypg
2024-01-19 15:30:06 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 15:30:06 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 15:38:37 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 15:38:37 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 15:39:32 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 15:39:33 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:39:33 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 15:39:34 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 15:39:34 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:39:35 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:39:35 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 52e36FWXpVcjbpUiTzwpwy
2024-01-19 15:39:35 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 15:39:35 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 15:57:44 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 15:57:44 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 15:57:50 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 15:57:51 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:57:52 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 15:57:52 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 15:57:52 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:57:53 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 15:57:53 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> VBLcQdAGzEZ2JrtqVyd87z
2024-01-19 15:57:53 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 15:57:53 - INFO - [create_pyload(): 59] - service started in creating payload
2024-01-19 16:09:41 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 16:09:41 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 16:09:49 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 16:09:50 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:09:50 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 16:09:51 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 16:09:51 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:09:52 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:09:52 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> NYUbAjgW2shCe26kfaFfyq
2024-01-19 16:09:52 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 16:09:52 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-19 16:19:37 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 16:19:37 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 16:19:43 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 16:19:45 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:19:45 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 16:19:46 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 16:19:46 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:19:46 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:19:47 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> PN3MyRRqpejJZ4KiX2HZkf
2024-01-19 16:19:47 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 16:19:47 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-19 16:25:42 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 16:25:42 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 16:26:01 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 16:26:02 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:26:02 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 16:26:03 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 16:26:03 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:26:04 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:26:04 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> b8Z2hHNT8nGiQ9SNLAGpYE
2024-01-19 16:26:04 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 16:26:04 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-19 16:28:23 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-19 16:28:23 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-19 16:28:41 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-19 16:28:42 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:28:42 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-19 16:28:43 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-19 16:28:43 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:28:44 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-19 16:28:44 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> RwMudD2zc2eeYxiUE398Ji
2024-01-19 16:28:44 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-19 16:28:44 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-22 10:11:43 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 10:11:43 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 10:12:31 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 10:12:32 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:12:33 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 10:12:34 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 10:12:34 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:12:36 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:12:37 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> Gob7pBGgXb9cZFNPjAsJ5Y
2024-01-22 10:12:37 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 10:12:37 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-22 10:39:07 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 10:39:07 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:39:07 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 10:39:08 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 10:39:08 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:39:09 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 10:39:09 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> L88pgCgcunPR5XPGWjpjHz
2024-01-22 10:39:09 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 10:39:09 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-22 10:39:20 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-22 10:39:31 - INFO - [create_pyload(): 65] - service started in creating payload
2024-01-22 10:39:31 - ERROR - [create_pyload(): 198] - error while creating payload list index out of range
2024-01-22 10:39:31 - ERROR - [create_new_widgets(): 59] - error while creating new widgets cannot unpack non-iterable NoneType object
2024-01-22 10:39:31 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 11:58:13 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 11:58:13 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 11:59:51 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 11:59:53 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 11:59:53 - ERROR - [get_dashboard_details(): 31] - error while fetching the dashboard details 'data'
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\core\handlers\dashboard_handler.py", line 22, in get_dashboard_details
list_of_dashboards = json_response["data"]["body_content"]
KeyError: 'data'
2024-01-22 12:00:41 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:00:41 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:00:58 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:00:59 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:01:29 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:01:29 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:01:59 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:02:00 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:02:01 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:02:01 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:02:01 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:02:02 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:02:03 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 9SegSCGSjuvSitTEF7Cx5k
2024-01-22 12:02:03 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:02:03 - ERROR - [create_new_widgets(): 63] - error while creating new widgets 'widget_data'
2024-01-22 12:02:03 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 12:03:29 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:03:29 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:04:06 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:04:07 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:04:08 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:04:08 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:04:08 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:04:09 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:04:10 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 4KeN3Xbp7UseyQjh6tEQTs
2024-01-22 12:04:10 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:04:10 - ERROR - [create_new_widgets(): 64] - error while creating new widgets 'widget_data'
2024-01-22 12:04:10 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 12:05:17 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:05:17 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:06:05 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:06:05 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:06:23 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:06:24 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:06:25 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:06:25 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:06:25 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:06:26 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:06:26 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> WfsUN4WHEawtHqUdQEGk2m
2024-01-22 12:06:26 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:06:26 - ERROR - [create_new_widgets(): 65] - error while creating new widgets 'widget_data'
2024-01-22 12:06:26 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 12:10:40 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:10:40 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:10:51 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:10:53 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:10:53 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:10:54 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:10:54 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:10:55 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:10:55 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> mANbBNjwfjLG8BFusfpg2A
2024-01-22 12:10:55 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:10:55 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:12:55 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:12:55 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:12:56 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:12:56 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:12:56 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:12:57 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:12:57 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 6HUSLocj9tXWSg7E66CcBz
2024-01-22 12:12:57 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:12:57 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:13:09 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:13:18 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:13:18 - ERROR - [create_pyload(): 199] - error while creating payload list index out of range
2024-01-22 12:13:18 - ERROR - [create_new_widgets(): 60] - error while creating new widgets cannot unpack non-iterable NoneType object
2024-01-22 12:13:18 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 12:14:23 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:14:23 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:14:38 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:14:39 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:14:40 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:14:40 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:14:40 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:14:41 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:14:41 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 6fQvRXsLpozZ6m6mFH4UcR
2024-01-22 12:14:41 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:14:41 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:14:52 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:15:02 - INFO - [create_pyload(): 66] - service started in creating payload
2024-01-22 12:15:02 - ERROR - [create_pyload(): 199] - error while creating payload list index out of range
2024-01-22 12:15:02 - ERROR - [create_new_widgets(): 60] - error while creating new widgets cannot unpack non-iterable NoneType object
2024-01-22 12:15:02 - ERROR - [create_dashboard(): 61] - error while creating dashboard cannot unpack non-iterable NoneType object
Traceback (most recent call last):
File "E:\Arti dashboards\scripts\services\dashboards.py", line 43, in create_dashboard
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
TypeError: cannot unpack non-iterable NoneType object
2024-01-22 12:31:39 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 12:31:39 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 12:32:52 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 12:32:53 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:32:54 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 12:32:54 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 12:32:54 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:32:55 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 12:32:56 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> Zj3bjmHEyZ5uS4ZdJGZAVg
2024-01-22 12:32:56 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 12:32:56 - INFO - [create_pyload(): 71] - service started in creating payload
2024-01-22 15:15:30 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 15:15:30 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 15:15:56 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 15:15:56 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 15:22:35 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 15:22:35 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 15:26:05 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 15:26:08 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:27:17 - INFO - [<module>(): 13] - ****Starting EMS-Automation ***
2024-01-22 15:27:17 - INFO - [<module>(): 38] - App Starting at 127.0.0.1:8000 with 1 workers.
2024-01-22 15:28:03 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 15:28:05 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:28:07 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 15:28:08 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 15:28:08 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:28:08 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:28:09 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 9eYvQtpN2cK5k9EkKG6VdL
2024-01-22 15:28:09 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 15:28:09 - INFO - [create_pyload(): 70] - service started in creating payload
2024-01-22 15:32:44 - INFO - [create_dashboard(): 30] - service started in creating dashboard
2024-01-22 15:32:44 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:32:44 - INFO - [get_widget_details(): 19] - service started in getting the widget data
2024-01-22 15:32:44 - INFO - [create_new_dashboard(): 37] - service started in creating new dashboard
2024-01-22 15:32:44 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:32:45 - INFO - [get_dashboard_details(): 14] - service started in getting the dashboard reference
2024-01-22 15:32:45 - INFO - [create_new_dashboard(): 51] - dashboard id >>>> 4wh6ssbHhLRpH96Py4xYqX
2024-01-22 15:32:45 - INFO - [create_new_widgets(): 37] - service started in creating new widgets
2024-01-22 15:32:45 - INFO - [create_pyload(): 70] - service started in creating payload
2024-01-22 15:32:55 - INFO - [create_pyload(): 70] - service started in creating payload
import uvicorn
from fastapi import FastAPI
from scripts import services
from scripts.config import Services
from scripts.logging.logger import logger
app = FastAPI()
app.include_router(services.router)
# starting the application
if __name__ == "__main__":
try:
uvicorn.run(services.router, host=Services.SERVICE_HOST, port=Services.SERVICE_PORT)
except Exception as e:
logger.exception(e)
uvicorn~=0.26.0
fastapi~=0.109.0
pydantic~=2.5.3
python-dotenv~=1.0.0
pandas~=2.1.4
httpx~=0.26.0
tzlocal~=5.2
\ No newline at end of file
from pydantic import Field
from pydantic_settings import BaseSettings
from dotenv import load_dotenv
load_dotenv()
class _Services(BaseSettings):
SERVICE_HOST: str = Field(default="127.0.0.1", env="service_host")
SERVICE_PORT: int = Field(default=8001, env="service_port")
PROJECT_NAME: str = Field(default="EMS-Automation", env="project_name")
ENABLE_CORS: bool = True
CORS_ALLOW_CREDENTIALS: bool = True
CORS_ALLOW_METHODS: list = ["GET", "POST"]
CORS_ALLOW_HEADERS: list = ["*"]
LOG_LEVEL: str
BACKUP_COUNT: int
MAX_BYTES: int
ENABLE_FILE_LOGGING: bool = True
ENABLE_BACKUP_STORING: bool = Field(default=False, env="enable_backup")
WORKERS: int = Field(default=12, env="workers")
class _BasePathConf(BaseSettings):
BASE_URL: str = Field(default="http://192.168.0.220/", env="base_path")
NEW_BASE_URL: str = Field(default="http://192.168.0.220/", env="new_base_url")
class _PathConf(BaseSettings):
LOG_PATH: str
CONFIG_PATH: str
class _Databases(BaseSettings):
MONGO_URI: str = Field(default="mongodb://localhost:27017", env="mongo_uri")
# DB_ASSET_CONSTANTS: str = Field(default="Asset_manager_constants", env="db_asset_constants")
DB_NAME: str = Field(default="ilens_widget", env="db_name")
class _ProjectDetails(BaseSettings):
USER_ID: str = Field(default="user_099", env="user_id")
PROJECT_ID: str = Field(default="project_099", env="project_id")
LOGIN_TOKEN: str = Field(default="0224903f578741f1a092679365f371d8", env="login_token")
NEW_USER_ID: str = Field(default="user_099", env="new_user_id")
NEW_PROJECT_ID: str = Field(default="project_099", env="new_project_id")
NEW_LOGIN_TOKEN: str = Field(default="1e0fe69ec4f6473da8444f2d8cc54d81", env="new_login_token")
Services = _Services()
PathConf = _PathConf()
Databases = _Databases()
Base_path = _BasePathConf()
Project_details = _ProjectDetails()
__all__ = [
"Services",
"PathConf",
"Databases",
"Base_path",
"Project_details"
]
class ApiEndpoints:
dashboards = "/dashboards"
widget = "/create_json"
save_widget = "/widget"
save_app = "/app"
copy_app = "/copy_app"
create_new = "/create"
class RequestEndpoints:
save_dashboard = "visual4.0/dashboard/save"
list_dashboards = "visual4.0/dashboard/list"
save_widget = "visual4.0/widget/save"
save_app = "ilens_api/ilens_config/save_embedded_apps"
hierarchy_details = "hry/hry/fetch_tags"
get_site_level_hierarchy = "ilens_api/ilens_config/get_site_level_hierarchy"
list_embedded_apps = "ilens_api/ilens_config/list_embedded_apps"
list_embedded_apps_id_based = "ilens_api/ilens_config/list_embedded_apps_based_on_id"
list_widgets = "visual4.0/widget/list"
import yaml
class DatabaseConstants:
with open('config.yml', 'r') as f:
data = yaml.safe_load(f)
collection_dashboard = data["collection"]["collection_dashboard"]
list_dashboard_payload = {
"type": {
"list": [
{
"label": "Select All",
"value": "all",
"checked": True
},
{
"label": "Statistical Process Control Reports",
"value": "spc_reports",
"disabled": True,
"checked": True
},
{
"label": "Data Visualization",
"value": "visualization",
"checked": True,
"disabled": False
},
{
"label": "Wind Rose",
"value": "wind_rose",
"checked": True,
"disabled": True
}
],
"value": [
"all",
"spc_reports",
"visualization",
"wind_rose"
],
"expanded": True,
"label": "Dashboard Types"
},
"category": {
"list": [],
"value": [
],
"expanded": True,
"showMore": False,
"label": "Categories"
},
"showOnlyStarred": False,
"filtersList": [
"type",
"category"
],
"showFiltersSidebar": True,
"searchText": "",
"displayMode": "cardView",
"endOfRecords": False,
"filters": {
"starred": False,
"category": [
],
"dashboard_type": [
"spc_reports",
"visualization",
"wind_rose"
],
"search": ""
},
"page": 1,
"records": 50,
"project_id": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
bar_chart_payload = {
"dashboard_id": "",
"widget_data": {
"title": "widget1",
"description": "",
"w": 4,
"h": 400,
"module": "DASHBOARD",
"widgetPosition": "standard",
"chartTheme": "flourish",
"background": True,
"cType": "bar",
"wcType": "chart",
"wAction": {
"show": True
},
"cData": {
"chartOptions": {
"autoRefresh": False,
"autoRefreshType": "ajax",
"autoRefreshTime": 60,
"maxDecimalPoint": 2,
"maxDataPoints": 200,
"isAdvance": True,
"annotations": True,
"alarms": {
"show": True
},
"itemStyle": {
"showShadow": False,
"barBorderRadius": 1,
"shadowBlur": 1,
"shadowColor": "transparent",
"shadowOffsetX": 1,
"shadowOffsetY": 1,
"showBackground": False,
"showborderRadius": False,
"type": "classic"
},
"seriesPointLabel": {
"show": False,
"position": "top",
"distance": 5,
"color": None,
"backgroundColor": "transparent",
"padding": 1
},
"grid": {
"xGridLine": False,
"yGridLine": True,
"show": True,
"backgroundColor": "transparent",
"borderColor": None,
"borderWidth": 1
},
"visualMap": {
"show": False,
"inRangeColors": [
"#313695",
"#4575b4",
"#74add1",
"#abd9e9",
"#e0f3f8",
"#ffffbf",
"#fee090",
"#fdae61",
"#f46d43",
"#d73027",
"#a50026"
]
},
"tooltip": {
"show": True,
"backgroundColor": "#ffffff",
"borderColor": "#000000",
"borderWidth": 1,
"trigger": "axis",
"axisPointer": {
"type": "cross"
},
"textStyle": {
"color": "#000000"
}
},
"dataZoom": {
"insideZoom": True,
"xAxis": False,
"yAxis": False,
"yAxisPos": "left",
"xAxisPos": "top"
},
"chartType": "bar",
"legend": {
"show": True,
"position": "bottom",
"type": "scroll",
"itemGap": 10,
"itemWidth": 25,
"itemHeight": 14,
"symbolKeepAspect": False,
"showIcon": True,
"icon": None,
"selectedMode": "multiple",
"allowSelection": True
},
"toolbox": {
"show": True,
"orient": "vertical"
},
"animation": True,
"xaxis": {
"label": "",
"aggregations": [],
"group_by": {
"type": "timeSeries",
"value": ""
},
"format": "dd/MM/yyyy HH:mm:ss",
"show": True,
"nameGap": 20,
"nameLocation": "end",
"position": "bottom",
"axisLine": {
"show": True,
"showSymbol": False,
"symbol": [
"none",
"none"
]
},
"axisTick": {
"show": True,
"alignWithLabel": True,
"inside": False
},
"axisLabel": {},
"kairos_filters": []
},
"yaxisProp": {
"show": True,
"nameGap": 20,
"nameLocation": "end",
"axisLine": {
"show": True,
"showSymbol": False,
"symbol": [
"none",
"none"
]
},
"axisTick": {
"show": True,
"alignWithLabel": True,
"inside": False
},
"axisLabel": {}
},
"yaxis": [
{
"name": "Bangalore>Zed Tech park>KL-RA-Equip:Voltage B-N",
"group": None,
"aggregation": None,
"tag": {
"value": "site_793$line_4977$equipment_6187$tag_295",
"label": "Bangalore>Zed Tech park>KL-RA-Equip:Voltage B-N",
"high_performance": False,
"parameter_id": "tag_295",
"parameter_label": "Voltage B-N",
"hierarchy_level": "equipment",
"hierarchy_name": "KL-RA-Equip",
"hierarchy_label": "Bangalore>Zed Tech park>KL-RA-Equip",
"color": "",
"enable_color_config": False,
"color_config": [],
"unit": {
"label": "KW",
"value": "unit_120"
},
"target": "",
"default_value": "",
"new_value": "",
"updated_value": "",
"value_one": "",
"value_two": "",
"dynamic_limit": "",
"dynamic_color_config": "",
"disabled": True
},
"selectedUnit": "KW",
"conversionFactor": 1,
"unit": "KW",
"unitInfo": {
"label": "KW",
"value": "unit_120"
},
"color": "",
"position": "left",
"threshold": False,
"thresholdValue": 100,
"markers": [],
"min": None,
"max": None,
"benchmark": False,
"benchmarkValue": 100,
"type": "bar",
"digital": True,
"inverse": False,
"interval": "",
"cellStylingRules": [],
"enableColorConfig": {},
"data": []
},
{
"name": "Bangalore>Zed Tech park>KL-RA-Equip:Temperature",
"group": None,
"aggregation": None,
"tag": {
"value": "site_793$line_4977$equipment_6187$tag_100",
"label": "Bangalore>Zed Tech park>KL-RA-Equip:Temperature",
"high_performance": False,
"parameter_id": "tag_100",
"parameter_label": "Temperature",
"hierarchy_level": "equipment",
"hierarchy_name": "KL-RA-Equip",
"hierarchy_label": "Bangalore>Zed Tech park>KL-RA-Equip",
"color": "",
"enable_color_config": False,
"color_config": [],
"unit": {
"label": "C",
"value": "unit_114"
},
"default_value": "",
"target": "",
"target_limits": "",
"deviation": "",
"upper_value": "",
"lower_value": "",
"middle_value": "",
"create_limit_tags": "",
"restrict_limit_tags_push": "",
"ai_rec_upper_limit": "",
"ai_rec_lower_limit": "",
"ai_rec_actual": "",
"disabled": True
},
"selectedUnit": "C",
"conversionFactor": 1,
"unit": "C",
"unitInfo": {
"label": "C",
"value": "unit_114"
},
"color": "",
"position": "left",
"threshold": False,
"thresholdValue": 100,
"markers": [],
"min": None,
"max": None,
"benchmark": False,
"benchmarkValue": 100,
"type": "bar",
"digital": True,
"inverse": False,
"interval": "",
"cellStylingRules": [],
"enableColorConfig": {},
"data": []
}
],
"filter": {
"timeRange": "last_five_minutes",
"timeRangeLabel": "Last 5 minutes",
"aggregation": "list",
"filterList": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_426$line_1109$equipment_2522",
"name": "Scope_21>Line_02>Equip_01",
"node_id": "equipment_2522",
"site_id": "site_426",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Scope_21>Line_02>Equip_01",
"value": "site_426$line_1109$equipment_2522",
"disabled": False,
"checked": True
},
{
"id": "site_793$line_4977$equipment_6187",
"name": "Bangalore>Zed Tech park>KL-RA-Equip",
"node_id": "equipment_6187",
"site_id": "site_793",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Bangalore>Zed Tech park>KL-RA-Equip",
"value": "site_793$line_4977$equipment_6187",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"isCustom": False,
"custom": {
"from": " 2020-04-05T18:30:00.000Z",
"to": "2020-04-06T15:28:14.088Z"
},
"compare": {
"comparison": False,
"comparisonPeriod": "previous_period",
"custom": {
"from": "06-04-2020 20:58:14",
"to": "06-04-2020 20:58:14"
}
},
"filtersData": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_426$line_1109$equipment_2522",
"name": "Scope_21>Line_02>Equip_01",
"node_id": "equipment_2522",
"site_id": "site_426",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Scope_21>Line_02>Equip_01",
"value": "site_426$line_1109$equipment_2522",
"disabled": False,
"checked": True
},
{
"id": "site_793$line_4977$equipment_6187",
"name": "Bangalore>Zed Tech park>KL-RA-Equip",
"node_id": "equipment_6187",
"site_id": "site_793",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Bangalore>Zed Tech park>KL-RA-Equip",
"value": "site_793$line_4977$equipment_6187",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"between_time": {
"enable": False,
"from": "00:00",
"to": "23:00"
},
"n_value": 1
},
"widget_type": "static",
"database": "kairos",
"changeChartType": "",
"widgetFilter": {
"show": False,
"options": []
},
"yaxisSelection": "tag",
"navigation": {
"placement": "bottom-right"
},
"band_config": {},
"advancedTable": {},
"filterParameters": [],
"task_label": "Tasks",
"task_label_size": 18,
"task_value_size": 40,
"chart_height": 200,
"category_label": 14,
"category_value": 24,
"icon_size": 22,
"advanced_configuration": {
"constants": []
}
},
"chartData": {
"series": [],
"category": []
}
},
"cConfig": {
"fontSize": 16,
"fontWeight": "lighter",
"bgColor": "#DBDFE2",
"color": "#000000",
"showBorder": True,
"textAlign": "left"
},
"cTypeLabel": "Bar Chart",
"roleBasedAccess": False,
"userRoles": []
},
"project_id": "project_099",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
app_creation_payload = {
"children": [
],
"type": {
"label": "Embedded",
"value": "embedded"
},
"name": "",
"enablePrintIcon": False,
"app_logo": "",
"showAppName": True,
"themeBg": "#0956A4",
"themeColor": "#ffffff",
"splashBg": "#0956A4",
"splashColor": "#ffffff",
"splashScreenCssConfiguration": {
"showSplashLogo": True,
"splashBgImage": "",
"primaryBtnColor": "#0f62fe",
"secondaryBtnColor": "#393939",
"primaryBtnHoverColor": "#0353e9",
"secondaryBtnHoverColor": "#4c4c4c",
"primaryBtnFocusColor": "#0f62fe",
"secondaryBtnFocusColor": "#0f62fe",
"headerFontSize": 16,
"headerFontWeight": "normal",
"topMenu": {
"position": "Left",
"fontColor": "#ffffff",
"background": "#0f62fe",
"activeColor": "#0f62fe",
"hoverColor": "#0f62fe"
},
"sideMenu": {
"title": "Side Menu",
"showHeading": True,
"fontColor": "#ffffff",
"background": "#0f62fe",
"activeColor": "#0f62fe",
"hoverColor": "#0f62fe"
},
"tabOption": {
"activeColor": "#fff",
"activeBackground": "#00105d",
"secondaryColor": "#b0aeae",
"secondaryBackground": "#d3d3d394"
},
"additionalOptions": {
"enablePrintIcon": True,
"enableNotification": True,
"enableAlarms": True,
"enableFullScreen": True,
"enableDocumentation": False,
"enableExplorerTree": False,
"autoRefresh": False,
"inAppAlarmNotification": False,
"enableScreenshot": False,
"refreshInterval": None
},
"landing_view_type": "task_view",
"shift_id": None,
"hideReport": False,
"lookups": [],
"splashBg": "#0956A4",
"splashColor": "#ffffff",
"themeBg": "#0956A4",
"themeColor": "#ffffff"
},
"category_id": "app_category_099",
"lookups": [],
"enableLayout": True,
"menuLayout": "leftMenu",
"project_id": "",
"image": "",
"funType": "create",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
app_children = {
"children": [],
"level": 1,
"name": "",
"iconType": {
"label": "Dashboard",
"value": "ftdm-dashboard"
},
"domain_type": "current_domain",
"embed": "p/visualization/",
"module": "visualization",
"view_item": {
"dashboard_id": "GCiZE3m4KS4Qh8DcR8rqBZ",
"project_id": "project_099",
"assetModels": [],
"category": "dashboard_category_099",
"description": None,
"linkToAssetModel": False,
"name": "automation dashboard",
"owner": "user_099",
"starred": False,
"type": "visualization",
"widgetAlign": "none",
"bookmark": False,
"critical": "assets/images/dashboard/critical.svg",
"pinned": "assets/images/dashboard/pin.svg",
"isOwner": True,
"enable_edit": True,
"enable_delete": True,
"last_updated_epoch": 1700541453000,
"last_updated_string": "55 minutes ago",
"dashboard_type": "Visualization",
"categoryName": "Uncategorized",
"route": "p/visualization/"
}
}
table_widget_payload = {
"dashboard_id": "",
"widget_data": {
"title": "table",
"description": "",
"w": 4,
"h": 400,
"module": "DASHBOARD",
"widgetPosition": "standard",
"chartTheme": "flourish",
"background": True,
"cType": "table",
"wcType": "chart",
"wAction": {
"show": True
},
"cData": {
"chartOptions": {
"autoRefresh": False,
"autoRefreshType": "ajax",
"autoRefreshTime": 60,
"table_style": "advanced",
"isAdvance": True,
"maxDecimalPoint": 2,
"maxDataPoints": 200,
"annotations": False,
"alarms": {
"show": False
},
"chartType": "table",
"xaxis": {
"label": "Timestamp",
"aggregations": [],
"group_by": {
"type": "timeSeries",
"value": ""
},
"format": "dd/MM/yyyy HH:mm:ss",
"kairos_filters": []
},
"yaxisAdvance": [],
"yaxis": [
{
"name": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine:Steam Inlet Temperature",
"tag": {
"value": "site_120$dept_127$line_154$equipment_232$tag_122",
"label": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine:Steam Inlet Temperature",
"high_performance": False,
"parameter_id": "tag_122",
"parameter_label": "Steam Inlet Temperature",
"hierarchy_level": "equipment",
"hierarchy_name": "Steam Turbine",
"hierarchy_label": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine",
"color": None,
"enable_color_config": False,
"color_config": [],
"unit": {
"label": "Degree Celcius",
"value": "unit_107"
},
"disabled": True
},
"selectedUnit": "Degree Celcius",
"conversionFactor": 1,
"unit": "Degree Celcius",
"unitInfo": {
"label": "Degree Celcius",
"value": "unit_107"
},
"markers": [],
"type": "table",
"cellStylingRules": [],
"color": None,
"data": []
},
{
"name": "test1",
"tag": {
"value": "site_116$dept_117$line_136$equipment_154$tag_501",
"label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2:Motor Amps",
"high_performance": False,
"parameter_id": "tag_501",
"parameter_label": "Motor Amps",
"hierarchy_level": "equipment",
"hierarchy_name": "lub pump2",
"hierarchy_label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2",
"color": None,
"enable_color_config": False,
"color_config": [],
"unit": {
"label": "Amps",
"value": "unit_124"
},
"disabled": True
},
"selectedUnit": "Amps",
"conversionFactor": 1,
"unit": "Amps",
"unitInfo": {
"label": "Amps",
"value": "unit_124"
},
"markers": [],
"type": "table",
"cellStylingRules": [],
"color": None,
"data": []
}
],
"filter": {
"timeRange": "last_five_minutes",
"timeRangeLabel": "Last 5 minutes",
"aggregation": "list",
"filterList": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_116$dept_117$line_139",
"name": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw5",
"node_id": "line_139",
"site_id": "site_116",
"type": "line",
"lat": "",
"long": "",
"site_label": None,
"label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw5",
"value": "site_116$dept_117$line_139",
"disabled": False,
"checked": True
},
{
"id": "site_116$dept_117$line_136$equipment_154",
"name": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2",
"node_id": "equipment_154",
"site_id": "site_116",
"type": "equipment",
"lat": None,
"long": None,
"site_label": None,
"label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2",
"value": "site_116$dept_117$line_136$equipment_154",
"disabled": False,
"checked": True
},
{
"id": "site_120$dept_127$line_154$equipment_232",
"name": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine",
"node_id": "equipment_232",
"site_id": "site_120",
"type": "equipment",
"lat": None,
"long": None,
"site_label": None,
"label": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine",
"value": "site_120$dept_127$line_154$equipment_232",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"isCustom": False,
"custom": {
"from": "2020-04-05T18:30:00.000Z",
"to": "2020-04-06T09:37:33.515Z"
},
"compare": {
"comparison": False,
"comparisonPeriod": "previous_period",
"custom": {
"from": "06-04-2020 15:07:33",
"to": "06-04-2020 15:07:33"
}
},
"filtersData": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_116$dept_117$line_139",
"name": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw5",
"node_id": "line_139",
"site_id": "site_116",
"type": "line",
"lat": "",
"long": "",
"site_label": None,
"label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw5",
"value": "site_116$dept_117$line_139",
"disabled": False,
"checked": True
},
{
"id": "site_116$dept_117$line_136$equipment_154",
"name": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2",
"node_id": "equipment_154",
"site_id": "site_116",
"type": "equipment",
"lat": None,
"long": None,
"site_label": None,
"label": "JSPL-Raigarh>SPM(Special profile Mill)>Cold saw2>lub pump2",
"value": "site_116$dept_117$line_136$equipment_154",
"disabled": False,
"checked": True
},
{
"id": "site_120$dept_127$line_154$equipment_232",
"name": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine",
"node_id": "equipment_232",
"site_id": "site_120",
"type": "equipment",
"lat": None,
"long": None,
"site_label": None,
"label": "Karnataka-Plant>Bottle Manufacture Block-2>Line2>Steam Turbine",
"value": "site_120$dept_127$line_154$equipment_232",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"between_time": {
"enable": False,
"from": "00:00",
"to": "23:00"
},
"n_value": 1
},
"advancedTable": {
"theme": "ag-theme-alpine",
"editable": False,
"sortable": True,
"headerFontSize": 14,
"minWidth": 100,
"filter": True,
"resizable": True,
"rowIndexing": False,
"colDefsIncluded": [],
"colDefsExcluded": [],
"savedState": False,
"pivotMode": False,
"statusBar": False,
"aggFuncs": [
"count",
"sum",
"min",
"max",
"avg"
],
"pagination": False
},
"widget_type": "static",
"database": "kairos",
"changeChartType": "",
"grid": {
"xGridLine": False,
"yGridLine": True
},
"widgetFilter": {
"show": False,
"options": []
},
"yaxisSelection": "tag",
"navigation": {
"placement": "bottom-right"
},
"fill_na": "drop",
"filterParameters": []
},
"chartData": {
"series": [],
"category": []
}
},
"cConfig": {
"fontSize": 16,
"fontWeight": "lighter",
"bgColor": "#DBDFE2",
"color": "#000000",
"showBorder": True,
"textAlign": "left"
},
"cTypeLabel": "Table",
"roleBasedAccess": False,
"userRoles": []
},
"project_id": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
gauge_widget_payload = {
"dashboard_id": "",
"widget_data": {
"title": "gauge",
"description": "",
"w": 4,
"h": 400,
"module": "DASHBOARD",
"widgetPosition": "standard",
"chartTheme": "flourish",
"background": True,
"cType": "gauge",
"wcType": "chart",
"wAction": {
"show": True
},
"cData": {
"chartOptions": {
"autoRefresh": False,
"autoRefreshType": "ajax",
"autoRefreshTime": 60,
"maxDecimalPoint": 2,
"maxDataPoints": 200,
"isAdvance": True,
"annotations": False,
"minValue": 0,
"maxValue": 1000,
"showLabel": True,
"startAngle": 90,
"endAngle": -269.99,
"alarms": {
"show": False
},
"width": 20,
"grid": {
"xGridLine": False,
"yGridLine": True
},
"chartType": "gauge",
"legend": {
"show": True,
"position": "bottom"
},
"title_font_size": 18,
"title_text_break": None,
"xaxis": {
"label": "",
"aggregations": [],
"group_by": {
"type": "timeSeries",
"value": ""
},
"format": "dd/MM/yyyy HH:mm:ss"
},
"yaxis": [
{
"aggregation": "sum",
"type": "gauge",
"name": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412:Agitator Running Status",
"tag": {
"value": "site_108$dept_110$line_117$equipment_118$tag_268",
"label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412:Agitator Running Status",
"high_performance": False,
"parameter_id": "tag_268",
"parameter_label": "Agitator Running Status",
"hierarchy_level": "equipment",
"hierarchy_name": "Vessel V-5412",
"hierarchy_label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"color": None,
"enable_color_config": False,
"color_config": [],
"unit": {
"label": None,
"value": None
},
"disabled": True
},
"selectedUnit": None,
"unit": None,
"unitInfo": {
"label": None,
"value": None
},
"conversionFactor": 1,
"color": None,
"data": []
},
{
"aggregation": "sum",
"type": "gauge",
"name": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412:MEK Pump Running Status",
"tag": {
"value": "site_108$dept_110$line_117$equipment_118$tag_267",
"label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412:MEK Pump Running Status",
"high_performance": False,
"parameter_id": "tag_267",
"parameter_label": "MEK Pump Running Status",
"hierarchy_level": "equipment",
"hierarchy_name": "Vessel V-5412",
"hierarchy_label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"color": None,
"enable_color_config": False,
"color_config": [],
"unit": {
"label": None,
"value": None
},
"disabled": True
},
"selectedUnit": None,
"unit": None,
"unitInfo": {
"label": None,
"value": None
},
"conversionFactor": 1,
"color": None,
"data": []
}
],
"filter": {
"timeRange": "last_five_minutes",
"timeRangeLabel": "Last 5 minutes",
"aggregation": "list",
"filterList": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_108$dept_110$line_117$equipment_118",
"name": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"node_id": "equipment_118",
"site_id": "site_108",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"value": "site_108$dept_110$line_117$equipment_118",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"isCustom": False,
"custom": {
"from": "2020-04-05T18:30:00.000Z",
"to": "2020-04-06T09:37:33.515Z"
},
"compare": {
"comparison": False,
"comparisonPeriod": "previous_period",
"custom": {
"from": "06-04-2020 15:07:33",
"to": "06-04-2020 15:07:33"
}
},
"filtersData": [
{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_108$dept_110$line_117$equipment_118",
"name": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"node_id": "equipment_118",
"site_id": "site_108",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-5412",
"value": "site_108$dept_110$line_117$equipment_118",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}
],
"between_time": {
"enable": False,
"from": "00:00",
"to": "23:00"
},
"n_value": 1
},
"sectorColors": [
[
0.2,
"#91c7ae"
],
[
0.8,
"#63869e"
],
[
1,
"#c23531"
]
],
"widget_type": "static",
"database": "kairos",
"changeChartType": "",
"widgetFilter": {
"show": False,
"options": []
},
"navigation": {
"placement": "bottom-right"
},
"advancedTable": {},
"filterParameters": []
},
"chartData": {
"series": [],
"category": []
}
},
"cConfig": {
"fontSize": 16,
"fontWeight": "lighter",
"bgColor": "#DBDFE2",
"color": "#000000",
"showBorder": True,
"textAlign": "left"
},
"cTypeLabel": "Gauge",
"roleBasedAccess": False,
"userRoles": []
},
"project_id": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
hierarchy_payload = {
"data": {},
"project_id": "",
"get_parameter_label": False,
"unit_info": True,
"additional_info": True,
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
yaxis_data = {
"name": "",
"group": None,
"aggregation": None,
"tag": {},
"selectedUnit": None,
"conversionFactor": 1,
"unit": None,
"unitInfo": {
"label": None,
"value": None
},
"color": None,
"position": "left",
"threshold": False,
"thresholdValue": 100,
"markers": [],
"min": None,
"max": None,
"benchmark": False,
"benchmarkValue": 100,
"type": "bar",
"digital": True,
"inverse": False,
"interval": "",
"cellStylingRules": [],
"enableColorConfig": {},
"data": []
}
filter_list = [{
"title": "Select Hierarchy",
"id": "hierarchy",
"value": [
{
"id": "site_108$dept_110$line_117$equipment_115",
"name": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-8406",
"node_id": "equipment_115",
"site_id": "site_108",
"type": "equipment",
"lat": "",
"long": "",
"site_label": None,
"label": "Bharuch Unit-1>FI-MPP>Vessel Section>Vessel V-8406",
"value": "site_108$dept_110$line_117$equipment_115",
"disabled": False,
"checked": True
}
],
"overwrite": True,
"type": "multiCheckboxSelect",
"list": [],
"emitOnInIt": False,
"site": None
}]
site_level_hierarchy_payload = {
"project_id": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
class KeyConstants:
output_file = "widget.json"
from scripts.config import Project_details
class AppPayload:
list_embedded_apps = {
"project_id": "",
"keys": [
"apps",
"types",
"category",
"headerContent"
],
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
list_embedded_apps_id_based = {
"app_id": "",
"project_id": "",
"name": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
class DashboardPayloads:
list_widgets = {
"dashboard_id": "",
"name": "",
"disable_usage_tracking": False,
"project_id": "",
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
cookies = {
"login-token": Project_details.LOGIN_TOKEN, "userId": Project_details.USER_ID,
"projectId": Project_details.PROJECT_ID
}
import httpx
from scripts.config import Project_details, Base_path
from scripts.constants.api import RequestEndpoints
from scripts.constants.json_constants import list_dashboard_payload
from scripts.constants.request_payloads import cookies
from scripts.logging.logger import logger
class Dashboards:
@staticmethod
def get_dashboard_details(dashboard_name):
try:
logger.info(f'service started in getting the dashboard reference')
existing_dashboard = list_dashboard_payload
existing_dashboard["searchText"] = dashboard_name["dashboard_name"]
existing_dashboard["filters"]["search"] = dashboard_name["dashboard_name"]
existing_dashboard["project_id"] = Project_details.PROJECT_ID
list_url = f'{Base_path.BASE_URL}{RequestEndpoints.list_dashboards}'
dashboard_lists = httpx.post(url=list_url, cookies=cookies, json=list_dashboard_payload)
json_response = dashboard_lists.json()
list_of_dashboards = json_response["data"]["body_content"]
if dashboard_lists.status_code != 200:
return False
dashboard_details = {}
for item in list_of_dashboards:
if item.get('name') == dashboard_name["dashboard_name"]:
dashboard_details = item
return dashboard_details
except Exception as e:
logger.exception(f'error while fetching the dashboard details {e}')
@staticmethod
def create_new_dashboard(existing_dashboard, new_dashboard_name):
try:
"""tested until this"""
logger.info(f'service started in creating new dashboard')
category = existing_dashboard["category"]
dashboard_type = existing_dashboard["type"]
dashboard_name = new_dashboard_name
list_of_dashboards = Dashboards().get_dashboard_details({"dashboard_name": dashboard_name})
# for data in list_of_dashboards:
if list_of_dashboards.get('name') == new_dashboard_name:
dashboard_name = f'{new_dashboard_name}_new'
Dashboards().create_dashboard(dashboard_name, category, dashboard_type)
new_dashboard_list = Dashboards().get_dashboard_details({"dashboard_name": dashboard_name})
dashboard_id = ""
# for data in new_dashboard_list:
if new_dashboard_list.get('name') == dashboard_name:
dashboard_id = new_dashboard_list.get('dashboard_id', '')
logger.info(f'dashboard id >>>> {dashboard_id}')
if dashboard_id:
return dashboard_id
else:
return False
except Exception as e:
logger.error(f'error while creating new dashboard {e}')
@staticmethod
def create_dashboard(dashboard_data, category, dashboard_type):
try:
logger.debug(f'creating json payload')
payload = {
"category": category,
"name": dashboard_data,
"project_id": Project_details.PROJECT_ID,
"type": dashboard_type,
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
url = f'{Base_path.BASE_URL}{RequestEndpoints.save_dashboard}'
response = httpx.post(url=url, cookies=cookies, json=payload)
return response
except Exception as e:
logger.error(f'error in create dashboard {e}')
import copy
import httpx
from scripts.config import Base_path, Project_details
from scripts.constants.api import RequestEndpoints
from scripts.constants.json_constants import site_level_hierarchy_payload, hierarchy_payload
from scripts.constants.request_payloads import cookies, DashboardPayloads
from scripts.logging.logger import logger
from scripts.utils.dashboard_utils import create_hierarchy
dashboard_payloads = DashboardPayloads()
class Widgets:
@staticmethod
def get_widget_details(existing_dashboard):
try:
logger.info(f'service started in getting the widget data')
list_widgets_url = f'{Base_path.BASE_URL}{RequestEndpoints.list_widgets}'
list_widgets_payload = dashboard_payloads.list_widgets
list_widgets_payload["project_id"] = Project_details.PROJECT_ID
list_widgets_payload["dashboard_id"] = existing_dashboard["dashboard_id"]
list_widgets_payload["name"] = existing_dashboard["name"]
widgets_details = httpx.post(url=list_widgets_url, cookies=cookies, json=list_widgets_payload)
widgets_details_json = widgets_details.json()
existing_widgets = widgets_details_json.get("data")
if widgets_details.status_code != 200 or not existing_widgets:
return False
return existing_widgets
except Exception as e:
logger.error(f'error while getting existing widget details {e}')
@staticmethod
def create_new_widgets(existing_widget, parameters_json, dashboard_id):
try:
logger.info(f'service started in creating new widgets')
count = 0
error_widgets = []
existing_widget_details = existing_widget.get("widget").get("wcData")
group_elements = [elem for elem in existing_widget_details if
elem.get('cData', {}).get('chartOptions', {}).get('chartType') == 'group']
if group_elements:
existing_widget_details = [elem for elem in existing_widget_details if elem not in group_elements]
existing_widget_details.extend(group_elements)
for widget in existing_widget_details:
new_widget_metadata, missing_tags = Widgets().create_pyload(widget, parameters_json)
widget_payload = {
"dashboard_id": dashboard_id,
"widget_data": new_widget_metadata,
"project_id": Project_details.PROJECT_ID,
"project_type": "customer",
"tz": "Asia/Kolkata",
"language": "en"
}
save_widget_url = f'{Base_path.BASE_URL}{RequestEndpoints.save_widget}'
save_widget_response = httpx.post(url=save_widget_url, cookies=cookies, json=widget_payload)
count += 1
if save_widget_response.status_code != 200:
error_widgets.append(count)
return error_widgets, missing_tags
except Exception as e:
logger.error(f'error while creating new widgets {e}')
@staticmethod
def create_pyload(widget, parameters_json):
try:
count = 0
logger.info(f'service started in creating payload')
filter_payload = []
new_yaxis_data = []
new_filter_parameters = []
missing_tags = []
new_widget_payload = widget
# filter_list_old = new_widget_payload["cData"]["chartOptions"]["filter"]["filterList"][0]["value"]
new_widget_payload.pop('widget_id')
if widget["cData"]["chartOptions"]["chartType"] == "group":
Widgets().get_group_widget(widget, parameters_json)
else:
if new_widget_payload.get("editMode"):
new_widget_payload.pop('editMode')
hierarchy_data, filter_data = create_hierarchy(parameters_json)
yaxis_parameters = widget["cData"]["chartOptions"]["yaxis"]
hierarchy_details_url = f'{Base_path.BASE_URL}{RequestEndpoints.hierarchy_details}'
hierarchy_payload_ = hierarchy_payload
hierarchy_payload_["project_id"] = Project_details.PROJECT_ID
hierarchy_details = httpx.post(url=hierarchy_details_url, cookies=cookies, json=hierarchy_payload_,
timeout=120)
hierarchy_details_json = hierarchy_details.json()
hierarchy_details_list = hierarchy_details_json["data"]
site_level_hierarchy_url = f'{Base_path.NEW_BASE_URL}{RequestEndpoints.get_site_level_hierarchy}'
payload_site_level = site_level_hierarchy_payload
payload_site_level["project_id"] = Project_details.PROJECT_ID
payload_site_level["tz"] = "Asia/Kolkata"
site_level_hierarchy = httpx.post(url=site_level_hierarchy_url, cookies=cookies,
json=payload_site_level, timeout=120)
widget_title = ''
if site_level_hierarchy.status_code == 200:
site_level_hierarchy_json = site_level_hierarchy.json()
site_level_hierarchy_data = site_level_hierarchy_json["site_hierarchy_data"]
current_site_level = {}
for select_hierarchy in filter_data:
for data_ in site_level_hierarchy_data:
if data_["name"] == select_hierarchy["filter"] and select_hierarchy["Existing Widget Name"] == \
widget["title"]:
widget_title = select_hierarchy["New widget Name"]
current_site_level = data_
current_site_level["label"] = current_site_level["name"]
current_site_level["value"] = current_site_level["id"]
current_site_level["disabled"] = False
current_site_level["checked"] = True
filter_payload.append(current_site_level)
new_widget_payload["cData"]["chartOptions"]["filter"]["filterList"][0]["value"] = filter_payload
new_widget_payload["cData"]["chartOptions"]["filter"]["filtersData"][0]["value"] = filter_payload
"""tested till here"""
for tags in hierarchy_details_list:
flag = 0
for data in yaxis_parameters:
for tag_name in hierarchy_data:
if tag_name.get("Tag Name", "") == tags["label"] and tag_name["Existing Widget Name"] == widget[
"title"]:
count += 1
print(count)
current_tag = tags
disable = data["tag"].get("disabled", True)
data["tag"] = current_tag
data["tag"]["disabled"] = disable
data["name"] = tag_name["Label"]
data["unitInfo"] = current_tag['unit']
data["unit"] = current_tag['unit']['label']
flag = 1
new_yaxis_data.append(copy.deepcopy(data))
if flag:
break
if widget["cData"]["chartOptions"].get("wSettings", ""):
dynamic_yaxis = widget["cData"]["chartOptions"]["yaxis"]
for data in dynamic_yaxis:
label = data["tag"]["label"]
for tag in hierarchy_details_list:
parameter_data = tag["label"].split(':')
tag_label = parameter_data[-1]
if label == tag_label:
tag_value = tag["value"]
split_value = tag_value.split('$')
parameter_value = split_value[-1]
data["tag"]["value"] = parameter_value
new_yaxis_data.append(data)
filter_parameters = widget["cData"]["chartOptions"]["filterParameters"]
for data in filter_parameters:
label = data["tag"]["label"]
for tag in hierarchy_details_list:
parameter_data = tag["label"].split(':')
tag_label = parameter_data[-1]
if label == tag_label:
tag_value = tag["value"]
split_value = tag_value.split('$')
parameter_value = split_value[-1]
data["tag"]["value"] = parameter_value
new_filter_parameters.append(data)
new_widget_payload["cData"]["chartOptions"]["filterParameters"] = new_filter_parameters
new_widget_payload["title"] = widget_title
new_widget_payload["description"] = widget_title
new_widget_payload["cData"]["chartOptions"]["yaxis"] = new_yaxis_data
x_axis_data = widget["cData"]["chartOptions"]["xaxis"]
aggregation_parameters = []
if x_axis_data["aggregations"]:
xaxis_aggregations = x_axis_data["aggregations"]
for parameters in xaxis_aggregations:
if parameters["parameters"]:
aggregation_parameters = parameters["parameters"]
if aggregation_parameters:
# old
hierarchy_details_url_old = f'{Base_path.BASE_URL}{RequestEndpoints.hierarchy_details}'
old_env_cookie = {
"login-token": Project_details.LOGIN_TOKEN,
"userId": Project_details.USER_ID,
"projectId": Project_details.PROJECT_ID
}
hierarchy_payload_old = hierarchy_payload.copy()
hierarchy_payload_old["project_id"] = Project_details.PROJECT_ID
hierarchy_details_old = httpx.post(url=hierarchy_details_url_old, cookies=old_env_cookie,
json=hierarchy_payload_old, timeout=80)
hierarchy_details_json_old = hierarchy_details_old.json()
hierarchy_details_list_old = hierarchy_details_json_old["data"]
new_parameters = []
params_label = []
changed_params_label = []
for params in aggregation_parameters:
for tags in hierarchy_details_list_old:
if params == tags["value"]:
params_label.append(tags["label"])
# for label in params_label:
# if label in filtered_hierarchy_data:
# changed_params_label.append(filtered_hierarchy_data[label])
if changed_params_label:
for changed_label in changed_params_label:
for tags in hierarchy_details_list:
if changed_label == tags["label"]:
new_parameters.append(tags["value"])
new_widget_payload["cData"]["chartOptions"]["xaxis"]["aggregations"][0]["parameters"] = new_parameters
return new_widget_payload, missing_tags
except Exception as e:
logger.error(f'error while creating payload {e}')
pass
@staticmethod
def get_group_widget(widget, parameters_json):
logger.info(f'service started in creating group widget')
for data in parameters_json:
if data["Tag Name"] == "Group Widget":
print("tbd")
widget["cData"]["widgetsList"] = "list"
import logging
import pathlib
from logging import StreamHandler
from logging.handlers import RotatingFileHandler, SocketHandler
from scripts.config import Services, PathConf
def read_configuration():
return {
"name": Services.PROJECT_NAME,
"handlers": [
{"type": "RotatingFileHandler", "max_bytes": Services.MAX_BYTES, "back_up_count": Services.BACKUP_COUNT},
{"type": "StreamHandler", "name": Services.PROJECT_NAME},
],
}
def init_logger():
logging_config = read_configuration()
"""
Creates a rotating log
"""
__logger__ = logging.getLogger(Services.PROJECT_NAME)
__logger__.setLevel(Services.LOG_LEVEL)
log_formatter = "%(asctime)s - %(levelname)-6s - [%(funcName)5s(): %(lineno)s] - %(message)s"
time_format = "%Y-%m-%d %H:%M:%S"
formatter = logging.Formatter(log_formatter, time_format)
for each_handler in logging_config["handlers"]:
if (
each_handler["type"] in ["RotatingFileHandler"]
and Services.ENABLE_FILE_LOGGING
):
pathlib.Path(PathConf.LOG_PATH).mkdir(parents=True, exist_ok=True)
log_file = pathlib.Path(PathConf.LOG_PATH, f"{Services.PROJECT_NAME}.log")
temp_handler = RotatingFileHandler(
log_file,
maxBytes=each_handler["max_bytes"],
backupCount=each_handler["back_up_count"],
)
temp_handler.setFormatter(formatter)
elif each_handler["type"] in ["SocketHandler"]:
temp_handler = SocketHandler(each_handler["host"], each_handler["port"])
elif each_handler["type"] in ["StreamHandler"]:
temp_handler = StreamHandler()
temp_handler.setFormatter(formatter)
else:
temp_handler = None
__logger__.addHandler(temp_handler)
return __logger__
logger = init_logger()
from fastapi import APIRouter
from scripts.services import dashboards
router = APIRouter()
router.include_router(dashboards.router)
import logging
import pandas as pd
from fastapi import APIRouter, UploadFile, File, Form
from scripts.config import Services
from scripts.constants.api import ApiEndpoints
from scripts.core.handlers.dashboard_handler import Dashboards
from scripts.core.handlers.widget_handler import Widgets
from scripts.utils.dashboard_utils import create_json
logger = logging.getLogger(Services.PROJECT_NAME)
router = APIRouter(prefix=ApiEndpoints.dashboards)
dashboard_handler = Dashboards()
widget_handler = Widgets()
@router.post(ApiEndpoints.dashboards + ApiEndpoints.create_new, tags=["1.create dashboard"])
async def create_dashboard(file: UploadFile = File(...), sheet_name: str = Form(), new_dashboard_name: str = Form(),
existing_dashboard_name: str = Form()):
"""
:param existing_dashboard_name: name of existing dashboard which we need to take reference
:param new_dashboard_name: name of new dashboard to be created
:param file: Excel file with parameter details
:param sheet_name: name of the sheet which we need to create dashboard
:return: success or failure message
"""
try:
logger.info(f'service started in creating dashboard')
with open(file.filename, "wb") as f:
f.write(file.file.read())
with pd.ExcelFile(file.filename, engine="openpyxl") as xls:
parameters_df = pd.read_excel(xls, sheet_name=sheet_name)
parameters_json = create_json(parameters_df)
dashboard_name = {"dashboard_name": existing_dashboard_name}
existing_dashboards = dashboard_handler.get_dashboard_details(dashboard_name)
if existing_dashboards:
existing_widget = widget_handler.get_widget_details(existing_dashboards)
if existing_widget:
dashboard_response = dashboard_handler.create_new_dashboard(existing_dashboards, new_dashboard_name)
if dashboard_response:
widget_response, missing_tags = widget_handler.create_new_widgets(existing_widget, parameters_json,
dashboard_response)
if widget_response or missing_tags:
return {
"widget": f'widget number:{widget_response} missing',
"tag": f'tag {missing_tags} not found'
}
else:
return {
"status": "failed",
"error": "error in getting widget details"
}
else:
return {
"status": "failed",
"error": "error in getting dashboard details"
}
except Exception as e:
logger.exception(f'error while creating dashboard {e}')
import json
import httpx
from tzlocal import get_localzone
from scripts.config import Base_path, Project_details
from scripts.constants.api import RequestEndpoints
from scripts.constants.keys import KeyConstants
from scripts.logging.logger import logger
def get_local_timezone():
local_timezone = get_localzone()
return local_timezone
def get_dashboards_list(list_dashboard_payload, cookies):
if not cookies:
cookies = {
"login-token": Project_details.LOGIN_TOKEN, "userId": Project_details.USER_ID,
"projectId": Project_details.PROJECT_ID
}
list_url = f'{Base_path.BASE_URL}{RequestEndpoints.list_dashboards}'
dashboard_lists = httpx.post(url=list_url, cookies=cookies, json=list_dashboard_payload)
json_response = dashboard_lists.json()
list_of_dashboards = json_response["data"]["body_content"]
return list_of_dashboards
def get_hierarchy(data):
combination_dict = {}
filter_dict = {}
for doc in data:
widget_type_key = f"{doc['widget_name']}_{doc['type']}"
filter_combination = f"{doc['site']}>"
combination = f"{doc['site']}>"
filter_combination += f"{doc['plant']}>" if doc['plant'] else ""
combination += f"{doc['plant']}>" if doc['plant'] else ""
filter_combination += f"{doc['line']}>" if doc['line'] else ""
combination += f"{doc['line']}>" if doc['line'] else ""
filter_combination += f"{doc['equipment']}" if doc['equipment'] else ""
combination += f"{doc['equipment']}:" if doc['equipment'] else ""
combination += f"{doc['parameters']}" if doc['parameters'] else ""
# Check if the combination is already present
if widget_type_key in combination_dict:
combination_dict[widget_type_key].append(combination)
else:
combination_dict[widget_type_key] = [combination]
if widget_type_key not in filter_dict:
filter_dict[widget_type_key] = [filter_combination]
else:
if filter_combination not in filter_dict[widget_type_key]:
filter_dict[widget_type_key].append(filter_combination)
return combination_dict, filter_dict
def create_hierarchy(json_data):
combination_list = []
filter_list = []
for data in json_data:
filter_data = data["Tag Name"].split(":")[0]
data["filter"] = filter_data
filter_list.append(data)
combination_list.append(data)
return combination_list, filter_list
def get_new_dashboards_list(list_dashboard_payload, cookies):
list_url = f'{Base_path.NEW_BASE_URL}{RequestEndpoints.list_dashboards}'
dashboard_lists = httpx.post(url=list_url, cookies=cookies, json=list_dashboard_payload)
json_response = dashboard_lists.json()
list_of_dashboards = json_response["data"]["body_content"]
return list_of_dashboards
def create_json(df):
try:
logger.debug(f'creating json')
data_dict = df.to_dict(orient='split')
keys = data_dict['columns']
values = data_dict['data']
json_data = [dict(zip(keys, v)) for v in values]
with open(KeyConstants.output_file, 'w') as f:
json.dump(json_data, f)
return json_data
except Exception as e:
logger.error(f'error while creating json {e}')
from __future__ import annotations
import logging
from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union
from pymongo import MongoClient
from pymongo.command_cursor import CommandCursor
from pymongo.cursor import Cursor
from pymongo.results import (
DeleteResult,
InsertManyResult,
InsertOneResult,
UpdateResult,
)
class MongoCollectionBaseClass:
def __init__(
self,
mongo_client: MongoClient,
database: str,
collection: str,
) -> None:
self.client = mongo_client
self.database = database
self.collection = collection
def __repr__(self) -> str:
return f"{self.__class__.__name__}(database={self.database}, collection={self.collection})"
def insert_one(self, data: Dict) -> InsertOneResult:
"""
The function is used to inserting a document to a collection in a Mongo Database.
:param data: Data to be inserted
:return: Insert ID
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.insert_one(data)
except Exception as e:
logging.exception(e)
raise
def insert_many(self, data: List) -> InsertManyResult:
"""
The function is used to inserting documents to a collection in a Mongo Database.
:param data: List of Data to be inserted
:return: Insert IDs
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.insert_many(data)
except Exception as e:
logging.exception(e)
raise
def find(
self,
query: dict,
filter_dict: Optional[dict] = None,
sort: Union[
None, str, Sequence[Tuple[str, Union[int, str, Mapping[str, Any]]]]
] = None,
skip: int = 0,
limit: Optional[int] = None,
) -> Cursor:
"""
The function is used to query documents from a given collection in a Mongo Database
:param query: Query Dictionary
:param filter_dict: Filter Dictionary
:param sort: List of tuple with key and direction. [(key, -1), ...]
:param skip: Skip Number
:param limit: Limit Number
:return: List of Documents
"""
if sort is None:
sort = []
if filter_dict is None:
filter_dict = {"_id": 0}
database_name = self.database
collection_name = self.collection
try:
db = self.client[database_name]
collection = db[collection_name]
if len(sort) > 0:
cursor = (
collection.find(
query,
filter_dict,
)
.sort(sort)
.skip(skip)
)
else:
cursor = collection.find(
query,
filter_dict,
).skip(skip)
if limit:
cursor = cursor.limit(limit)
return cursor
except Exception as e:
logging.exception(e)
raise
def find_one(self, query: dict, filter_dict: Optional[dict] = None) -> dict | None:
try:
database_name = self.database
collection_name = self.collection
if filter_dict is None:
filter_dict = {"_id": 0}
db = self.client[database_name]
collection = db[collection_name]
return collection.find_one(query, filter_dict)
except Exception as e:
logging.exception(e)
raise
def update_one(
self,
query: dict,
data: dict,
upsert: bool = False,
strategy: str = "$set",
) -> UpdateResult:
"""
:param strategy:
:param upsert:
:param query:
:param data:
:return:
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.update_one(query, {strategy: data}, upsert=upsert)
except Exception as e:
logging.exception(e)
raise
def update_many(
self, query: dict, data: dict, upsert: bool = False
) -> UpdateResult:
"""
:param upsert:
:param query:
:param data:
:return:
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.update_many(query, {"$set": data}, upsert=upsert)
except Exception as e:
logging.exception(e)
raise
def delete_many(self, query: dict) -> DeleteResult:
"""
:param query:
:return:
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.delete_many(query)
except Exception as e:
logging.exception(e)
raise
def delete_one(self, query: dict) -> DeleteResult:
"""
:param query:
:return:
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.delete_one(query)
except Exception as e:
logging.exception(e)
raise
def distinct(self, query_key: str, filter_json: Optional[dict] = None) -> list:
"""
:param query_key:
:param filter_json:
:return:
"""
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.distinct(query_key, filter_json)
except Exception as e:
logging.exception(e)
raise
def aggregate(
self,
pipelines: list,
) -> CommandCursor:
try:
database_name = self.database
collection_name = self.collection
db = self.client[database_name]
collection = db[collection_name]
return collection.aggregate(pipelines)
except Exception as e:
logging.exception(e)
raise
""" Mongo DB utility
All definitions related to mongo db is defined in this module
"""
from pymongo import MongoClient
from .mongo_tools import mongo_sync
from ..logging.logger import logger
class MongoConnect:
def __init__(self, uri):
try:
self.uri = uri
self.client = MongoClient(uri, connect=False)
except Exception as e:
logger.exception(e)
raise
def __call__(self, *args, **kwargs):
return self.client
def get_client(self):
return self.client
def __repr__(self):
return f"Mongo Client(uri:{self.uri}, server_info={self.client.server_info()})"
@staticmethod
def get_base_class():
return mongo_sync.MongoCollectionBaseClass
class MongoStageCreator:
@staticmethod
def add_stage(stage_name: str, stage: dict) -> dict:
return {stage_name: stage}
def projection_stage(self, stage: dict) -> dict:
return self.add_stage("$project", stage)
def match_stage(self, stage: dict) -> dict:
return self.add_stage("$match", stage)
def lookup_stage(self, stage: dict) -> dict:
return self.add_stage("$lookup", stage)
def unwind_stage(self, stage: dict) -> dict:
return self.add_stage("$unwind", stage)
def group_stage(self, stage: dict) -> dict:
return self.add_stage("$group", stage)
def add_fields(self, stage: dict) -> dict:
return self.add_stage("$addFields", stage)
def sort_stage(self, stage: dict) -> dict:
return self.add_stage("$sort", stage)
def regex_stage(self, stage: dict) -> dict:
return self.add_stage("$regex", stage)
def not_equal(self, stage: dict) -> dict:
return self.add_stage("$ne", stage)
[{"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Running Status(P1127)", "Label": "Running Status", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Outlet Flow(FIC11295)", "Label": "Outlet Flow", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Bottom Temperature(TIC11225)", "Label": "Bottom Temperature", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Middle Top Temperature(TIC11222)", "Label": "Middle Top Temp", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Top Flow(FIC11269)", "Label": "Top Flow", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Moisture Removal Column C-1122:Differential Pressure(PDI11223)", "Label": "Differential Pressure", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>66 TPH Boiler>Steam And Water System>Steam Prs Station 2PIC0303:Pressure(2PIC0303)", "Label": "Pressure", "Existing Widget Name": "Widget", "New widget Name": "Test 1", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Vaccum Pump System S607:Current(S607_AMP)", "Label": "Current", "Existing Widget Name": "Widget2", "New widget Name": "Test 2", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Column Section>Vaccum Pump System S607:Pressure(PT-1)", "Label": "Pressure", "Existing Widget Name": "Widget2", "New widget Name": "Test 2", "Null": "Automation test KPI"}, {"Tag Name": "NEO>MEA Plant>Reaction Section>Catalyst Prepeartion Reactor R-1005:Inlet valve(HS10035)", "Label": "Inlet valve", "Existing Widget Name": "Widget2", "New widget Name": "Test 2", "Null": "Automation test KPI"}]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment