Bruno Sakoto | ff7d57a | 2021-09-07 18:21:59 -0400 | [diff] [blame] | 1 | .. This work is licensed under a |
| 2 | .. Creative Commons Attribution 4.0 International License. |
| 3 | .. http://creativecommons.org/licenses/by/4.0 |
| 4 | .. |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 5 | .. Copyright (C) 2021-2022 Bell Canada |
Bruno Sakoto | ff7d57a | 2021-09-07 18:21:59 -0400 | [diff] [blame] | 6 | |
| 7 | ===================== |
| 8 | CPS Temporal Modeling |
| 9 | ===================== |
| 10 | |
Bruno Sakoto | a43a13b | 2021-10-07 09:11:48 -0400 | [diff] [blame] | 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 | |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 17 | * :download:`cps-data-updated-event-schema.json <../_static/event-schema/cps-data-updated-event-schema.json>` |
Bruno Sakoto | a43a13b | 2021-10-07 09:11:48 -0400 | [diff] [blame] | 18 | |
| 19 | And following is an example of an event compliant with this schema: |
| 20 | |
| 21 | .. code:: json |
| 22 | |
| 23 | { |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 24 | "schema": "urn:cps:org.onap.cps:data-updated-event-schema:v2", |
Bruno Sakoto | a43a13b | 2021-10-07 09:11:48 -0400 | [diff] [blame] | 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", |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 30 | "operation": "UPDATE", |
Bruno Sakoto | a43a13b | 2021-10-07 09:11:48 -0400 | [diff] [blame] | 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 | |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 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. |