Datastream

Datastream

Datastream Objects

class Datastream()

Defines the builder to configure a datastream of IoT datamodel. With this builder you can configure a datastream

constructor
function constructor()

addQrating
function addQrating(qrating: Object) -> 'Datastream'

Set the qrating attribute. Use {Qrating} utility for create this object

Arguments:

  • qrating Object

Returns:

  • Datastream

build
function build() -> 'Object'

Build a Datastream json object

Returns:

  • Object - Datastream json object

Example:

ogapi.DatastreamsBuilder().build()

withAccess
function withAccess(access: Array) -> 'Datastream'

Set the access object. Possible values: [READ, WRITE], [READ], [WRITE], []

Arguments:

  • access Array

Returns:

  • Datastream

withDescription
function withDescription(description: string) -> 'Datastream'

Set the description attribute

Arguments:

  • description string

Returns:

  • Datastream

withId
function withId(id: string) -> 'Datastream'

Set the id attribute

Arguments:

  • id string - required field

Returns:

  • Datastream

withName
function withName(name: string) -> 'Datastream'

Set the name attribute

Arguments:

  • name string - required field

Returns:

  • Datastream

withPeriod
function withPeriod(period: string) -> 'Datastream'

Set the period attribute. Possible values: PULSE, CUMULATIVE, INSTANT

Arguments:

  • period string - required field

Returns:

  • Datastream

withSchema
function withSchema(schema: Object) -> 'Datastream'

Set the schema object attribute.

Arguments:

  • schema Object

Returns:

  • Datastream

withStorage
function withStorage(period: string,total: number) -> 'Datastream'

Set the storage object.

Arguments:

  • period string
  • total number

Returns:

  • Datastream

withTags
function withTags(tags: Array) -> 'Datastream'

Set the tags attribute.

Arguments:

  • tags Array

Returns:

  • Datastream

withUnit
function withUnit(type: string,label: string,symbol: string) -> 'Datastream'

Set the unit object attribute

Arguments:

  • type string - required field
  • label string - required field
  • symbol string - required field

Returns:

  • Datastream