Giter VIP home page Giter VIP logo

ocb-sender's Introduction

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

ocb-sender's People

Contributors

cenidetiot avatar danieltorr avatar haidee09 avatar toodaniels avatar

Watchers

 avatar  avatar  avatar

ocb-sender's Issues

Does not return the value of the attribute in the function getEntityAttributeValue

Hello...!
Implement the function of the ocb-sender module (getEntityAttributeValue) and execute the following code:
cb.getEntityAttributeValue("Device_Smartphone_40bbcd9c6cae67c0", "batteryLevel")
.then((result) => console.log(result))
.catch((err) => console.log(err))

The response result is as follows:
{ statusCode: 200,
message: 'Se estableció conexión con el ContextBroker' }
{ value: Promise { }, attribute: 'batteryLevel' }

They could help me ... because the value does not return the result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.