Document Async event payloads. 11/27311/2
authorShwetank Dave <shwetank.dave@amdocs.com>
Wed, 3 Jan 2018 20:00:04 +0000 (15:00 -0500)
committerShwetank Dave <shwetank.dave@amdocs.com>
Thu, 4 Jan 2018 14:49:42 +0000 (09:49 -0500)
For vertices and edges document respective
payloads for Adding, Updating, and Deleting
edges and vertices.

Issue-ID: AAI-604
Change-Id: I9f8802e5bcd9083d786d71db2457caa682304133
Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
ASYNC.md [new file with mode: 0644]
README.md

diff --git a/ASYNC.md b/ASYNC.md
new file mode 100644 (file)
index 0000000..2b72675
--- /dev/null
+++ b/ASYNC.md
@@ -0,0 +1,146 @@
+# ASYNCHRONOUS MODE
+
+Gizmo has two modes, a Synchoronous (sync) mode and an Asynchronous (async) mode.
+
+In the Async mode, Gizmo uses the consumer/producer model where when a
+client makes a request, Gizmo will generate an event payload and
+publish it  on the async event stream. It will then wait for a
+response for that particular event on a different event stream. Once it recieves a
+response, gizmo will send a response back to the client which made the
+original request.
+
+## Here are a few examples of the events published by Gizmo
+
+### Vertex
+
+#### Adding a Vertex
+
+    {
+        "timestamp": 1514927928167,
+        "operation": "CREATE",
+        "vertex": {
+            "properties": {
+                "ipv4-oam-address": "1.2.3.4",
+                "resource-version": "1477013499",
+                "purpose": "my-purpose",
+                "fqdn": "myhost.onap.net",
+                "in-maint": false,
+                "equip-model": "DL380p-nd",
+                "equip-vendor": "HP",
+                "equip-type": "server",
+                "hostname": "myhost",
+                "ptnii-equip-name": "e-name"
+            },
+            "key": "",
+            "type": "pserver",
+            "schema-version": "vX"
+        },
+        "transaction-id": "c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4"
+    }
+
+#### Updating a Vertex
+
+    {
+        "timestamp": 1514929776429,
+        "operation": "UPDATE",
+        "vertex": {
+            "properties": {
+                "ipv4-oam-address": "1.2.3.4",
+                "resource-version": "1477013499",
+                "purpose": "my-purpose",
+                "fqdn": "updated.myhost.onap.net",
+                "in-maint": false,
+                "equip-model": "DELL380p-nd",
+                "equip-vendor": "DELL",
+                "equip-type": "updated-server",
+                "hostname": "updated-myhost",
+                "ptnii-equip-name": "name-has-been-updated"
+            },
+            "key": "84bf7b3f-81f5-4c34-ab5c-207281cb71bd",
+            "type": "pserver",
+            "schema-version": "vX"
+        },
+        "transaction-id": "3b8df1d5-4c51-47e3-bbef-c27b47e11149"
+    }
+
+#### Deleting a Vertex
+
+    {
+        "timestamp": 1514930052327,
+        "operation": "DELETE",
+        "vertex": {
+            "key": "84bf7b3f-81f5-4c34-ab5c-207281cb71bd",
+            "type": "pserver",
+            "schema-version": "vX"
+        },
+        "transaction-id": "6bb7a27b-a942-4cac-9b2b-0fa1f3897b8c"
+    }
+
+
+#### Adding an Edge
+
+    {
+      "timestamp": 1515005153863,
+      "operation": "CREATE",
+      "edge": {
+        "target": {
+          "key": "febd8996-62ec-4ce6-ba8e-d2fa1609e13b",
+          "type": "pserver"
+        },
+        "properties": {
+          "contains-other-v": "NONE",
+          "delete-other-v": "NONE",
+          "prevent-delete": "IN",
+          "SVC-INFRA": "OUT"
+        },
+        "key": "",
+        "type": "tosca.relationships.HostedOn",
+        "schema-version": "v11",
+        "source": {
+          "key": "7beade35-19f1-4c1d-a1bd-bfba59e0b582",
+          "type": "vserver"
+        }
+      },
+      "transaction-id": "63a8994d-1118-4e65-ab06-fff40f6f48ef"
+    }
+
+#### Replace an Edge
+
+    {
+      "timestamp": 1515005301622,
+      "operation": "UPDATE",
+      "edge": {
+        "target": {
+          "key": "febd8996-62ec-4ce6-ba8e-d2fa1609e13b",
+          "type": "pserver"
+        },
+        "properties": {
+          "contains-other-v": "NOPE",
+          "delete-other-v": "YES",
+          "prevent-delete": "MAYBE",
+          "SVC-INFRA": "OUT"
+        },
+        "key": "9727a0ea-559e-497c-98e4-0cbdaede0346",
+        "type": "tosca.relationships.HostedOn",
+        "schema-version": "v11",
+        "source": {
+          "key": "7beade35-19f1-4c1d-a1bd-bfba59e0b582",
+          "type": "vserver"
+        }
+      },
+      "transaction-id": "ed284991-6c2f-4c94-a592-76fed17a2f14"
+    }
+
+
+#### Deleting an Edge
+
+    {
+      "timestamp": 1515005579837,
+      "operation": "DELETE",
+      "edge": {
+        "key": "9727a0ea-559e-497c-98e4-0cbdaede0346",
+        "type": "tosca.relationships.HostedOn",
+        "schema-version": "v11"
+      },
+      "transaction-id": "b4583bc9-dd96-483f-ab2d-20c1c6e5622f"
+    }
index 8724b74..6ce6511 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,9 +13,9 @@ After cloning the project, execute the following Maven command from the project'
 
 Now, you can build your Docker image:
 
 
 Now, you can build your Docker image:
 
-    > docker build -t onap/crud-service target 
-    
-### Deploying The Microservice 
+    > docker build -t onap/crud-service target
+
+### Deploying The Microservice
 
 Push the Docker image that you have built to your Docker repository and pull it down to the location from which you will be running the service.
 
 
 Push the Docker image that you have built to your Docker repository and pull it down to the location from which you will be running the service.
 
@@ -24,7 +24,7 @@ Push the Docker image that you have built to your Docker repository and pull it
     ../logs
     ../appconfig
        ../appconfig/auth
     ../logs
     ../appconfig
        ../appconfig/auth
-    
+
 You will be mounting these as data volumes when you start the Docker container.
 
 #### Configuring the Microservice
 You will be mounting these as data volumes when you start the Docker container.
 
 #### Configuring the Microservice
@@ -33,24 +33,24 @@ Create configuration file **../appconfig/crud-api.properties**
 
        # List of hostnames/addresses of the graph database
        crud.graph.host=graphhost1.onap.com,graphhost2.onap.com
 
        # List of hostnames/addresses of the graph database
        crud.graph.host=graphhost1.onap.com,graphhost2.onap.com
-       
+
        # Port on which to connect to the graph database
        crud.graph.port=2181
        # Port on which to connect to the graph database
        crud.graph.port=2181
-       
+
        # Name of the graph on which this service will operate
        crud.graph.name=aaigraphautomation
        # Name of the graph on which this service will operate
        crud.graph.name=aaigraphautomation
-       
+
        # Backend storage type for the graph.  Types currently supported:
        #  - cassandra
        #  - hbase
        crud.storage.backend.db=cassandra
        # Backend storage type for the graph.  Types currently supported:
        #  - cassandra
        #  - hbase
        crud.storage.backend.db=cassandra
-       
+
        # List of hostnames/addresses of the DMaaP/Kafka cluster on which to post notification events
        event.stream.hosts=kafkahost1.onap.com,kafkahost2.onap.com
        # List of hostnames/addresses of the DMaaP/Kafka cluster on which to post notification events
        event.stream.hosts=kafkahost1.onap.com,kafkahost2.onap.com
-       
+
        # Number of events to bath up before posting to DMaaP/Kafka
        event.stream.batch-size=100
        # Number of events to bath up before posting to DMaaP/Kafka
        event.stream.batch-size=100
-       
+
        # Amount of time (in ms) to wait before sending batch of events (when batch does not reach batch-size)
        event.stream.batch-timeout=60000
 
        # Amount of time (in ms) to wait before sending batch of events (when batch does not reach batch-size)
        event.stream.batch-timeout=60000
 
@@ -70,7 +70,7 @@ This policy file defines which client certificates are authorized to use the ser
                 "users": [
                     {
                         "username": "CN=admin, OU=My Organization Unit, O=, L=Sometown, ST=SomeProvince, C=CA"
                 "users": [
                     {
                         "username": "CN=admin, OU=My Organization Unit, O=, L=Sometown, ST=SomeProvince, C=CA"
-                    }    
+                    }
                 ]
             }
         ]
                 ]
             }
         ]
@@ -94,7 +94,7 @@ You can now start the Docker container in the following manner:
            -v /<path>/appconfig:/opt/app/crud-service/config \
            --name crud-service \
            {{your docker repo}}/crud-service
            -v /<path>/appconfig:/opt/app/crud-service/config \
            --name crud-service \
            {{your docker repo}}/crud-service
-    
+
 Where,
 
     {{your docker repo}} = The Docker repository you have published your CRUD Service image to.
 Where,
 
     {{your docker repo}} = The Docker repository you have published your CRUD Service image to.
@@ -107,20 +107,19 @@ Where,
        URL: https://<host>:9520/services/crud-api/v1/echo-service/echo/<input>
        Method: GET
        Success Response: 200
        URL: https://<host>:9520/services/crud-api/v1/echo-service/echo/<input>
        Method: GET
        Success Response: 200
-       
+
 ### Vertex APIs
 ### Vertex APIs
-Gizmo exposes a set of APIs to operate on verticies within the graph. 
+Gizmo exposes a set of APIs to operate on verticies within the graph.
 [Vertex APIs](./VERTEX.md)
 
 ### Edge APIs
 [Vertex APIs](./VERTEX.md)
 
 ### Edge APIs
-Gizmo exposes a set of APIs to operate on edges within the graph. 
+Gizmo exposes a set of APIs to operate on edges within the graph.
 [Edge APIs](./EDGE.md)
 
 ### Bulk API
 [Edge APIs](./EDGE.md)
 
 ### Bulk API
-Gizmo exposes a bulk API to operate on multiple graph entities within a single request. 
+Gizmo exposes a bulk API to operate on multiple graph entities within a single request.
 [Bulk API](./BULK.md)
 [Bulk API](./BULK.md)
-     
-
 
 
-               
+## ASYNC PIPELINE
+Gizmo is capable of working Synchronously and Asynchronously. Asynchronous Pipeline is explained
+here: [Async Pipeline](./ASYNC.MD)