Update component-specification documentation

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
diff --git a/docs/sections/design-components/component-specification/component-json-schema.rst b/docs/sections/design-components/component-specification/component-json-schema.rst
index d1d4ef4..a6a1ed4 100644
--- a/docs/sections/design-components/component-specification/component-json-schema.rst
+++ b/docs/sections/design-components/component-specification/component-json-schema.rst
@@ -54,7 +54,8 @@
             "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 @@
             "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 @@
         "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 @@
         "type"
       ]
     },
+    "publisher_kafka": {
+      "$ref": "#/definitions/stream_kafka"
+    },
     "subscriber_http": {
       "type": "object",
       "properties": {
@@ -605,6 +637,9 @@
         "config_key"
       ]
     },
+    "subscriber_kafka": {
+      "$ref": "#/definitions/stream_kafka"
+    },
     "provider" : {
       "oneOf" : [
         {"$ref": "#/definitions/docker-provider"},
@@ -853,17 +888,10 @@
           "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 @@
       ],
       "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": {
diff --git a/docs/sections/design-components/component-specification/component-type-docker.rst b/docs/sections/design-components/component-specification/component-type-docker.rst
index cf676c4..a685e34 100755
--- a/docs/sections/design-components/component-specification/component-type-docker.rst
+++ b/docs/sections/design-components/component-specification/component-type-docker.rst
@@ -274,6 +274,8 @@
 |             |    | ``message_router`` |
 |             |    | ,                  |
 |             |    | ``data_router``    |
+|             |    | ,                  |
+|             |    | ``kafka``          |
 +-------------+----+--------------------+
 
 .. _message-router:
@@ -329,6 +331,27 @@
     ...
     }
 
+.. _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 @@
 |             |    | ``message_router`` |
 |             |    | ,                  |
 |             |    | ``data_router``    |
+|             |    | ,                  |
+|             |    | ``kafka``          |
 +-------------+----+--------------------+
 
 .. message-router-1:
@@ -473,6 +498,27 @@
         }]
     }
 
+.. 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 @@
           "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" }
+            ]
           }
         }
       },
diff --git a/docs/sections/design-components/component-specification/docker-specification.rst b/docs/sections/design-components/component-specification/docker-specification.rst
index e40af02..eeac1ef 100755
--- a/docs/sections/design-components/component-specification/docker-specification.rst
+++ b/docs/sections/design-components/component-specification/docker-specification.rst
@@ -36,10 +36,10 @@
 |                                |         | host port. See example    |

 |                                |         | below.                    |

 +--------------------------------+---------+---------------------------+

-| volume                         | JSON    | each array item contains  |

-|                                | array   | a host and container      |

-|                                |         | object. See example       |

-|                                |         | below.                    |

+| volumes                        | JSON    | each array item contains  |

+|                                | array   | volume definition of eith\|

+|                                |         | er: host path or config m\|

+|                                |         | ap volume.                |

 +--------------------------------+---------+---------------------------+

 | policy                         | JSON    | *Required*. Policy        |

 |                                | array   | reconfiguration script    |

@@ -171,6 +171,15 @@
                 "host": {

                     "path": "/var/run/docker.sock"

                 }

+            },

+            {

+               "container": {

+                   "bind": "/tmp/mount_path"

+                   "mode": "ro"

+                },

+                "config_volume": {

+                    "name": "config_map_name"

+                }

             }

         ]

     }

@@ -180,7 +189,8 @@
 +---------------+-------+-------------------------------------+

 | Property Name | Type  | Description                         |

 +===============+=======+=====================================+

-| volumes       | array | Contains container and host objects |

+| volumes       | array | Contains container with host/config\|

+|               |       | _volume objects                     |

 +---------------+-------+-------------------------------------+

 

 The ``container`` object contains:

@@ -208,7 +218,15 @@
 | path          | string | path to the host volume |

 +---------------+--------+-------------------------+

 

-Here’s an example of the minimal JSON that must be provided as an input:

+The ``config_volume`` object contains:

+

++---------------+--------+-------------------------+

+| Property Name | Type   | Description             |

++===============+========+=========================+

+| name          | string | name of config map      |

++---------------+--------+-------------------------+

+

+Here is an example of the minimal JSON with host path volume that must be provided as an input:

 

 .. code:: json

 

@@ -228,6 +246,24 @@
 In the example above, the container volume “/tmp/docker.sock” maps to

 host volume “/var/run/docker.sock”.

 

+Here is an example of the minimal JSON with config map volume that must be provided as an input:

+

+.. code:: json

+

+    "auxilary": {

+        "volumes": [

+            {

+               "container": {

+                   "bind": "/tmp/mount_path"

+                },

+                "config_volume": {

+                    "name": "config_map_name"

+                }

+            }

+        ]

+    }

+

+In the example above, config map named "config_map_name" is mounted at "/tmp/mount_path".

 

 Policy 

 ~~~~~~~