FIWARE « ORION » Context Broker API


Online courses to understand FIWARE Context Broker
FIWARE Context Broker Github repository
FIWARE Context Broker - User & Programmer Guide full version


FIWARE NGSI API
For FIWARE Context Broker we have implemented the standardized interface using OMA NGSI standards for Context Management:

NGSI 9:

NGSI 9 provides operations to answer the following questions: How to create an entity which will provide contextual information, how to discover this entity and how to subscribe to the flow of information of this entity.
In the TM Forum hackfest, FIWARE is providing real-time sensors data, each sensor being a dedicated entity
API examples

The response corresponding to that request contains a subscription ID (a 24 hexadecimal number used for updating and cancelling the subscription - write it down because you will need it later in this tutorial) and a duration acknowledgement:

{
"subscribeResponse": {
"duration": "P1M",
"subscriptionId": "51c04a21d714fb3b37d7d5a7"
}
}

If you look at the accumulator-script.py terminal window, you will see that a message resembling the following one is received each 10 seconds:

POST http://localhost:1028/accumulate
Content-Length: 492
User-Agent: orion/0.9.0
Host: localhost:1028
Accept: application/xml, application/json
Content-Type: application/json

{
"subscriptionId" : "51c04a21d714fb3b37d7d5a7",
"originator" : "localhost",
"contextResponses" : [
{
"contextElement" : {
"attributes" : [
{
"name" : "temperature",
"type" : "float",
"value" : "26.5"
}
],
"type" : "Room",
"isPattern" : "false",
"id" : "Room1"
},
"statusCode" : {
"code" : "200",
"reasonPhrase" : "OK"
}
}
]
}