Compare commits

..

13 Commits

Author SHA1 Message Date
969b5867d9 docker now only pushing when in master branche 2019-02-05 17:39:07 +01:00
c3ac4f9dfb fixing type of timestamp 2019-02-05 16:23:17 +01:00
7781b15c4e Adding Contributions to readme 2019-02-05 15:51:35 +01:00
b9034a916f Coverage badge 2019-02-05 12:30:43 +01:00
5257a11cf0 Adding vulnerabilities (snyk) badge to README 2019-01-25 17:51:30 +01:00
461698b32a Better Workaround for Snyk to find requirements.txt 2019-01-25 17:48:05 +01:00
734a51fb73 Workaround for Snyk to find requirements.txt 2019-01-25 17:43:58 +01:00
8836af62a6 Merge remote-tracking branch 'origin/master' 2019-01-11 17:58:38 +01:00
9b73c6d337 Added docker pulls badge 2019-01-09 16:09:47 +01:00
c737effe0e New Chapter for the configuration of gateway&backend 2019-01-09 16:06:33 +01:00
58560b7573 Added Travis badge to readme 2019-01-09 15:49:58 +01:00
fbd7d987e8 Merge pull request #14 from jason-fox/feature/readme+docs
Update README and add mkdocs.yml
2018-12-19 15:24:41 +01:00
3fc8bdb14e Update to standard-readme format
* Moved badges to top - two rows
* Formatted Markdown file
* Added lede at the top of file so a description paragraph will display on mobile
* Standardized some Section names (e.g. Install)
* Added standard QA section - TSC **must** requirement
* Expanded License to include copyrights
* Updated catalogue links to new GitHub location

[standard-readme](https://github.com/RichardLitt/standard-readme) is a simple standard naming convention for README files which makes reading and navigation of the documentation easier - this is a TSC **should** requirement

Created Readthedocs index file.
2018-10-30 16:18:37 +01:00
6 changed files with 204 additions and 62 deletions

View File

@ -1,36 +1,55 @@
services:
- docker
- docker
dist: xenial
before_script:
- sudo apt update
- sudo apt install qemu-user-static
- "./create-binary-docker backend"
- "./create-binary-docker backend -a arm"
- "./create-binary-docker gateway"
- "./create-binary-docker gateway -a arm"
- "./create-binary-docker orioncontextbroker"
- "./create-binary-docker orioncontextbroker -a arm"
- "./create-binary-docker influxdbapp"
- "./create-binary-docker influxdbapp -a arm"
- "./create-binary-docker cul868ipe"
- "./create-binary-docker cul868ipe -a arm"
- sudo apt update
- sudo apt install qemu-user-static python3 python3-pip python3-setuptools
- sudo pip3 install --upgrade pip
- sudo python3 -m pip install --upgrade setuptools
- sudo python3 -m pip install --upgrade pyresttest
- "./create-binary-docker backend"
- "./create-binary-docker backend -a arm"
- "./create-binary-docker gateway"
- "./create-binary-docker gateway -a arm"
- "./create-binary-docker orioncontextbroker"
- "./create-binary-docker orioncontextbroker -a arm"
- "./create-binary-docker influxdbapp"
- "./create-binary-docker influxdbapp -a arm"
- "./create-binary-docker cul868ipe"
- "./create-binary-docker cul868ipe -a arm"
- docker run -d --name backend -p 0.0.0.0:18000:18000 -e "ONEM2M_CSE_ID=backend" -e "ONEM2M_NOTIFICATION_DISABLED=false" openmtc/backend-amd64 -v
- docker logs backend
- docker run -d --name gateway -p 0.0.0.0:8000:8000 -e "ONEM2M_HTTP_TRANSPORT_PORT=8000" -e "ONEM2M_CSE_ID=gateway" -e "ONEM2M_REMOTE_CSE_POA=<POA>" -e "ONEM2M_REMOTE_CSE_ID=backend" -e "ONEM2M_NOTIFICATION_DISABLED=false" -e "ONEM2M_REGISTRATION_DISABLED=false" openmtc/gateway-amd64 -v
- docker logs gateway
script:
- docker tag openmtc/orioncontextbroker-amd64 openmtc/orion-context-broker-app-amd64
- docker tag openmtc/orioncontextbroker-arm openmtc/orion-context-broker-app-arm
- docker tag openmtc/cul868ipe-amd64 openmtc/cul868-ipe-amd64
- docker tag openmtc/cul868ipe-arm openmtc/cul868-ipe-arm
- docker tag openmtc/influxdbapp-amd64 openmtc/influxdb-app-amd64
- docker tag openmtc/influxdbapp-arm openmtc/influxdb-app-arm
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker push openmtc/backend-amd64
- docker push openmtc/backend-arm
- docker push openmtc/gateway-amd64
- docker push openmtc/gateway-arm
- docker push openmtc/orion-context-broker-app-amd64
- docker push openmtc/orion-context-broker-app-arm
- docker push openmtc/cul868-ipe-amd64
- docker push openmtc/cul868-ipe-arm
- docker push openmtc/influxdb-app-amd64
- docker push openmtc/influxdb-app-arm
- docker tag openmtc/orioncontextbroker-amd64 openmtc/orion-context-broker-app-amd64
- docker tag openmtc/orioncontextbroker-arm openmtc/orion-context-broker-app-arm
- docker tag openmtc/cul868ipe-amd64 openmtc/cul868-ipe-amd64
- docker tag openmtc/cul868ipe-arm openmtc/cul868-ipe-arm
- docker tag openmtc/influxdbapp-amd64 openmtc/influxdb-app-amd64
- docker tag openmtc/influxdbapp-arm openmtc/influxdb-app-arm
- docker logs gateway
- docker logs backend
after_script:
- pyresttest http://localhost:8000 tests/interoperability/basic.yaml
env:
matrix:
secure: oQe/MxxFrPPArxb6OFzOUwG2ZlA5GYekMR6qn0Y3101v82MdrIVgDILHR41iwykTtk1XpJPV9uabsRsvY4hBmbjYzihYZFOAzFf+/KU7wROtKum0fFfLjCPb8uGV41k1JTquB94FibXboVAP7rNL0Vrpl+FGUvMGatQBtwZnGvha6Ha07qTao+X9+0dJ4YvFlvcba/jfzBZBwHw7KHpRoiyKU0dPmXpHcqnZBFcNqRXhzdVrgx0auP/tghoshW5LQWkpTV11uSx/kYuby4oo8r8nB6L0rW1jYSXs9DHiTQCfCy24xlb9YJjCD9aFcjH0lIkVIqQwJYA67MzKYMK4XV684J/Jr3+jfVOoUt0bpZaTnk+r/uiFCtEsN7q0KUlvHLUAi1YNJhKs6CRrAH3GK25QByh+suzPzZoHP42F2LYP9URlzbDH+/v7CwNuw+9pHSmxEhs18LVmggwkMos3o3ArvzMLRNJ3QG1fdoxL/Ubqxhmvhy4rZi6vGQsiF64oX8PN0sRgXekTU/ma+6CTM6qhgkocMUYzT2r/6qd/9R3jmtxSZnikjkR6Iu9NLzAUY+cqnvvjohAvqYyj+tGlQfOPxAU9H4wXnbQWLBM8yn6yt2Ki+3+Jx4Owdv0oXVJpN0GWjMzIJ1nEus5odkWW+c4wcZb6m3Ak0PrzYPp2BgE=
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker push openmtc/backend-amd64;
docker push openmtc/backend-arm;
docker push openmtc/gateway-amd64;
docker push openmtc/gateway-arm;
docker push openmtc/orion-context-broker-app-amd64;
docker push openmtc/orion-context-broker-app-arm;
docker push openmtc/cul868-ipe-amd64;
docker push openmtc/cul868-ipe-arm;
docker push openmtc/influxdb-app-amd64;
docker push openmtc/influxdb-app-arm;
fi
after_failure:
- docker logs backend
- docker logs gateway
- coveralls

121
README.md
View File

@ -4,43 +4,102 @@
</a>
</p>
The OpenMTC SDK aims to provide developers with a convenient yet flexible tool to write oneM2M compliant applications. This includes network applications (NAs), gateway application (GAs), device applications (DAs), as well as interworking proxy entities (IPEs).
[![FIWARE IoT Agents](https://nexus.lab.fiware.org/static/badges/chapters/iot-agents.svg)](https://www.fiware.org/developers/catalogue/)
[![License: Eclipse](https://img.shields.io/github/license/OpenMTC/OpenMTC.svg)](https://www.eclipse.org/legal/epl-v10.html)
[![Support badge](https://nexus.lab.fiware.org/repository/raw/public/badges/stackoverflow/iot-agents.svg)](https://stackoverflow.com/questions/tagged/fiware+iot)
<br/>
[![Documentation badge](https://img.shields.io/readthedocs/fiware-openmtc.svg)](http://fiware-openmtc.readthedocs.org/en/latest/?badge=latest)
![Status](https://nexus.lab.fiware.org/static/badges/statuses/iot-openmtc.svg)
[![](https://img.shields.io/docker/pulls/openmtc/gateway-amd64.svg)](https://hub.docker.com/u/openmtc)
[![Build Status](https://travis-ci.org/OpenMTC/OpenMTC.svg?branch=master)](https://travis-ci.org/OpenMTC/OpenMTC)
[![Known Vulnerabilities](https://snyk.io/test/github/OpenMTC/OpenMTC/badge.svg?targetFile=openmtc-gevent%2Frequirements.txt)](https://snyk.io/test/github/OpenMTC/OpenMTC?targetFile=openmtc-gevent%2Frequirements.txt)
[![Coverage Status](https://coveralls.io/repos/github/OpenMTC/OpenMTC/badge.svg?branch=master)](https://coveralls.io/github/OpenMTC/OpenMTC?branch=master)
# Table of Content
The OpenMTC SDK aims to provide developers with a convenient yet flexible tool
to write oneM2M compliant applications. This includes network applications
(NAs), gateway application (GAs), device applications (DAs), as well as
interworking proxy entities (IPEs).
- [Quick Start](doc/openmtc-get-started.md)
- [Introduction](doc/introduction.md)
- [Deployment](doc/deployment-guide.md)
- [The MQTT Client](doc/onem2m-client-mqtt.md)
- [Authentication Guide](doc/authentication.md)
- [Installation of the OpenMTC SDK](doc/install-sdk.md)
- [Overview REST API](doc/overview-rest-api.md)
- [Write your first OpenMTC applications](doc/training/training-index.md)
- [SDK - Using the Application Framework](doc/sdk-framework.md)
- [SDK - The low-level CSE Client](doc/sdk-client.md)
- [SDK - The Data Model](doc/sdk-datamodel.md)
- Examples
- [IoT Data Visualization](doc/example-apps/IoT-data-visualization.py)
- [Data Aggregation](doc/example-apps/data-aggregation.py)
- [Simple Decision](doc/example-apps/simple-decision.py)
- [Simple Decision 2](doc/example-apps/simple-decision-2.py)
- Scripts
- [Create App Structure Script](doc/create-app-structure.md)
- [Create binary docker images Script](doc/create-binary-docker.md)
- [Code Repository Structure](doc/repository-structure.md)
- [Developer FAQ](doc/developer-faq.md)
This project is part of [FIWARE](https://www.fiware.org/). For more information
check the FIWARE Catalogue entry for the
[IoT Agents](https://github.com/Fiware/catalogue/tree/master/iot-agents).
# Content
- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Quality Assurance](#quality-assurance)
- [Contributing](#contributing)
- [License](#license)
# Python
## Install
The OpenMTC SDK is written in and for the Python programming language. Users should therefore have at least a certain knowledge of Python and its paradigms. For this matter, the following material is recommended:
Information about how to install the JSON IoTAgent can be found at the
corresponding section of the
[Installation & Administration Guide](https://fiware-openmtc.readthedocs.io/en/latest/deployment-guide).
- [The Python Homepage](http://www.python.org)
- [Expert Python Programming by Tarek Ziadé](http://www.e-reading.by/bookreader.php/138816/Ziade_-_Expert_Python_programming.pdf)
- [Code Like a Pythonista: Idiomatic Python](http://www.omahapython.org/IdiomaticPython.html)
## Usage
# Feedback
Information about how to use the IoT Agent can be found in the
[User & Programmers Manual](https://fiware-openmtc.readthedocs.io/en/latest/introduction).
Please create issues for any problems and direct any comments or feedback you are having to <a href="mailto:support@openmtc.org">support@openmtc.org</a>
## API
Information about the REST API can be found in the
[API Section](https://fiware-openmtc.readthedocs.io/en/latest/overview-rest-api)
## Python
The OpenMTC SDK is written in and for the Python programming language. Users
should therefore have at least a certain knowledge of Python and its paradigms.
For this matter, the following material is recommended:
- [The Python Homepage](http://www.python.org)
- [Expert Python Programming by Tarek Ziadé](http://www.e-reading.by/bookreader.php/138816/Ziade_-_Expert_Python_programming.pdf)
- [Code Like a Pythonista: Idiomatic Python](http://www.omahapython.org/IdiomaticPython.html)
## Feedback
Please create issues for any problems and direct any comments or feedback you
are having to <a href="mailto:support@openmtc.org">support@openmtc.org</a>
Please let us know what you think. We are also very interested in any use case
you are _not_ able to implement with the SDK or if you find it difficult to do
so.
## Quality Assurance
This project is part of [FIWARE](https://fiware.org/) and has been rated as
follows:
- **Version Tested:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Version&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.version&colorB=blue)
- **Documentation:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Completeness&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.docCompleteness&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Usability&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.docSoundness&colorB=blue)
- **Responsiveness:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Respond&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.timeToCharge&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Fix&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.timeToFix&colorB=blue)
- **FIWARE Testing:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Tests%20Passed&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.failureRate&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Scalability&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.scalability&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Performance&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.performance&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Stability&url=https://fiware.github.io/catalogue/json/open_mtc.json&query=$.stability&colorB=blue)
---
## Contributing
Contribution guidelines are detailed in the [CONTRIBUTIONS](https://github.com/OpenMTC/OpenMTC/blob/master/CONTRIBUTIONS.md) file.
## License
The OpenMTC SDK is licensed under the Eclipse Public License (EPL)
version 1.
© 2018 OpenMTC
Please let us know what you think. We are also very interested in any use case you are *not* able to implement with the SDK or if you find it difficult to do so.

View File

@ -3,6 +3,7 @@ try:
except ImportError:
from urlparse import urljoin
import logging
from datetime import datetime
import requests
@ -92,7 +93,8 @@ class OrionAPI(LoggerMixin):
"type": self._get_type(data_senml["v"]),
"metadata": {
"timestamp": {
"value": data_senml["t"],
"value": datetime.fromtimestamp(float(data_senml["t"])).replace(microsecond=0).isoformat()
if data_senml["t"] != "none" else data_senml["t"],
"type": "String"
},
"bn": {

9
doc/index.md Normal file
View File

@ -0,0 +1,9 @@
# Open MTC IoT Agent
[![FIWARE IoT Agents](https://nexus.lab.fiware.org/repository/raw/public/badges/chapters/iot-agents.svg)](https://www.fiware.org/developers/catalogue/)
[![](https://nexus.lab.fiware.org/repository/raw/public/badges/stackoverflow/iot-agents.svg)](https://stackoverflow.com/questions/tagged/fiware+iot)
The OpenMTC SDK aims to provide developers with a convenient yet flexible tool
to write oneM2M compliant applications. This includes network applications
(NAs), gateway application (GAs), device applications (DAs), as well as
interworking proxy entities (IPEs).

52
mkdocs.yml Normal file
View File

@ -0,0 +1,52 @@
site_name: Open MTC
site_url: https://github.com/OpenMTC/OpenMTC
repo_url: https://github.com/OpenMTC/OpenMTC.git
site_description: FIWARE Open MTC IoT Agent document site
docs_dir: doc/
site_dir: html
markdown_extensions: [toc,tables, fenced_code]
use_directory_urls: false
theme: readthedocs
extra_css: ["https://fiware.org/style/fiware_readthedocs.css", "https://fiware.org/style/fiware_readthedocs_iot.css"]
pages:
- Home: index.md
- 'User & Programmers Manual':
- Introduction: introduction.md
- Quick Start: openmtc-get-started.md
- The MQTT Client: onem2m-client-mqtt.md
- Authentication Guide: authentication.md
- Overview REST API: overview-rest-api.md
- Write your first OpenMTC applications: training/training-index.md
- Console Outputs:
- Sensor Backend: training/console-outputs/training-sensor-backend.md
- Sensor Gateway: training/console-outputs/training-sensor-gateway.md
- Sensor IPE: training/console-outputs/training-sensor-ipe.md
- Sensor GUI: training/console-outputs/training-sensor-gui.md
- Sensor Actuator Backend: training/console-outputs/training-sensor-actuator-backend.md
- Sensor Actuator Gateway: training/console-outputs/training-sensor-actuator-gateway.md
- Sensor Actuator IPE: training/console-outputs/training-sensor-actuator-ipe.md
- Sensor Actuator GUI: training/console-outputs/training-sensor-actuator-gui.md
- Training:
- IPE Sensors: training/training-ipe-sensors.md
- IPE Sensors Actuators: training/training-ipe-sensors-actuators.md
- GUI Sensors: training/training-gui-sensors.md
- GUI Sensors Actuators: training/training-gui-sensors-actuators.md
- SDK - Using the Application Framework: sdk-framework.md
- SDK - The low-level CSE Client: sdk-client.md
- SDK - The Data Model: sdk-datamodel.md
- Examples:
- IoT Data Visualization: example-apps/IoT-data-visualization.py
- Data Aggregation: example-apps/data-aggregation.py
- Simple Decision: example-apps/simple-decision.py
- Simple Decision 2: example-apps/simple-decision-2.py
- Scripts:
- Create App Structure Script: create-app-structure.md
- Create binary docker images Script: create-binary-docker.md
- Code Repository Structure: repository-structure.md
- Developer FAQ: developer-faq.md
- 'Installation & Administration Manual':
- Deployment: deployment-guide.md
- Installation of the OpenMTC SDK: install-sdk.md
- Appendix : various.md
- Resource Names & Types : reference-doc/resource-names-and-types.md
- Gateway & Backend Configuration : reference-doc/gateway-and-backend-configuration.md

View File

@ -0,0 +1 @@
dependencies.txt