How do I specify the Fiware-Service and Fiware-ServicePath fields in Orion that give the MySQL database and table name in Cygnus?
So far, I've configured a ContextBroker to send data to Cygnus, which in turn stores the default data in the database.
But what if I want to target a specific database using a specific table?
I know I need to install:
dbName=<fiware-service>
tableName=<fiware-servicePath>_<entityId>_<entityType>
I don't know where this file is located, and I know that it is not in / etc / sysconfig / contextBroker because this folder does not exist.
EDIT1: here is my update context:
(curl localhost:1026/NGSI10/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: FiwareDatabase' --header 'Fiware-ServicePath: /AllSensors' -d @- ) <<EOF
{
"contextElements": [
{
"type": "Television",
"isPattern": "false",
"id": "TV2",
"attributes": [
{
"name": "channel",
"type": "integer",
"value": "14"
},
{
"name": "volume",
"type": "float",
"value": "9"
}
]
}
],
"updateAction": "APPEND"
}
EOF
As I said, the table is automatically created, but the database is not working.
source to share
Fiware-Service and Fiware-ServicePath are set during entity creation using HTTP headers in the REST request to create the entity. Refer to the following sections in the Orion User Guide:
UPDATE : for example, to create an object in the service "servA" and the service path "/ path1", you can use the example shown in the entity creation section of the manual by adding two additional HTTP headers to the curl line:
(curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: servA' --header 'Fiware-ServicePath: /path1' -d @- | python -mjson.tool) <<EOF
...
This will insert information into the following MySQL database / table (assuming Cygnus is configured correctly, subscriptions are correct, etc.):
dbName=servA
tableName=path1_<entityId>_<entityType>
Note that the default behavior is to store information for each object in a different table. This default behavior can be changed, but if you are interested in this possibility, create a new question on StackOverflow to do this.
source to share