Cumulocity API Services / com.softwareag.jc.cumulocity.services.api / MeasurementsService

MeasurementsService

class MeasurementsService : ConnectionRequest<User, List<Measurement>>

Access point for retrieving and sending measurements to/from Cumulocity, data represented as Measurement and accessed via API endpoint /measurement/measurements

Types

AggregateType

enum class AggregateType

Specifies how the measurements results to be grouped, by minute, hour or 24 hours (DAILY)

Constructors

<init>

MeasurementsService(connection: CumulocityConnectionFactory.CumulocityConnection)

Creates a single use instance that cab be used to launch a query, do not reuse the same instance for multiple queries

Properties

connection

val connection: CumulocityConnectionFactory.CumulocityConnection

Connection referencing cumulocity tenant, instance and credentials to use

Functions

get

fun get(id: String, from: Date, to: Date, aggregrationType: MeasurementsService.AggregateType, reverseDateOrder: Boolean, responder: RequestResponder<List<Measurement>>): Unit

Returns a list of Measurement generated by the asset for the given id parameter.

fun get(id: String, type: String, from: Date, to: Date, aggregrationType: MeasurementsService.AggregateType, reverseDateOrder: Boolean, responder: RequestResponder<List<Measurement>>): Unit

Returns a list of Measurement generated by the asset for the given external id

path

fun path(): String

post

fun post(measurements: Array<Measurement>, responder: RequestResponder<List<Measurement>>): Unit

Posts measurements to cumulocity

response

fun response(response: String): List<Measurement>