sailor.sap_iot.write

Timeseries module can be used to write timeseries data to the SAP iot extension timeseries api.

Currently only a single function to upload a TimeseriesDataset is exposed. It will upload the full dataset, indicator and equipment information is taken from the TimeseriesDataset.

sailor.sap_iot.write.upload_indicator_data(dataset, force_update=False)[source]

Upload a TimeseriesDataset to SAP IoT.

This functionality is currently in BETA. Please report any bugs at https://github.com/SAP/project-sailor/issues. The entire dataset will be uploaded. It may not contain any AggregatedIndicators. Please note that only some indicators from an IndicatorGroup are present in the dataset, SAP IoT will delete any values for the missing indicators for the uploaded timestamps.

Parameters
  • dataset (TimeseriesDataset) – TimeseriesDataset of indicators to be updated to SAP IoT.

  • force_update – A boolean to force an update of an IndicatorGroup with some indicators. Default value is False, no forced update. When set ‘True’ indicators which are not in dataset will be set to ‘NaN’ for period of time.

Examples

Force update timeseries data of IndicatorGroup ‘my_indicator_group’. Dataset ‘my_some_timeseries_data’ which has only some indicators of ‘my_indicator_group’:

upload_indicator_data(my_some_timeseries_data, force_update=True)

Update timeseries data of ‘my_indicator_group’ indicators. Dataset ‘my_timeseries_data’ includes all indicators of group ‘my_indicator_group’:

upload_indicator_data(my_timeseries_data)