summaryrefslogtreecommitdiffstats
path: root/cps-events/src/main/resources
diff options
context:
space:
mode:
authorBruno Sakoto <bruno.sakoto@bell.ca>2021-05-18 16:02:30 -0400
committerRenu Kumari <renu.kumari@bell.ca>2021-06-08 10:29:15 -0400
commitf549c7c144512d98f5cdb847d172193a0cad9358 (patch)
tree68dcad8d5129237ec52517cf3188ca963c5b7cf8 /cps-events/src/main/resources
parentc37678a3eb62685d32a1581729e2a4e26002bffc (diff)
Add json schema for events
Issue-ID: CPS-348 Issue-ID: CPS-373 Change-Id: Ia0d31f6393e90cb0d5370ca6a78dfbe8817545ae Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Diffstat (limited to 'cps-events/src/main/resources')
-rw-r--r--cps-events/src/main/resources/schemas/cps-data-updated-event-schema.json88
1 files changed, 88 insertions, 0 deletions
diff --git a/cps-events/src/main/resources/schemas/cps-data-updated-event-schema.json b/cps-events/src/main/resources/schemas/cps-data-updated-event-schema.json
new file mode 100644
index 0000000000..de445ec722
--- /dev/null
+++ b/cps-events/src/main/resources/schemas/cps-data-updated-event-schema.json
@@ -0,0 +1,88 @@
+{
+
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "$id": "urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT",
+
+ "$ref": "#/definitions/CpsDataUpdatedEvent",
+
+ "definitions": {
+
+ "CpsDataUpdatedEvent": {
+ "description": "The payload for CPS data updated event.",
+ "type": "object",
+ "properties": {
+ "schema": {
+ "description": "The schema, including its version, that this event adheres to.",
+ "type": "string",
+ "default": "urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT",
+ "enum": ["urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT"]
+ },
+ "id": {
+ "description": "The unique id identifying the event for the specified source. Producer must ensure that source + id is unique for each distinct event.",
+ "type": "string"
+ },
+ "source": {
+ "description": "The source of the event. Producer must ensure that source + id is unique for each distinct event.",
+ "type": "string",
+ "format": "uri"
+ },
+ "type": {
+ "description": "The type of the event.",
+ "type": "string"
+ },
+ "content": {
+ "$ref": "#/definitions/Content"
+ }
+ },
+ "required": [
+ "schema",
+ "id",
+ "source",
+ "type",
+ "content"
+ ],
+ "additionalProperties": false
+ },
+
+ "Content": {
+ "description": "The event content.",
+ "type": "object",
+ "properties": {
+ "observedTimestamp": {
+ "description": "The timestamp when the data has been observed. The expected format is 'yyyy-MM-dd'T'HH:mm:ss.SSSZ'. Ex: '2020-12-01T00:00:00.000+0000' ",
+ "type": "string"
+ },
+ "dataspaceName": {
+ "description": "The name of CPS Core dataspace the data belongs to.",
+ "type": "string"
+ },
+ "schemaSetName": {
+ "description": "The name of CPS Core schema set the data adheres to.",
+ "type": "string"
+ },
+ "anchorName": {
+ "description": "The name of CPS Core anchor the data is attached to.",
+ "type": "string"
+ },
+ "data": {
+ "$ref": "#/definitions/Data"
+ }
+ },
+ "required": [
+ "timestamp",
+ "dataspaceName",
+ "schemaSetName",
+ "anchorName",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+
+ "Data": {
+ "description": "Data as json object.",
+ "type": "object"
+ }
+
+ }
+
+} \ No newline at end of file