Device Builder

DeviceBuilder

DeviceBuilder Objects

class DeviceBuilder()

Device builder. This builder give you the necessary tools to create a device using our OpenGate REST.

constructor
function constructor()

Constructor

Arguments:

  • ogapi InternalOpenGateAPI - this is ogapi instance
  • organization string - this is the organization name where device will be created
  • allowedDatastreams array (optional) - Allowed datastreams to add into the new device
  • definedSchemas array (optional) - Jsonschema about all OpenGate specific types
  • jsonSchemaValidator Validator (optional) - Json schema validator tool
  • ms number - timeout in milliseconds

create
function create() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function create a entity of provision

Returns:

  • Promise

Example:

 ogapi.organizationsBuilder().create()

update
function update() -> 'Promise'

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a entity of provision and check if any subscriber/subscription exits or no. If a subscriber/subscription not exists then this entities will be created and after that will be added to entity box.

Returns:

  • Promise

Example:

 ogapi.entityBuilder.devicesBuilder().update()