ocb-sender
v2.4.4
Published
[![https://nodei.co/npm/ocb-sender.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/ocb-sender.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/ocb-sender)
Downloads
11
Readme
OCB - sender
What is ocb-sender?
ocb - sender is a npm module that handle a NGSI Object for them transportation to FIWARE Orion Context Broker. It makes possible send context information in easy way to the FIWARE Ecosystem.
Indéx navigation
How to install
npm install ocb-sender
Import npm module.
ES5
var cb = require('ocb-sender');
ES6
import OCB as cb from ocb-sender;
Module Usage
Headers
For the examples we will use the next JSON as headers
var headers = {
'Fiware-Correlator': '3451e5c2-226d-11e6-aaf0-d48564c29d20'
}
But you can use another options,one empty JSON or you can ignore the headers if you don't need them
Connection configuration with Orion ContextBroker.
cb.config(urlContextBroker, headers)
.then((result) => console.log(result))
.catch((err) => console.log(err))
Example
cb.config('http://207.249.127.149:1026/v2/', headers)
.then((result) => console.log(result))
.catch((err) => console.log(err))
Retrieve Orion ContextBroker API Rescources.
Example
cb.retrieveAPIResources(headers)
.then((result) => console.log(result))
.catch((err) console.log(err))
Get EntityType of ContextBroker.
Example
cb.getEntityType("Device", headers)
.then((result) => console.log(result))
.catch((err) => console.log(err))
Get EntityTypes of ContextBroker.
Example
cb.getEntityTypes(headers)
.then((result) => console.log(result))
.catch((err) => console.log(err))
License
MIT