Flags
Flags indicate the quality of a data point. Every data point written to a time series carries a flag value. When combining multiple time series in a calculation, the flag of each data point may affect the final result.
Flags are represented as numeric integer values in all API requests and responses.
Retrieving Available Flags
Section titled “Retrieving Available Flags”To retrieve all flag values recognized by the service:
GET /flagsFlags are stored on the database directly and are thus independent of repositories. The actual set of flags and their numeric values depends on the server configuration.
Default flags response body
Section titled “ Default flags response body”[ { "value": 0, "priority": 0, "name": "Ignore" }, { "value": 5, "priority": 20, "name": "Manually Replaced" }, { "value": 7, "priority": 60, "name": "Faulty" }, { "value": 9, "priority": 30, "name": "Valid" }, { "value": 12, "priority": 40, "name": "Scheduled" }, { "value": 19, "priority": 80, "name": "Missing" }, { "value": 20, "priority": 10, "name": "Accounted" }, { "value": 21, "priority": 50, "name": "Estimated" }, { "value": 22, "priority": 70, "name": "Interpolated" }]Looking Up a Flag by Name or Value
Section titled “Looking Up a Flag by Name or Value”To retrieve a specific flag by its name (GET /flags/{name}), for example the flag Valid:
GET /flags/{name}To retrieve a specific flag by its numeric value (GET /flags/value:{value}), for example the flag with the value 9:
GET /flags/value:{value}Using Flags When Writing Data
Section titled “Using Flags When Writing Data”When writing data to a time series, include the flag value for each data point in the flag field. See Working with Time Series Data for the full write request format.
{ "data": [ { "time": "2024-01-01T00:00:00Z", "value": 100.0, "flag": 9 }, { "time": "2024-02-01T00:00:00Z", "value": 150.0, "flag": 5 } ]}Custom Flags
Section titled “Custom Flags”Custom flags and their priorities are configured server-side. The PowerTSM HTTP API reflects whatever flags and priorities have been configured. Querying GET /flags always returns the current set of recognized flags, including any custom ones.