NGSI Go tutorial for Perseo
ngsi server get --host perseo
serverType perseo
serverHost http://perseo:9090
ngsi version --host perseo --pretty
{
"error" : null ,
"data" : {
"name" : " perseo" ,
"description" : " IOT CEP front End" ,
"version" : " 1.12.1"
}
}
ngsi rules list --verbose --pretty
```json
[]
ngsi rules --host perseo create \
--data '{
"name": "blood_rule_update",
"text": "select *, *, ev.BloodPressure? as Pressure, ev.id? as Meter from pattern [every ev=iotEvent(cast(cast(BloodPressure?,String),float)>1.5 and type=\"BloodMeter\")]",
"action": {
"type": "update",
"parameters": {
"attributes": [
{
"name": "abnormal",
"value": "true",
"type": "boolean"
}
]
}
}
}'
ngsi rules get --name blood_rule_update --pretty
{
"error" : null ,
"data" : {
"_id" : " 6024c00a8e2bfc0012c77486" ,
"name" : " blood_rule_update" ,
"text" : " select \" blood_rule_update\" as ruleName, *, *, ev.BloodPressure? as Pressure, ev.id? as Meter from pattern [every ev=iotEvent(cast(cast(BloodPressure?,String),float)>1.5 and type=\" BloodMeter\" )]" ,
"action" : {
"type" : " update" ,
"parameters" : {
"attributes" : [
{
"name" : " abnormal" ,
"value" : " true" ,
"type" : " boolean"
}
]
}
},
"subservice" : " /" ,
"service" : " unknownt"
}
}
ngsi rules delete --name blood_rule_update