Class: DataStream

DataStream(properties, networkPropertiesopt)

new DataStream(properties, networkPropertiesopt)

Parameters:
Name Type Attributes Default Description
properties Object the properties of the object
networkProperties Object <optional>
{}
Properties
Name Type Attributes Default Description
endpointUrl String defines the Http(s) endpoint URL
tls Boolean defines is use Http or Https secure protocol for fetching data
streamProtocol String <optional>
'ws' the Stream protocol to use: 'ws' pr 'mqtt'
mqttOpts Object <optional>
{} the Mqtt options if stream protocol is 'mqtt'
Properties
Name Type Description
prefix String the Mqtt prefix value
endpointUrl String the Mqtt specific endpointUrl
Source:

Methods

(async) getSchema(dataStreamFilteropt) → {Promise.<JSON>}

Get the schema of a datastream route: /datastreams/{id}/schema
Parameters:
Name Type Attributes Default Description
dataStreamFilter DataStreamFilter <optional>
new DataStreamFilter() default datastream filter
Source:
Returns:
- the JSON schema
Type
Promise.<JSON>

(async) searchObservations(observationFilteropt, pageSizeopt, parseropt) → {Collection.<JSON>}

Retrieve historical observations from a datastream route: /datastreams/{id}/observations
Parameters:
Name Type Attributes Default Description
observationFilter ObservationFilter <optional>
new ObservationFilter() default ObservationFilter
pageSize Number <optional>
10 default page size
parser DataSourceParser <optional>
new SweApiResultParser() default observations parser
Source:
Returns:
- result observations as JSON
Type
Collection.<JSON>

streamObservations(observationFilteropt, callback)

Retrieve historical observations from a datastream route: /datastreams/{id}/observations
Parameters:
Name Type Attributes Default Description
observationFilter ObservationFilter <optional>
new ObservationFilter() default ObservationFilter
callback function A callback to get observations
Source: