An open API service indexing awesome lists of open source software.

https://github.com/petereb/om2m-rest

oneM2M REST api.
https://github.com/petereb/om2m-rest

om2m onem2m rest

Last synced: 11 months ago
JSON representation

oneM2M REST api.

Awesome Lists containing this project

README

          

# om2m-rest
oneM2M REST api.

[![NPM](https://nodei.co/npm/om2m-rest.png?downloads=true)](https://nodei.co/npm/om2m-rest/)

[![npm](https://img.shields.io/npm/v/om2m-rest.svg?maxAge=2592000)](https://www.npmjs.com/package/om2m-rest)
[![npm](https://img.shields.io/npm/l/om2m-rest.svg?maxAge=2592000)](https://www.npmjs.com/package/om2m-rest)


## Documentation

Please visit the [Wiki](https://github.com/PeterEB/om2m-rest/wiki).


## Overview

oneM2M REST api.


## Installation

> $ npm install om2m-rest --save


## Usage

```js
var Om2m = require('om2m-rest');

// initialize om2m configuration
var om2m = new Om2m('192.168.1.112', 8282, 'mn-ces', 'my-mn', 'admin', 'admin');

// create your application
om2m.createApp('MY_SENSOR', 'my_sensor', 'Type/sensor', false, function (err, msg) {
console.log(msg);
});

// create your container
om2m.createCont('MY_SENSOR', 'DATA', 10, function (err, msg) {
console.log(msg);
});

// create your content instance
om2m.createDataInst('MY_SENSOR', 'DATA', temperature, { sensorValue: 25.6 }, function (err, msg) {
console.log(msg);
});
```


## License

Licensed under [MIT](https://github.com/PeterEB/om2m-rest/blob/master/LICENSE).