Leverege Platform

Leverege Platform

  • Overview
  • JSDocs
  • REST API
  • Help

›API

Platform Overview

  • Overview
  • Architecture
  • Core Concepts

Guides

  • Platform Setup
  • Building a Project
  • API UI

Services

  • API Server
  • Message Processor
  • Transponder
  • Reason
  • Scheduler
  • Messenger
  • Emailer
  • Rest Server
  • DB Curator

API

  • API
  • Interface
  • Project
  • System
  • Device
  • Blueprint
  • Collection
  • Child
  • History
  • Scenario
  • Script
  • Template
  • Timer
  • User
  • Users

Server Libraries

  • Log
  • Messages
  • Message Queue
  • Cache
  • Lock
  • Limit
  • Cluster Manager
  • Error
  • Exit

Utilities

  • Promise
  • Data Store
  • Factory
  • Path
  • Reasoner
  • Object Util
  • Array Util
  • String Util
  • Base62 Util
  • Value Cache
  • Validator
  • Lol

UI

  • API Redux
  • UI Builder
  • UI Elements
  • UI Redux
  • UI Mapbox Elements
  • UI Active Theme
  • UI Color Elements
  • UI Linear View Elements

Device

Through the api, a devices can be created, deleted and changed.

Query Device

let device
try {
  device = await api.device( deviceId ).get()
} catch ( ex ) {
  // error handling
}

The device variable in the script will then have all of the device information. That information will include Metadata, ids, data and all other information associated with the device.

Other methods are:

  1. update( newDeviceInfo ) - patches the device with the newDeviceInfo
  2. delete() - deletes the device
  3. history( options ) - options should include a query to make against the device history
  4. events() - has a list method, create and ack method
  5. getHistorical( options ) - makes a get request to the historical path of the device
  6. setValue( path, value, options ) - sets value on the device at path
  7. startSim( options ) - starts a simulation on the device
  8. pauseSim( options ) - pauses a simulation on the device
  9. restSim( options ) - resets a simulation on the device
  10. playScenario( options ) - plays a scenario on the device
  11. stopScenario( options ) - stops a scenario on the device
  12. getUpdater( path ) - makes a call to get an updater
  13. getUpdaters( options ) - makes a call to get the updaters for a device
  14. verify( options )
  15. users() - object to interact with the system users

Creating a Device

To create a new device, the system method of api needs to be used.

const device = { ...newDeviceInfo }
try {
  api.system( systemId ).devices().create( device )
} catch ( ex ) {
  // error handling
}

after this call has been resolved, there will be a new device for the system.

← SystemBlueprint →
  • Query Device
  • Creating a Device
Leverege Platform
Docs
Overview
Connect
FacebookLinkedInTwitter
Facebook Open Source