Optional
realtime: RealtimeCreates a new measurement.
At least sourceId is mandantory.
Response wrapped in [[IResult]]
Example
const mandantoryObject: Partial<IMeasurementCreate> = {
sourceId: device.id,
fragment: { series: { unit: '%', value: 51 } },
};
(async () => {
const {data, res} = await measurementService.create(mandantoryObject);
})();
Removes a measurement with given id.
Response wrapped in [[IResult]]
Gets the details of selected measurement.
Entity or Id of the entity.
Response wrapped in [[IResult]]
Retrieves the measurement file based on the provided filter parameters and headers, but only if the response is 200. If the response is 202, the file is processed in the background and the file is sent by email.
Example
const filter: IFetchResponse = {
dateFrom: "2024-08-11T12:13:00+02:00"
dateTo: "2024-08-12T12:15:00+02:00"
source: "32666427"
valueFragmentSeries: "accelerationX"
valueFragmentType: "c8y_Acceleration"
};
const headers = {
accept: 'text/csv'
}
(async () => {
const response = await measurementService.getMeasurementsFile(filter, headers);
if (response.status === 200) {
const blob = await response.blob();
}
})();
The headers for the request.
A promise that resolves to the fetch response.
Gets the list of measurements filtered by parameters.
Object containing filters for querying measurements.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await measurementService.list(filter);
})();
Response wrapped in [[IResultList]]
Gets the list of series in a measurement filtered by parameters.
Response wrapped in [[IResult]]
This class allows for managing measurements.