Fix the path used to add files into docker image
[aai/gizmo.git] / ASYNC.md
1 # ASYNCHRONOUS MODE
2
3 Gizmo has two modes, a Synchoronous (sync) mode and an Asynchronous (async) mode.
4
5 In the Async mode, Gizmo uses the consumer/producer model where when a
6 client makes a request, Gizmo will generate an event payload and
7 publish it  on the async event stream. It will then wait for a
8 response for that particular event on a different event stream. Once it recieves a
9 response, gizmo will send a response back to the client which made the
10 original request.
11
12 ## Here are a few examples of the events published by Gizmo
13
14 ### Vertex
15
16 #### Adding a Vertex
17
18     {
19         "timestamp": 1514927928167,
20         "operation": "CREATE",
21         "vertex": {
22             "properties": {
23                 "ipv4-oam-address": "1.2.3.4",
24                 "resource-version": "1477013499",
25                 "purpose": "my-purpose",
26                 "fqdn": "myhost.onap.net",
27                 "in-maint": false,
28                 "equip-model": "DL380p-nd",
29                 "equip-vendor": "HP",
30                 "equip-type": "server",
31                 "hostname": "myhost",
32                 "ptnii-equip-name": "e-name"
33             },
34             "key": "",
35             "type": "pserver",
36             "schema-version": "vX"
37         },
38         "transaction-id": "c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4",
39         "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
40     }
41
42 #### Updating a Vertex
43
44     {
45         "timestamp": 1514929776429,
46         "operation": "UPDATE",
47         "vertex": {
48             "properties": {
49                 "ipv4-oam-address": "1.2.3.4",
50                 "resource-version": "1477013499",
51                 "purpose": "my-purpose",
52                 "fqdn": "updated.myhost.onap.net",
53                 "in-maint": false,
54                 "equip-model": "DELL380p-nd",
55                 "equip-vendor": "DELL",
56                 "equip-type": "updated-server",
57                 "hostname": "updated-myhost",
58                 "ptnii-equip-name": "name-has-been-updated"
59             },
60             "key": "84bf7b3f-81f5-4c34-ab5c-207281cb71bd",
61             "type": "pserver",
62             "schema-version": "vX"
63         },
64         "transaction-id": "3b8df1d5-4c51-47e3-bbef-c27b47e11149",
65         "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
66     }
67
68 #### Deleting a Vertex
69
70     {
71         "timestamp": 1514930052327,
72         "operation": "DELETE",
73         "vertex": {
74             "key": "84bf7b3f-81f5-4c34-ab5c-207281cb71bd",
75             "type": "pserver",
76             "schema-version": "vX"
77         },
78         "transaction-id": "6bb7a27b-a942-4cac-9b2b-0fa1f3897b8c",
79         "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
80     }
81
82
83 #### Adding an Edge
84
85     {
86       "timestamp": 1515005153863,
87       "operation": "CREATE",
88       "edge": {
89         "target": {
90           "key": "febd8996-62ec-4ce6-ba8e-d2fa1609e13b",
91           "type": "pserver"
92         },
93         "properties": {
94           "contains-other-v": "NONE",
95           "delete-other-v": "NONE",
96           "prevent-delete": "IN",
97           "SVC-INFRA": "OUT"
98         },
99         "key": "",
100         "type": "tosca.relationships.HostedOn",
101         "schema-version": "v11",
102         "source": {
103           "key": "7beade35-19f1-4c1d-a1bd-bfba59e0b582",
104           "type": "vserver"
105         }
106       },
107       "transaction-id": "63a8994d-1118-4e65-ab06-fff40f6f48ef",
108       "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
109     }
110
111 #### Replace an Edge
112
113     {
114       "timestamp": 1515005301622,
115       "operation": "UPDATE",
116       "edge": {
117         "target": {
118           "key": "febd8996-62ec-4ce6-ba8e-d2fa1609e13b",
119           "type": "pserver"
120         },
121         "properties": {
122           "contains-other-v": "NOPE",
123           "delete-other-v": "YES",
124           "prevent-delete": "MAYBE",
125           "SVC-INFRA": "OUT"
126         },
127         "key": "9727a0ea-559e-497c-98e4-0cbdaede0346",
128         "type": "tosca.relationships.HostedOn",
129         "schema-version": "v11",
130         "source": {
131           "key": "7beade35-19f1-4c1d-a1bd-bfba59e0b582",
132           "type": "vserver"
133         }
134       },
135       "transaction-id": "ed284991-6c2f-4c94-a592-76fed17a2f14",
136       "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
137     }
138
139
140 #### Deleting an Edge
141
142     {
143       "timestamp": 1515005579837,
144       "operation": "DELETE",
145       "edge": {
146         "key": "9727a0ea-559e-497c-98e4-0cbdaede0346",
147         "type": "tosca.relationships.HostedOn",
148         "schema-version": "v11"
149       },
150       "transaction-id": "b4583bc9-dd96-483f-ab2d-20c1c6e5622f",
151       "database-transaction-id": "b3e2853e-f643-47a3-a0c3-cb54cc997ad3"
152     }