The ngsi
node type implements an interface to FIWARE context brokers. Currently version 1 of the RESTful HTTP API is implemented and using NGSI10 for the context management interface.
This implementation if currently limited to the updateContext
operation. Therefore only publishing updates is supported. Subscribtion or polling of events is planned for later versions.
Prerequisites
This node-type requires to following libraries to communicate with the context broker over JSON:
Implementation
The source code of the node-type is available here: https://git.rwth-aachen.de/acs/public/villas/node/blob/master/lib/nodes/ngsi.cpp
Configuration
You can use the in.vectorize (integer) = 1 setting to send multiple samples in a vector.
Every ngsi
node supports the following special settings:
endpoint (string: uri)
entity_id (string)
entity_type (string)
ssl_verify (boolean)
timeout (float: seconds)
mapping (array of strings)
Example: AttributeName(AttributeType) MetadataName1(MetadataType1)=MetadataValue1 MetadataName2(MetadataType2)=MetadataValue2 ...
Example
nodes = {
ngsi_node = {
type = "ngsi",
### The following settings are specific to the ngsi node-type!! ###
# The HTTP REST API endpoint of the FIRWARE context broker
endpoint = "http://46.101.131.212:1026",
entity_id = "S3_ElectricalGrid",
entity_type = "ElectricalGridMonitoring",
rate = 0.1 # Rate at which we poll the broker for updates
timeout = 1, # Timeout of HTTP request in seconds (default is 1, must be smaller than 1 / rate)
verify_ssl = false, # Verification of SSL server certificates (default is true)
in = {
signals = (
{
name = "attr1",
ngsi_attribute_name = "attr1", # defaults to signal 'name'
ngsi_attribute_type = "Volts", # default to signal 'unit'
ngsi_attribute_metadatas = (
{ name="accuracy", type="percent", value="5" }
)
}
)
}
out = {
signals = (
{ name="PTotalLosses", unit="MW" },
{ name="QTotalLosses", unit="Mvar" }
)
}
}
}
Further reading
This standard was specified by the Open Mobile Alliance (OMA).
- See also
- https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_NGSI-10_Open_RESTful_API_Specification
-
http://technical.openmobilealliance.org/Technical/Release_Program/docs/NGSI/V1_0-20120529-A/OMA-TS-NGSI_Context_Management-V1_0-20120529-A.pdf