SIENTIAPDE-1478

Enhance PI Web API Scouter Workflow and Documentation

- Added support for PI Web API data ingestion, including real-time and historical data retrieval.
- Implemented timestamp normalization to ensure consistency across records.
- Updated README.md to reflect new features and detailed workflow execution flow.
- Enhanced API class with comprehensive error handling and cleanup operations.
- Improved CoreScouter workflow with early exit conditions and detailed processing steps.
- Updated configuration parameters for better clarity and usability.
This commit is contained in:
vitor-aignosi
2026-01-09 09:49:55 -03:00
parent b75f499436
commit 4352c67f3a
5 changed files with 150 additions and 15 deletions

View File

@@ -63,6 +63,10 @@ class API(SientiaMonitoring):
def close(self) -> None:
"""
Close the PI Web API client and shutdown monitoring services.
This method performs cleanup operations:
- Closes the PI Web API client connection
- Shuts down SientiaMonitoring services (metrics, notifications)
"""
self.pi_web_api_client.close()
SientiaMonitoring.shutdown(self)
@@ -76,6 +80,11 @@ class API(SientiaMonitoring):
for a set of configured tags. It returns the data as a list of dictionaries
suitable for further processing in the workflow.
The timestamps are normalized to ensure consistency across all records in the
response. After converting timestamps to string format, all timestamps are
set to the maximum timestamp value (lexicographically) found in the dataset.
This ensures all records in a single batch share the same timestamp value.
Args:
input_data (dict[str, Any]): Activity input parameters.
Required fields:
@@ -88,7 +97,7 @@ class API(SientiaMonitoring):
Returns:
list[dict]: List of data records, each containing:
- timestamp: Data point timestamp
- timestamp: Normalized timestamp string (all records share the same value)
- name: Tag name
- value: Numeric value
- tag: WebId