system.kanoa.quality.config.addDataSource
Description
Adds a new attribute datasource in KanoaQDS. Catches the Java exception if this datasource already exists for this attributeId/assetId combo.Syntax
addDataSource(attrInfo, userId)- dict attrInfo - Dictionary, e.g., {'attributeId': 3, 'assetId': 5, 'sourceTagPath': 'some tag path', 'scaleFactor': 1.0, 'ignoreZeroValues': True, 'enabled': True}
- int userId - User ID
- int attributeDataSourceId - ID of the added attribute datasource.
- str msg - Message indicating the result of the addition.
Code Examples
# Usage example
attr_info = {'attributeId': 3, 'assetId': 5, 'sourceTagPath': 'some tag path', 'scaleFactor': 1.0, 'ignoreZeroValues': True, 'enabled': True}
added_attr_datasource_id, add_msg = system.kanoa.quality.config.addDataSource(attrInfo=attr_info, userId=123)
if added_attr_datasource_id is not None:
print(f"Successfully added attribute datasource with ID {added_attr_datasource_id}")
else:
print(f"Addition failed. Error: {add_msg}")