Support operation field for CPS Temporal Query Output API
[cps/cps-temporal.git] / docs / content / modeling.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 ..
5 .. Copyright (C) 2021-2022 Bell Canada
6
7 =====================
8 CPS Temporal Modeling
9 =====================
10
11 Event Structure
12 ===============
13
14 Data manipulated by both CPS Core and CPS Temporal to represent a Data Updated
15 Event is a JSON structure that is defined by following Json Schema:
16
17 * :download:`cps-data-updated-event-schema.json <../_static/event-schema/cps-data-updated-event-schema.json>`
18
19 And following is an example of an event compliant with this schema:
20
21 .. code:: json
22
23     {
24         "schema": "urn:cps:org.onap.cps:data-updated-event-schema:v2",
25         "id": "38aa6cc6-264d-4ede-b534-18f5c1f403ea",
26         "source": "urn:cps:org.onap.cps",
27         "type": "org.onap.cps.data-updated-event",
28         "content": {
29             "observedTimestamp": "2021-06-09T13:00:00.123-0400",
30             "operation": "UPDATE",
31             "dataspaceName": "my-dataspace",
32             "schemaSetName": "my-schema-set",
33             "anchorName": "my-anchor",
34             "data": {
35                 "interface": {
36                     "name": "itf-1",
37                     "status": "up"
38                 }
39             }
40         }
41     }
42
43 Event versions
44 ==============
45
46 The following table lists the data-updated-event schema evolution over releases :
47
48   +-----------+------------+-------------------------+---------------------+
49   | Version   | Release    | Compatibility Type      | Upgrade First       |
50   |           |            | (with previous version) |                     |
51   +===========+============+=========================+=====================+
52   | v1        | Istanbul   | n/a                     | Any order           |
53   +-----------+------------+-------------------------+---------------------+
54   | v2        | Jakarta    | Backward                | Consumer (Temporal) |
55   +-----------+------------+-------------------------+---------------------+
56
57 **Compatibility Types**
58
59 Several compatibility types exist when an event schema definition is evolving from one release to the next one:
60
61 - Backward compatibility means that consumers using the new schema can read data produced with the previous schema.
62 - Forward compatibility means that data produced with a new schema can be read by consumers using the previous schema.
63 - Full compatibility means that schemas are both backward and forward compatible: old data can be read with the new schema, and new data can also be read with the previous schema.