add document for POLICY-1742
[policy/parent.git] / docs / apex / APEX-User-Manual.rst
index 97abd09..3e9379d 100644 (file)
@@ -2812,6 +2812,13 @@ REST Client Input
                   by the server configured via the URL. For instance,
                   the server could support a wait timeout via the URL as
                   ``?timeout=100ms``.
+                  The httpCodeFilter is used for filtering the status
+                  code, and it can be configured as a regular expression
+                  string. The default httpCodeFilter is "[2][0-9][0-9]"
+                  - for successful response codes.
+                  The response with HTTP status code that matches the
+                  given regular expression is forwarded to the task,
+                  otherwise it is logged as a failure.
 
                .. container:: listingblock
 
@@ -2825,16 +2832,19 @@ REST Client Input
                             "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
                           "parameters" : {
                             "url" : "http://example.org:8080/triggers/events", (2)
+                            "httpCodeFilter" : "[2][0-9][0-9]" (3)
                           }
                         }
 
                .. container:: colist arabic
 
-                  +-------+---------------------------------------+
-                  | **1** | set REST client as carrier technology |
-                  +-------+---------------------------------------+
-                  | **2** | the URL of the HTTP server for events |
-                  +-------+---------------------------------------+
+                  +-------+--------------------------------------------------+
+                  | **1** | set REST client as carrier technology            |
+                  +-------+--------------------------------------------------+
+                  | **2** | the URL of the HTTP server for events            |
+                  +-------+--------------------------------------------------+
+                  | **3** | use HTTP CODE FILTER for filtering status code   |
+                  +-------+--------------------------------------------------+
 
 REST Client Output
 ==================
@@ -2846,6 +2856,15 @@ REST Client Output
                   POST (no configuration required). To change it to PUT
                   simply add the configuration parameter (as shown in
                   the example below).
+                  The URL can be configured statically or tagged
+                  as ``?example.{site}.org:8080/{trig}/events``,
+                  all tags such as ``site`` and ``trig`` in the URL
+                  need to be set in the properties object available to
+                  the tasks. In addition, the keys should exactly match
+                  with the tags defined in url. The scope of the properties
+                  object is per HTTP call. Hence, key/value pairs set
+                  in the properties object by task are only available
+                  for that specific HTTP call.
 
                .. container:: listingblock
 
@@ -2859,6 +2878,7 @@ REST Client Output
                             "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
                           "parameters" : {
                             "url" : "http://example.com:8888/actions/events", (2)
+                            "url" : "http://example.{site}.com:8888/{trig}/events", (2')
                             "httpMethod" : "PUT" (3)
                           }
                         }
@@ -2868,7 +2888,9 @@ REST Client Output
                   +-------+--------------------------------------------------+
                   | **1** | set REST client as carrier technology            |
                   +-------+--------------------------------------------------+
-                  | **2** | the URL of the HTTP server for events            |
+                  | **2** | the static URL of the HTTP server for events     |
+                  +-------+--------------------------------------------------+
+                  | **2'**| the tagged URL of the HTTP server for events     |
                   +-------+--------------------------------------------------+
                   | **3** | use HTTP PUT (remove this line to use HTTP POST) |
                   +-------+--------------------------------------------------+
@@ -3093,6 +3115,22 @@ REST Requestor Input
                .. container:: paragraph
 
                   APEX will connect to a given URL to request an input.
+                  The URL can be configured statically or tagged
+                  as ``?example.{site}.org:8080/{trig}/events``,
+                  all tags such as ``site`` and ``trig`` in the URL
+                  need to be set in the properties object available to
+                  the tasks. In addition, the keys should exactly match
+                  with the tags defined in url. The scope of the properties
+                  object is per HTTP call. Hence, key/value pairs set
+                  in the properties object by task are only available
+                  for that specific HTTP call.
+                  The httpCodeFilter is used for filtering the status
+                  code, and it can be configured as a regular expression
+                  string. The default httpCodeFilter is "[2][0-9][0-9]"
+                  - for successful response codes.
+                  The response with HTTP status code that matches the
+                  given regular expression is forwarded to the task,
+                  otherwise it is logged as a failure.
 
                .. container:: listingblock
 
@@ -3105,8 +3143,10 @@ REST Requestor Input
                           "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RESTRequestorCarrierTechnologyParameters",
                           "parameters": {
                             "url": "http://localhost:54321/some/path/to/rest/resource", (2)
+                            "url": "http://localhost:54321/{site}/path/to/rest/{resValue}", (2')
                             "httpMethod": "POST", (3)
-                            "restRequestTimeout": 2000 (4)
+                            "restRequestTimeout": 2000, (4)
+                            "httpCodeFilter" : "[2][0-9][0-9]" (5)
                           }
                         },
 
@@ -3115,12 +3155,16 @@ REST Requestor Input
                   +-------+--------------------------------------------------+
                   | **1** | set REST requestor as carrier technology         |
                   +-------+--------------------------------------------------+
-                  | **2** | the URL of the HTTP server for events            |
+                  | **2** | the static URL of the HTTP server for events     |
+                  +-------+--------------------------------------------------+
+                  | **2'**| the tagged URL of the HTTP server for events     |
                   +-------+--------------------------------------------------+
                   | **3** | use HTTP PUT (remove this line to use HTTP POST) |
                   +-------+--------------------------------------------------+
                   | **4** | request timeout in milliseconds                  |
                   +-------+--------------------------------------------------+
+                  | **5** | use HTTP CODE FILTER for filtering status code   |
+                  +-------+--------------------------------------------------+
 
                .. container:: paragraph