adding filter document 17/18117/1
authorrn509j <rn509j@att.com>
Wed, 11 Oct 2017 02:58:43 +0000 (22:58 -0400)
committerrn509j <rn509j@att.com>
Wed, 11 Oct 2017 03:00:45 +0000 (23:00 -0400)
DMAAP-149
Signed-off-by: rn509j <rn509j@att.com>
Change-Id: I7b46acb525972fac048062c480825ec21895ae66

docs/Filter/Filter.rst
docs/Installation/Installation.rst
docs/message-router/image1.png [moved from docs/message-router/message router.jpg with 100% similarity]
docs/message-router/message-router.rst

index b9f8d07..dca8682 100644 (file)
@@ -1,4 +1,6 @@
-Filter \r
+=======\r
+Filter\r
+======= \r
 \r
 A filter examine an event and decides if it matches or doesn't.  Filters\r
 are mainly used in rules to decide if the processing entries should be\r
@@ -27,7 +29,7 @@ format:
 | }                                       |\r
 +-----------------------------------------+\r
 \r
-| This filter matches events in which the field "foo" has value "abc"\r
+- This filter matches events in which the field "foo" has value "abc"\r
   and the field "bar" is assigned to some value (as opposed to not being\r
   present on the event). Filters are used by the consumers to filter out\r
   data and consume only specific set of data which matches the\r
@@ -35,21 +37,21 @@ format:
   parameter by the consumer in consume request as mentioned below:\r
   **http://localhost:8080/DMaaP/dmaaprest/events/DMaaP/consumergroup/mHOeNFY4XiWx4CBa?filter=\\{"class":"Equals",\r
   "field":"email", "value":"test@abc.com" }** \r
-| Filters can be applied only on data in JSON format i.e. if applied,\r
+- Filters can be applied only on data in JSON format i.e. if applied,\r
   filters will automatically ignore any non-json data.  While consuming,\r
   request CONTENT\_TYPE is not relevant to filter.\r
 \r
 All the supported filter can be found below.\r
 \r
-`Types of\r
-Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__\r
+Types of Filters \r
+----------------\r
 \r
-| DMaaP Message Router supports all the filters which were supported by\r
+- DMaaP Message Router supports all the filters which were supported by\r
   DMaaP Message Router and are mentioned below:- \r
-| **All Alarms:**\r
-| Match all alarms. \r
-| **And:**\r
-| Create a set of filters. This filter matches when all of them matches.\r
+- **All Alarms:**\r
+  - Match all alarms. \r
+- **And:**\r
+  - Create a set of filters. This filter matches when all of them matches.\r
 \r
 +-------------+--------------------+------------+---------------------+\r
 | **Field**   | **Description**    | **Type**   | **Notes**           |\r
@@ -59,9 +61,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 |             |                    |            |                     |\r
 +-------------+--------------------+------------+---------------------+\r
 \r
-| **Assigned:**\r
-| Choose a field from the event to check for assignment. This filter\r
-  matches when the field is assigned.\r
+- **Assigned:**\r
+  - Choose a field from the event to check for assignment. This filter\r
+    matches when the field is assigned.\r
 \r
 +-------------------+--------------------------------------------------------+------------+-----------------+\r
 | **Field**         | **Description**                                        | **Type**   | **Notes**       |\r
@@ -71,8 +73,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | emptyIsAssigned   | If true, an empty value is considered an assignment.   | BOOLEAN    | True or False   |\r
 +-------------------+--------------------------------------------------------+------------+-----------------+\r
 \r
-| **Contains:**\r
-| Check if a search string contains another string.\r
+- **Contains:**\r
+   - Check if a search string contains another string.\r
 \r
 +-------------+---------------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                                   | **Type**   | **Notes**    |\r
@@ -84,8 +86,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 |             |                                                   |            |              |\r
 +-------------+---------------------------------------------------+------------+--------------+\r
 \r
-| **EndsWith**:\r
-| Check if a search string ends with another string.\r
+ **EndsWith**:\r
+   -  Check if a search string ends with another string.\r
 \r
 +-------------+---------------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                                   | **Type**   | **Notes**    |\r
@@ -95,8 +97,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | value       | The value to search for. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+---------------------------------------------------+------------+--------------+\r
 \r
-| **Equals:**\r
-| Choose a field from the event and a value to check for equality.\r
+ **Equals:**\r
+  - Choose a field from the event and a value to check for equality.\r
 \r
 +-------------+----------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                              | **Type**   | **Notes**    |\r
@@ -106,8 +108,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | value       | The value to match. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+----------------------------------------------+------------+--------------+\r
 \r
-| **FlatironObjectExists**\r
-| Matches when the given object exists in the given Flatiron instance.\r
+ **FlatironObjectExists**\r
+  -  Matches when the given object exists in the given Flatiron instance.\r
 \r
 +-------------+---------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                             | **Type**   | **Notes**    |\r
@@ -117,9 +119,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | flatiron    | The name of the Flatiron client instance.   | STRING     | Any string   |\r
 +-------------+---------------------------------------------+------------+--------------+\r
 \r
-| **IsAging**\r
-| Choose a field to test. This filter matches if the expression is\r
-  numeric.\r
+- **IsAging**\r
+  -  Choose a field to test. This filter matches if the expression is\r
+     numeric.\r
 \r
 +-------------+---------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                             | **Type**   | **Notes**    |\r
@@ -127,8 +129,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | field       | The field to test. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+---------------------------------------------+------------+--------------+\r
 \r
-| **IsNumeric**\r
-| Choose a field to test. This filter matches if the expression is\r
+- **IsNumeric**\r
+  - Choose a field to test. This filter matches if the expression is\r
   numeric.\r
 \r
 +-------------+---------------------------------------------+------------+--------------+\r
@@ -137,8 +139,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | field       | The field to test. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+---------------------------------------------+------------+--------------+\r
 \r
-| **MathCondition**\r
-| Choose a field from the event and a value for logical math conditions.\r
+ **MathCondition**\r
+  - Choose a field from the event and a value for logical math conditions.\r
 \r
 +-------------+-------------------------------------------------+------------+-----------------------------------+\r
 | **Field**   | **Description**                                 | **Type**   | **Notes**                         |\r
@@ -152,10 +154,10 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 |             |                                                 |            |                                   |\r
 +-------------+-------------------------------------------------+------------+-----------------------------------+\r
 \r
-| **NoAlarms**\r
-| Don't match any alarms. \r
-| **Not**\r
-| Negate the configured filter.\r
+- **NoAlarms**\r
+  -  Don't match any alarms. \r
+- **Not**\r
+  -  Negate the configured filter.\r
 \r
 +-------------+-------------------------+------------+-------------+\r
 | **Field**   | **Description**         | **Type**   | **Notes**   |\r
@@ -163,8 +165,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | filter      | The filter to negate.   | FILTER     | A filter    |\r
 +-------------+-------------------------+------------+-------------+\r
 \r
-| **NotEqual**\r
-| Choose a field from the event and a value to check for inequality.\r
+ **NotEqual**\r
+  -  Choose a field from the event and a value to check for inequality.\r
 \r
 +-------------+----------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                              | **Type**   | **Notes**    |\r
@@ -174,9 +176,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | value       | The value to match. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+----------------------------------------------+------------+--------------+\r
 \r
-| **NotOneOf**\r
-| Match when the specified field does not have a value from the given\r
-  list.\r
+ **NotOneOf**\r
+  -  Match when the specified field does not have a value from the given\r
+     list.\r
 \r
 +-------------+---------------------------------------------+------------+---------------------+\r
 | **Field**   | **Description**                             | **Type**   | **Notes**           |\r
@@ -186,8 +188,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | values      | The matching values.                        | LIST       | A list of strings   |\r
 +-------------+---------------------------------------------+------------+---------------------+\r
 \r
-| **OneOf**\r
-| Match when the specified field has a value from the given list.\r
+ **OneOf**\r
+  -  Match when the specified field has a value from the given list.\r
 \r
 +-------------+---------------------------------------------+------------+---------------------+\r
 | **Field**   | **Description**                             | **Type**   | **Notes**           |\r
@@ -197,9 +199,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | values      | The matching values.                        | LIST       | A list of strings   |\r
 +-------------+---------------------------------------------+------------+---------------------+\r
 \r
-| **Or**\r
-| Create a set of filters. This filter matches when any one of them\r
-  matches.\r
+- **Or**\r
+   - Create a set of filters. This filter matches when any one of them\r
+     matches.\r
 \r
 +-------------+--------------------+------------+---------------------+\r
 | **Field**   | **Description**    | **Type**   | **Notes**           |\r
@@ -207,9 +209,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | filters     | Combined Filters   | LIST       | A list of filters   |\r
 +-------------+--------------------+------------+---------------------+\r
 \r
-| **RegEx**\r
-| Choose a field from the event to match against the regular expression\r
-  you provide.\r
+- **RegEx**\r
+   - Choose a field from the event to match against the regular expression\r
+     you provide.\r
 \r
 +-------------+---------------------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                                         | **Type**   | **Notes**    |\r
@@ -219,8 +221,8 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | value       | The regular expression (pattern) to match.              | STRING     | Any string   |\r
 +-------------+---------------------------------------------------------+------------+--------------+\r
 \r
-| **StartsWith**\r
-| Check if a search string starts with another string.\r
+- **StartsWith**\r
+  - Check if a search string starts with another string.\r
 \r
 +-------------+---------------------------------------------------+------------+--------------+\r
 | **Field**   | **Description**                                   | **Type**   | **Notes**    |\r
@@ -230,9 +232,9 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | Value       | The value to search for. Supports ${} notation.   | STRING     | Any string   |\r
 +-------------+---------------------------------------------------+------------+--------------+\r
 \r
-| **Unassigned**\r
-| Choose a field from the event to check for assignment. This filter\r
-  matches when the field is not assigned.\r
+- **Unassigned**\r
+   - Choose a field from the event to check for assignment. This filter\r
+     matches when the field is not assigned.\r
 \r
 +-------------------+--------------------------------------------------------+------------+-----------------+\r
 | **Field**         | **Description**                                        | **Type**   | **Notes**       |\r
@@ -242,11 +244,11 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | emptyIsAssigned   | If true, an empty value is considered an assignment.   | BOOLEAN    | True or False   |\r
 +-------------------+--------------------------------------------------------+------------+-----------------+\r
 \r
-| **WithinSecondsFrom**\r
-| This filter matches when the specified epoch time value is within the\r
-  given number of seconds from the baseline time value. Both time values\r
-  are assumed to be in seconds. If a value is in milliseconds, set\r
-  baselineTimeInMillis and/or eventTimeInMillis to true.\r
+- **WithinSecondsFrom**\r
+  - This filter matches when the specified epoch time value is within the\r
+    given number of seconds from the baseline time value. Both time values\r
+    are assumed to be in seconds. If a value is in milliseconds, set\r
+    baselineTimeInMillis and/or eventTimeInMillis to true.\r
 \r
 +------------------------+------------------------------------------------------------+------------+-----------------+\r
 | **Field**              | **Description**                                            | **Type**   | **Notes**       |\r
@@ -262,11 +264,11 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | baseline               | The baseline time value. Supports ${}.                     | STRING     | Any string      |\r
 +------------------------+------------------------------------------------------------+------------+-----------------+\r
 \r
-| **WithinTimeFromNow**\r
-| This filter matches when the named field has an epoch time value\r
-  within the given number of seconds from the current time. The event's\r
-  time value is assumed to be in seconds. If it's in milliseconds, set\r
-  eventTimeInMillis to true.\r
+- **WithinTimeFromNow**\r
+  - This filter matches when the named field has an epoch time value\r
+    within the given number of seconds from the current time. The event's\r
+    time value is assumed to be in seconds. If it's in milliseconds, set\r
+    eventTimeInMillis to true.\r
 \r
 +---------------------+---------------------------------------------------------+------------+-----------------+\r
 | **Field**           | **Description**                                         | **Type**   | **Notes**       |\r
@@ -278,24 +280,27 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 | seconds             | The number of seconds.                                  | NUMBER     | A number        |\r
 +---------------------+---------------------------------------------------------+------------+-----------------+\r
 \r
-**Limit:** \r
-\r
--  Limit is the integer value and DMaaP Message Router will consumes\r
-   only that set of message which are specified in limit.\r
+- **Limit:** \r
 \r
-| Suppose if we set limit=2, then only 2 sets of data will be consumed. \r
-| *Get \ **<<topicName>>/group/2?limit=4*** \r
-| Let us suppose if \r
-| **No of data available** = 4\r
-| **Set limit** = 6\r
-| i.e. limit>no of data\r
-| In this scenario all 4 sets of data will be consumed. \r
+  -  Limit is the integer value and DMaaP Message Router will consumes\r
+     only that set of message which are specified in limit.\r
+        \r
+  .. code:: bash\r
+        Suppose if we set limit=2, then only 2 sets of data will be consumed. \r
+        *Get \ **<<topicName>>/group/2?limit=4*** \r
+        Let us suppose if \r
+        **No of data available** = 4\r
+        **Set limit** = 6\r
+        i.e. limit>no of data\r
+        In this scenario all 4 sets of data will be consumed. \r
 \r
 -  If limit is not passed with the url then by default limit is set to\r
    4096.\r
+   \r
+   .. code:: bash\r
 \r
-| i.e. 4096 sets of data will be consumed. \r
-|  **Timeout and Long Poll:** \r
+        i.e. 4096 sets of data will be consumed. \r
+        **Timeout and Long Poll:** \r
 \r
 -  Timeout is the integer value which will be treated by DMaaP Message\r
    Router as time in millisecond.\r
@@ -332,8 +337,11 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 -  If meta is set to true then consumer will get the value of message\r
    offset along with message.\r
 \r
-|image1|\r
-| **Pretty**:\r
+   |image1|\r
+\r
+   .. |image1| image:: images/image1.png\r
+   \r
+- **Pretty**:\r
 \r
 -  Pretty is a Boolean value.\r
 \r
@@ -347,55 +355,59 @@ Filters <https://wiki.web.att.com/display/MessageRouter/Types+of+Filters>`__
 -  If pretty is set to true then different sets of messages will be\r
    printed in next line separated by comma (,).\r
 \r
-|image2|\r
-| **Filter**\r
-| A filter examine an event and decides if it matches or doesn't. \r
-| Filters are mainly used in rules to decide if the processing entries\r
-  should be executed on the given event. They're also used for settings,\r
-  and systems like the Graph Correlator re-use Highland Park's filter\r
-  mechanism to specify which alarms fit in a correlation. \r
-| The standard library includes a number of simple filters. The Equals\r
-  filter, for example, compares a field's value with some other value\r
-  and returns true if the values match. \r
-| The standard library also includes filter classes called And, Or, and\r
-  Not, so you can compose more complex filters. For example, written in\r
-  the standard JSON config format: \r
-\r
-+-----------------------------------------+\r
-| "filter":{                              |\r
-| "class":"And",                          |\r
-| "filters":                              |\r
-| [                                       |\r
-| { "class":"Equals", "foo":"abc" },      |\r
-| { "class":"Assigned", "field":"bar" }   |\r
-| ]                                       |\r
-| }                                       |\r
-+-----------------------------------------+\r
-\r
-| This filter matches events in which the field "foo" has value "abc"\r
-  and the field "bar" is assigned to some value (as opposed to not being\r
-  present on the event).\r
-| Filters are used by the consumers to filter out data and consume only\r
-  specific set of data which matches the conditions mentioned in filter.\r
-| Filters can be passed as a query parameter by the consumer in consume\r
-  request as mentioned below:\r
-| **http://localhost:8080/DMaaP/dmaaprest/events/DMaaP/consumergroup/mHOeNFY4XiWx4CBa?filter=\\{"class":"Equals",\r
-  "field":"email", "value":"`test@abc.com <mailto:test@att.com>`__" }** \r
-| Filters can be applied only on data in JSON format i.e. if applied,\r
-  filters will automatically ignore any non-json data. \r
-| While consuming, request CONTENT\_TYPE is not relevant to filter.\r
-\r
-The MR API allows a subscriber pass a Highland Park filter as part of\r
-the GET request. This will filter the stream of messages sent back to\r
-the subscriber, but for this to work, there are some requirements: \r
-\r
--  The message payload must be JSON\r
-\r
--  Only a filter built from Highland Park's Standard Library  may be\r
-   used. (The Cambria API server doesn't have access to plugged in\r
-   filters.)\r
-\r
--  The filter must be encoded properly in the URL path.\r
+   |image2|\r
+   \r
+   .. |image2| image:: images/image2.png\r
+   \r
+- **Filter**\r
+\r
+   - A filter examine an event and decides if it matches or doesn't. \r
+   - Filters are mainly used in rules to decide if the processing entries\r
+     should be executed on the given event. They're also used for settings,\r
+     and systems like the Graph Correlator re-use Highland Park's filter\r
+     mechanism to specify which alarms fit in a correlation. \r
+   - The standard library includes a number of simple filters. The Equals\r
+     filter, for example, compares a field's value with some other value\r
+     and returns true if the values match. \r
+   - The standard library also includes filter classes called And, Or, and\r
+     Not, so you can compose more complex filters. For example, written in\r
+     the standard JSON config format: \r
+\r
+    +-----------------------------------------+\r
+    | "filter":{                              |\r
+    | "class":"And",                          |\r
+    | "filters":                              |\r
+    | [                                       |\r
+    | { "class":"Equals", "foo":"abc" },      |\r
+    | { "class":"Assigned", "field":"bar" }   |\r
+    | ]                                       |\r
+    | }                                       |\r
+    +-----------------------------------------+\r
+\r
+   - This filter matches events in which the field "foo" has value "abc"\r
+     and the field "bar" is assigned to some value (as opposed to not being\r
+     present on the event).\r
+   -  Filters are used by the consumers to filter out data and consume only\r
+     specific set of data which matches the conditions mentioned in filter.\r
+   -  Filters can be passed as a query parameter by the consumer in consume\r
+     request as mentioned below:\r
+   - **http://localhost:8080/DMaaP/dmaaprest/events/DMaaP/consumergroup/mHOeNFY4XiWx4CBa?filter=\\{"class":"Equals",\r
+     "field":"email", "value":"`test@abc.com <mailto:test@att.com>`__" }** \r
+   - Filters can be applied only on data in JSON format i.e. if applied,\r
+     filters will automatically ignore any non-json data. \r
+   - While consuming, request CONTENT\_TYPE is not relevant to filter.\r
+\r
+   The MR API allows a subscriber pass a Highland Park filter as part of\r
+   the GET request. This will filter the stream of messages sent back to\r
+   the subscriber, but for this to work, there are some requirements: \r
+\r
+    -  The message payload must be JSON\r
+\r
+   -  Only a filter built from Highland Park's Standard Library  may be\r
+      used. (The Cambria API server doesn't have access to plugged in\r
+      filters.)\r
+\r
+   -  The filter must be encoded properly in the URL path.\r
 \r
  Server-side filtering can also be setup in the Java client as\r
 illustrated below\r
@@ -577,6 +589,6 @@ messages returned from the GET call.  The following link provide details
 of building some of the filter to illustrate Filter Builder.  It is not\r
 meant to cover and provide examples of every filter\r
 \r
-.. |image1| image:: images/image1.png\r
-.. |image2| image:: images/image2.png\r
+\r
+\r
 \r
index 8026928..3723a19 100644 (file)
@@ -29,14 +29,12 @@ kafka runs on 172.18.0.2 and dmaap on 172.18.0.4.
 \r
    This should start 3 containers.\r
 \r
-6) Run \91docker ps\92. It should show 3 containers.\r
+6) Run docker ps. It should show 3 containers.\r
 \r
    |image0|\r
    \r
    .. |image0| image:: docker.png\r
-   :width: 5.84375in\r
-   :height: 0.76042in\r
-\r
+  \r
 Testing\r
 -------\r
 \r
index 983603a..d8c597b 100644 (file)
@@ -6,13 +6,10 @@ Architecture
 \r
 In DMaaP Message Router, Restful web service is exposed to client to perform any needed action with Kafka. After getting the request it calls the Message router service layer which is created using AJSC ( AT&T Java Service Container) . AJSC finally calls Kafka services and response is sent back.\r
 \r
-|image0|\r
-\r
-.. |image0| image:: message router.jpg\r
-   :height: 600px\r
-   :width: 800px\r
-\r
+   |image0|\r
 \r
+   .. |image0| image:: image1.png\r
+   \r
 \r
 HTTP Service APIs\r
 ------------------\r