API - data-stream-type


Add a data stream type.

Prerequisites

  • A data stream type id (less than 50 chars) as {dst}, for example, “Electricity”;
  • A data stream type name as {dst_name}, for example, “Electricity Usage”
  • The data type has been created and get its id as {dt}, for example, “elec_mw”;
  • The process type is valid and get its id as {pt}, for example, “sum”;
  • The process parameters as {pt_params}, for example, “5minutes”;
  • The min value (optional), for example 10.0;
  • The max value (optional), for example 100.0;
  • The rounding factor (optional), for example 10.0;
  • The epoch length (optional), for example 5;
  • The max sample per epoch (optional), for example 7.
  • (Please refer to the get process type response data for the possible combination of pt and pt_params)

Method

POST

URI

/api/v1/data-stream-type

Request body

{
  "dst": "Electricity",
  "dst_name": "Electricity Usage",
  "dt": "elec_mw",
  "pt": "sum",
  "pt_params": "5minutes",
  "min_value": 10.0,
  "max_value": 100.0,
  "rounding_factor": 10.0,
  "epoch_length": 5,
  "max_samples_per_epoch": 7
}

Response Sample

200 OK
[
    {
        "dst": "Electricity",
        "dst_name": "Electricity Usage",
        "dt": "elec_mw",
        "pt": "sum",
        "pt_params": "5minutes",
        "min_value": 10,
        "max_value": 100,
        "rounding_factor": 10,
        "epoch_length": 5,
        "max_samples_per_epoch": 7,
        "created_at": "2019-06-11 09:06:05",
        "updated_at": "2019-06-11 09:06:05"
    }
]

{info} The code Electricity for the data stream type will be returned as part of the resource URI.