Needy Poetic Mothers

    ocb-sender

    2.4.4 • Public • Published

    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

    Install

    npm i ocb-sender

    DownloadsWeekly Downloads

    1

    Version

    2.4.4

    License

    MIT

    Unpacked Size

    58.4 kB

    Total Files

    9

    Last publish

    Collaborators

    • danieltoo
    • haidee09