Skip to content

Latest commit

 

History

History
174 lines (119 loc) · 7.1 KB

README.md

File metadata and controls

174 lines (119 loc) · 7.1 KB

#Orion Context Broker

License badge Documentation badge Docker badge Support badge

Introduction

This is the code repository for the Orion Context Broker, the reference implementation of the Publish/Subscribe Context Broker GE.

This project is part of FIWARE. Check also the FIWARE Catalogue entry for Orion

Any feedback on this documentation is highly welcome, including bugs, typos or things you think should be included but aren't. You can use github issues to provide feedback.

You can find the User & Programmer's Manual and the Installation & Administration Manual on readthedocs.io

For documentation previous to Orion 0.23.0 please check the manuals at FIWARE public wiki:

Top

GEi overall description

Orion is a C++ implementation of the NGSI9/10 REST API binding developed as a part of the FIWARE platform.

Orion Context Broker allows you to manage all the whole lifecycle of context information including updates, queries, registrations and subscriptions. It is an NGSI9/10 server implementation to manage context information and its availability. Using the Orion Context Broker, you are able to register context elements and manage them through updates and queries. In addition, you can subscribe to context information so when some condition occurs (e.g. the context elements have changed) you receive a notification. These usage scenarios and the Orion Context Broker features are described in this document.

If this is your first contact with the Orion Context Broker, it is highly recommended to have a look to the brief Quick Start guide.

Top

Build and Install

Build and Install documentation for Orion Context Broker can be found at the corresponding section of the Admin Manual.

Top

Running

How to run Orion Context Broker can be found at the corresponding section of the Admin Manual.

Top

API Overview

In order to create an entity (Room1) with two attributes (temperature and pressure):

curl <orion_host>:1026/v2/entities -s -S --header 'Content-Type: application/json' \
    -X POST -d @- <<EOF
{
  "id": "Room2",
  "type": "Room",
  "temperature": {
    "value": 23,
    "type": "Number"
  },
  "pressure": {
    "value": 720,
    "type": "Number"
  }
}
EOF

In order to query the entity:

curl <orion_host>:1026/v2/entities/Room2 -s -S --header 'Accept: application/json' | python -mjson.tool

In order to update one of the entity atributes (temperature):

curl <orion_host>:1026/v2/entities/Room2/attrs/temperature -s -S \
    --header 'Content-Type: application/json' \
    -X PUT -d @- <<EOF
{
  "value": 26.3,
  "type": "Number"
}
EOF

or (more compact):

curl <orion_host>:1026/v2/entities/Room2/attrs/temperature/value -s -S \
    --header 'Content-Type: text/plain' \
    -X PUT -d 26.3

Please have a look at the Quick Start guide if you want to test these operations in an actual public instance of Orion Context Broker. In addition, have a look to the API Walkthrough and API Reference sections below in order to know more details about the API (subscriptions, registrations, etc.).

Top

API Walkthrough

Top

API Reference Documentation

Top

Testing

Ent-to-end tests

The functional_test makefile target is used for running end-to-end tests:

make functional_test INSTALL_DIR=~

Please have a look to the section on building the source code in order to get more information about how to prepare the environment to run the functional_test target.

Unit Tests

The unit_test makefile target is used for running the unit tests:

make unit_test

Please have a look to the section on building the source code in order to get more information about how to prepare the environment to run the unit_test target.

Top

Advanced topics

Top

License

Orion Context Broker is licensed under Affero General Public License (GPL) version 3.

Top

Support

Ask your thorough programmming questions using stackoverflow and your general questions on FIWARE Q&A. In both cases please use the tag fiware-orion

Top