Skip to content

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.

License

Notifications You must be signed in to change notification settings

cenidetiot/ocb-sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCB - sender

https://nodei.co/npm/ocb-sender.png?downloads=true&downloadRank=true&stars=true

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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •