Update component-specification documentation 83/117183/3
authorRemigiusz Janeczek <remigiusz.janeczek@nokia.com>
Thu, 28 Jan 2021 13:01:42 +0000 (14:01 +0100)
committerRemigiusz Janeczek <remigiusz.janeczek@nokia.com>
Thu, 28 Jan 2021 13:40:35 +0000 (14:40 +0100)
Add docs for:
- kafka streams
- config map volumes

Issue-ID: DCAEGEN2-2546
Issue-ID: DCAEGEN2-1179
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: Id77d0b3e82b9d82034ecf3d4b16b42a8101a8c50

docs/sections/design-components/component-specification/component-json-schema.rst
docs/sections/design-components/component-specification/component-type-docker.rst
docs/sections/design-components/component-specification/docker-specification.rst

index d1d4ef4..a6a1ed4 100644 (file)
@@ -54,7 +54,8 @@ The same is provided below for documentation reference.
             "oneOf": [
               { "$ref": "#/definitions/publisher_http" },
               { "$ref": "#/definitions/publisher_message_router" },
-              { "$ref": "#/definitions/publisher_data_router" }
+              { "$ref": "#/definitions/publisher_data_router" },
+              { "$ref": "#/definitions/publisher_kafka" }
             ]
           }
         },
@@ -65,7 +66,8 @@ The same is provided below for documentation reference.
             "oneOf": [
               { "$ref": "#/definitions/subscriber_http" },
               { "$ref": "#/definitions/subscriber_message_router" },
-              { "$ref": "#/definitions/subscriber_data_router" }
+              { "$ref": "#/definitions/subscriber_data_router" },
+              { "$ref": "#/definitions/subscriber_kafka" }
             ]
           }
         }
@@ -484,6 +486,33 @@ The same is provided below for documentation reference.
         "type"
       ]
     },
+    "stream_kafka": {
+      "type": "object",
+      "properties": {
+        "format": {
+          "$ref": "#/definitions/name"
+        },
+        "version": {
+          "$ref": "#/definitions/version"
+        },
+        "config_key": {
+          "type": "string"
+        },
+        "type": {
+          "description": "Type of stream to be used",
+          "type": "string",
+          "enum": [
+            "kafka"
+          ]
+        }
+      },
+      "required": [
+        "format",
+        "version",
+        "config_key",
+        "type"
+      ]
+    },
     "publisher_http": {
       "type": "object",
       "properties": {
@@ -542,6 +571,9 @@ The same is provided below for documentation reference.
         "type"
       ]
     },
+    "publisher_kafka": {
+      "$ref": "#/definitions/stream_kafka"
+    },
     "subscriber_http": {
       "type": "object",
       "properties": {
@@ -605,6 +637,9 @@ The same is provided below for documentation reference.
         "config_key"
       ]
     },
+    "subscriber_kafka": {
+      "$ref": "#/definitions/stream_kafka"
+    },
     "provider" : {
       "oneOf" : [
         {"$ref": "#/definitions/docker-provider"},
@@ -853,17 +888,10 @@ The same is provided below for documentation reference.
           "type": "array",
           "items": {
             "type": "object",
-            "properties": {
-              "host":{
-                "type":"object",
-                "path": {"type": "string"}
-              },
-              "container":{
-                "type":"object",
-                "bind": { "type": "string"},
-                "mode": { "type": "string"}
-              }
-            }
+            "oneOf": [
+              { "$ref": "#/definitions/host_path_volume" },
+              { "$ref": "#/definitions/config_map_volume" }
+            ]
           }
         }
       },
@@ -872,6 +900,46 @@ The same is provided below for documentation reference.
       ],
       "additionalProperties": false
     },
+    "host_path_volume": {
+      "type": "object",
+      "properties": {
+        "host": {
+          "type": "object",
+          "path": {
+            "type": "string"
+          }
+        },
+        "container": {
+          "type": "object",
+          "bind": {
+            "type": "string"
+          },
+          "mode": {
+            "type": "string"
+          }
+        }
+      }
+    },
+    "config_map_volume": {
+      "type": "object",
+      "properties": {
+        "config_volume": {
+          "type": "object",
+          "name": {
+            "type": "string"
+          }
+        },
+        "container": {
+          "type": "object",
+          "bind": {
+            "type": "string"
+          },
+          "mode": {
+            "type": "string"
+          }
+        }
+      }
+    },
     "docker_healthcheck_http": {
       "properties": {
         "type": {
index cf676c4..a685e34 100755 (executable)
@@ -274,6 +274,8 @@ format of ``dcae.vnf.kpi`` version ``1.0.0``.
 |             |    | ``message_router`` |
 |             |    | ,                  |
 |             |    | ``data_router``    |
+|             |    | ,                  |
+|             |    | ``kafka``          |
 +-------------+----+--------------------+
 
 .. _message-router:
@@ -329,6 +331,27 @@ Example (not tied to the larger example):
     ...
     }
 
+.. _kafka:
+
+Kafka
+''''''''''''''
+
+Kafka subscribers are clients fetching data directly from kafka.
+
+``config_key``:
+
+.. code:: json
+
+    "streams": {
+        "subscribes": [{
+            "format": "dcae.some-format",
+            "version": "1.0.0",
+            "config_key": "some_format_handle",
+            "type": "kafka"
+        }],
+    ...
+    }
+
 Publishes
 ^^^^^^^^^
 
@@ -419,6 +442,8 @@ POST requests to streams that support the data format
 |             |    | ``message_router`` |
 |             |    | ,                  |
 |             |    | ``data_router``    |
+|             |    | ,                  |
+|             |    | ``kafka``          |
 +-------------+----+--------------------+
 
 .. message-router-1:
@@ -473,6 +498,27 @@ Example (not tied to the larger example):
         }]
     }
 
+.. kafka-1:
+
+Kafka
+''''''''''''''
+
+Kafka publishers are clients publishing data directly to kafka.
+
+``config_key``:
+
+.. code:: json
+
+    "streams": {
+        "publishes": [{
+            "format": "dcae.some-format",
+            "version": "1.0.0",
+            "config_key": "some_format_handle",
+            "type": "kafka"
+        }],
+    ...
+    }
+
 Quick Reference
 ^^^^^^^^^^^^^^^
 
@@ -1543,17 +1589,10 @@ Schema portion:
           "type": "array",
           "items": {
             "type": "object",
-            "properties": {
-              "host":{
-                "type":"object",
-                "path": {"type": "string"}
-              },
-              "container":{
-                "type":"object",
-                "bind": { "type": "string"},
-                "mode": { "type": "string"}
-              }
-            }
+            "oneOf": [
+              { "$ref": "#/definitions/host_path_volume" },
+              { "$ref": "#/definitions/config_map_volume" }
+            ]
           }
         }
       },
index e40af02..eeac1ef 100755 (executable)
@@ -36,10 +36,10 @@ mapping, volume mapping and policy reconfiguration script details.
 |                                |         | host port. See example    |\r
 |                                |         | below.                    |\r
 +--------------------------------+---------+---------------------------+\r
-| volume                         | JSON    | each array item contains  |\r
-|                                | array   | a host and container      |\r
-|                                |         | object. See example       |\r
-|                                |         | below.                    |\r
+| volumes                        | JSON    | each array item contains  |\r
+|                                | array   | volume definition of eith\|\r
+|                                |         | er: host path or config m\|\r
+|                                |         | ap volume.                |\r
 +--------------------------------+---------+---------------------------+\r
 | policy                         | JSON    | *Required*. Policy        |\r
 |                                | array   | reconfiguration script    |\r
@@ -171,6 +171,15 @@ Volume Mapping
                 "host": {\r
                     "path": "/var/run/docker.sock"\r
                 }\r
+            },\r
+            {\r
+               "container": {\r
+                   "bind": "/tmp/mount_path"\r
+                   "mode": "ro"\r
+                },\r
+                "config_volume": {\r
+                    "name": "config_map_name"\r
+                }\r
             }\r
         ]\r
     }\r
@@ -180,7 +189,8 @@ At the top-level:
 +---------------+-------+-------------------------------------+\r
 | Property Name | Type  | Description                         |\r
 +===============+=======+=====================================+\r
-| volumes       | array | Contains container and host objects |\r
+| volumes       | array | Contains container with host/config\|\r
+|               |       | _volume objects                     |\r
 +---------------+-------+-------------------------------------+\r
 \r
 The ``container`` object contains:\r
@@ -208,7 +218,15 @@ The ``host`` object contains:
 | path          | string | path to the host volume |\r
 +---------------+--------+-------------------------+\r
 \r
-Here’s an example of the minimal JSON that must be provided as an input:\r
+The ``config_volume`` object contains:\r
+\r
++---------------+--------+-------------------------+\r
+| Property Name | Type   | Description             |\r
++===============+========+=========================+\r
+| name          | string | name of config map      |\r
++---------------+--------+-------------------------+\r
+\r
+Here is an example of the minimal JSON with host path volume that must be provided as an input:\r
 \r
 .. code:: json\r
 \r
@@ -228,6 +246,24 @@ Here’s an example of the minimal JSON that must be provided as an input:
 In the example above, the container volume “/tmp/docker.sock” maps to\r
 host volume “/var/run/docker.sock”.\r
 \r
+Here is an example of the minimal JSON with config map volume that must be provided as an input:\r
+\r
+.. code:: json\r
+\r
+    "auxilary": {\r
+        "volumes": [\r
+            {\r
+               "container": {\r
+                   "bind": "/tmp/mount_path"\r
+                },\r
+                "config_volume": {\r
+                    "name": "config_map_name"\r
+                }\r
+            }\r
+        ]\r
+    }\r
+\r
+In the example above, config map named "config_map_name" is mounted at "/tmp/mount_path".\r
 \r
 Policy \r
 ~~~~~~~\r