diff --git a/bin/load.py b/bin/load.py index 7cc4a6b..e56f2af 100755 --- a/bin/load.py +++ b/bin/load.py @@ -115,6 +115,7 @@ sp.pipeline, l.endpoint, e.endpoint_url, + s.licence, l.status, l.exception, l.resource, @@ -134,7 +135,7 @@ LEFT JOIN resource r on l.resource = r.resource GROUP BY - 1, 2, 3, 4, 5, 6, 7, 8, 9 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ORDER BY s.organisation, o.name, s.collection, sp.pipeline, latest_log_entry_date DESC @@ -151,6 +152,7 @@ sp.pipeline, l.endpoint, e.endpoint_url, + s.licence, l.status, t2.days_since_200, l.exception, @@ -186,7 +188,7 @@ WHERE e.end_date='' GROUP BY - 1, 2, 3, 4, 5, 6, 7, 8, 9 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ORDER BY s.organisation, o.name, s.collection, sp.pipeline, endpoint_entry_date DESC diff --git a/bin/load_performance.py b/bin/load_performance.py index 57b00d4..0690fc6 100755 --- a/bin/load_performance.py +++ b/bin/load_performance.py @@ -160,6 +160,7 @@ def fetch_reporting_data(db_path): rhe.pipeline, rhe.endpoint, rhe.endpoint_url, + rhe.licence, rhe.resource, rhe.status, rhe.exception, diff --git a/bin/load_reporting_tables.py b/bin/load_reporting_tables.py index 383670c..2c93384 100755 --- a/bin/load_reporting_tables.py +++ b/bin/load_reporting_tables.py @@ -24,6 +24,7 @@ def fetch_historic_endpoints_data_from_dl(db_path): sp.pipeline, l.endpoint, e.endpoint_url, + s.licence, l.status, l.exception, l.resource, @@ -43,7 +44,7 @@ def fetch_historic_endpoints_data_from_dl(db_path): LEFT JOIN resource r on l.resource = r.resource GROUP BY - 1, 2, 3, 4, 5, 6, 7, 8, 9 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ORDER BY s.organisation, o.name, s.collection, sp.pipeline, latest_log_entry_date DESC @@ -66,6 +67,7 @@ def fetch_latest_endpoints_data_from_dl(db_path): sp.pipeline, l.endpoint, e.endpoint_url, + s.licence, l.status, t2.days_since_200, l.exception, @@ -101,7 +103,7 @@ def fetch_latest_endpoints_data_from_dl(db_path): WHERE e.end_date='' GROUP BY - 1, 2, 3, 4, 5, 6, 7, 8, 9 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ORDER BY s.organisation, o.name, s.collection, sp.pipeline, endpoint_entry_date DESC @@ -126,6 +128,7 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo pipeline TEXT, endpoint TEXT, endpoint_url TEXT, + licence TEXT, status TEXT, exception TEXT, resource TEXT, @@ -138,9 +141,9 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo """) cursor.executemany(""" INSERT INTO reporting_historic_endpoints ( - organisation, name, collection, pipeline, endpoint, endpoint_url, status, exception, resource, + organisation, name, collection, pipeline, endpoint, endpoint_url, licence, status, exception, resource, latest_log_entry_date, endpoint_entry_date, endpoint_end_date, resource_start_date, resource_end_date - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, historic_endpoints_data) # Create the reporting_latest_endpoints table @@ -152,6 +155,7 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo pipeline TEXT, endpoint TEXT, endpoint_url TEXT, + licence TEXT, status TEXT, days_since_200 INTEGER, exception TEXT, @@ -168,9 +172,9 @@ def create_reporting_tables(historic_endpoints_data, latest_endpoint_data, perfo # Insert data into reporting_latest_endpoints cursor.executemany(""" INSERT INTO reporting_latest_endpoints ( - organisation, name, collection, pipeline, endpoint, endpoint_url, status, days_since_200, exception, resource, + organisation, name, collection, pipeline, endpoint, endpoint_url, licence, status, days_since_200, exception, resource, latest_log_entry_date, endpoint_entry_date, endpoint_end_date, resource_start_date, resource_end_date, rn - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?) + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, latest_endpoint_data)