summaryrefslogtreecommitdiffstats
path: root/cps-events/src/main/resources/schemas/cps-data-updated-event-schema.json
blob: 3c95664d7a1bc16b49db0d9c4e04bc55ff969efb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{

  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "urn:cps:org.onap.cps:data-updated-event-schema:v2",

  "$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. E.g. 'urn:cps:org.onap.cps:data-updated-event-schema:v99'.",
          "type": "string",
          "format": "uri"
        },
        "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": true
    },

    "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"
        },
        "operation": {
          "description": "The operation on the data",
          "type": "string",
          "enum": ["CREATE", "UPDATE", "DELETE"]
        },
        "data": {
          "$ref": "#/definitions/Data"
        }
      },
      "required": [
        "observedTimestamp",
        "dataspaceName",
        "schemaSetName",
        "anchorName"
      ],
      "additionalProperties": true
    },

    "Data": {
      "description": "Data as json object.",
      "type": "object"
    }

  }

}