-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add entities and context for alerts received when a threshold i…
…s breached (#15) * first samples of alert related entities + context * reformatted files * basic fixes * upgrade core context to v1.8
- Loading branch information
Showing
4 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"id": "urn:ngsi-ld:Alert:7a08a58e-e613-4cc0-9160-8a2636970721", | ||
"type": "Alert", | ||
"hasSubject": { | ||
"type": "Relationship", | ||
"object": "urn:ngsi-ld:Event:7a08a58e-e613-4cc0-9160-8a2636970721" | ||
}, | ||
"mailingList": { | ||
"type": "Property", | ||
"value": { | ||
"email": [ | ||
"[email protected]" | ||
] | ||
} | ||
}, | ||
"message": { | ||
"type": "JsonProperty", | ||
"json": { | ||
"body": "[body of the mail]", | ||
"subject": "[ALERT] Electricity consumption exceeded set value" | ||
} | ||
}, | ||
"occurrence": { | ||
"type": "Property", | ||
"value": true, | ||
"observedAt": "2024-04-18T16:40:00Z" | ||
}, | ||
"triggeredBy": { | ||
"type": "Property", | ||
"value": "urn:ngsi-ld:Subscription:7a08a58e-e613-4cc0-9160-8a2636970721" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"id": "urn:ngsi-ld:Event:7a08a58e-e613-4cc0-9160-8a2636970721", | ||
"type": [ | ||
"Event", | ||
"AggregatedThresholdBreach" | ||
], | ||
"hasSubject": { | ||
"type": "Relationship", | ||
"watchedProperties": { | ||
"type": "Property", | ||
"value": "consumption" | ||
}, | ||
"object": "urn:ngsi-ld:FluidMonitoring:Electricity:7a08a58e-e613-4cc0-9160-8a2636970721" | ||
}, | ||
"occurrence": { | ||
"type": "Property", | ||
"value": "510", | ||
"observedAt": "2024-04-18T16:39:00Z" | ||
}, | ||
"status": { | ||
"type": "Property", | ||
"value": "true", | ||
"observedAt": "2024-04-18T16:39:00Z" | ||
}, | ||
"thresholdType": { | ||
"type": "Property", | ||
"value": "Upper" | ||
}, | ||
"thresholdValue": { | ||
"type": "Property", | ||
"value": "500" | ||
}, | ||
"thresholdAggrPeriod": { | ||
"type": "Property", | ||
"value": "P7D" | ||
}, | ||
"hasAlert": { | ||
"type": "Relationship", | ||
"object": "urn:ngsi-ld:Alert:7a08a58e-e613-4cc0-9160-8a2636970721" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"id": "urn:ngsi-ld:Subscription:7a08a58e-e613-4cc0-9160-8a2636970721", | ||
"type": "Subscription", | ||
"entities": [ | ||
{ | ||
"id": "urn:ngsi-ld:Event:7a08a58e-e613-4cc0-9160-8a2636970721", | ||
"type": "AggregatedThresholdBreach" | ||
} | ||
], | ||
"watchedAttributes": [ | ||
"occurrence" | ||
], | ||
"notification": { | ||
"format": "normalized", | ||
"endpoint": { | ||
"uri": "http://localhost:8080", | ||
"accept": "application/json" | ||
} | ||
} | ||
} |