.. role:: raw-html-m2r(raw)
:format: html
Contents
========
* `Contents <#contents>`__
* `NodeRedHttpClientApp <#noderedhttpclientapp>`__
* `Configure NodeRed <#configure-nodered>`__
* `Getting Open EII UDF Classifier results data to Node-RED Environment Using Node-RED HTTPClient <#getting-open-eii-udf-classifier-results-data-to-node-red-environment-using-node-red-httpclient>`__
* `Sample Workflow <#sample-workflow>`__
NodeRedHttpClientApp
--------------------
This Node-RED in-built http node based client App acts as client for the Open EII RestDataExport and brings the Open EII Classifier data to Node-RED ecosystem.
Configure NodeRed
^^^^^^^^^^^^^^^^^
Node-RED provides various options to install and set up Node-RED in your environment. For more information on installation and setup, refer to the `Node-RED documenation `_.
.. note:: For quick setup, install using ``docker``
.. code-block:: sh
docker run -it -p 1880:1880 --name myNodeRed nodered/node-red
Getting Open EII UDF Classifier results data to Node-RED Environment Using Node-RED HTTPClient
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: \ : RestDataExport should be running already as a prerequisite.\ :raw-html-m2r:`
`
Refer to the RestDataExport Readme(\ ``[WORK_DIR]/IEdgeInsights/RestDataExport``\ )
#.
Drag the ``http request`` node of Node-RED's default nodes to your existing workflow.
.. image:: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imagehttprequestnode.png
:target: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imagehttprequestnode.png
:alt: images/imagehttprequestnode.png
#.
Update the ``properties`` of node as follows:
For ``DEV mode``\ :
*
Refer to the dialog properties for setting up the ``DEV`` mode in the Node-Red dashboard
.. image:: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imagedevmode.png
:target: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imagedevmode.png
:alt: images/imagedevmode.png
For ``PROD Mode``\ :
*
Refer to the dialog properties for setting up the ``PROD`` mode in the Node-RED dashboard
.. image:: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageprodmode.png
:target: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageprodmode.png
:alt: imageprodmode.png
For Prod Mode TLS ``ca_cert.pem`` import.
**Note:** This ``ca_cert.pem`` will be part of the Open EII certificate bundle. Refer the ``[WORKDIR]/IEdgeInsights/build/Certificates/`` directory.
.. image:: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageprodmodetlscert.png
:target: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageprodmodetlscert.png
:alt: imageprodmodetlscert.png
..
**Note:**
#. For the ``DEV`` mode, do not enable or attach the certificates.
#. Update the ``IP`` address as per the ``RestDataExport`` module running machine IP.
#. For more details on Node-RED's ``http request`` module, refer to `Http requset `_.
Sample Workflow
^^^^^^^^^^^^^^^
The attached workflow document is sample workflow by updating the ``RestDataExport`` IP Address in the ``http request`` module,
#.
Import the Sample Workflow flows.json(\ ``[WORK_DIR]/IEdgeInsights/tools/NodeRedHttpClientApp/flows.json``\ ) file to NodeRed dashboard using ``menu`` icon in top right corner as follows
.. image:: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageimportnodes.png
:target: /3.0.1/IEdgeInsights/tools/NodeRedHttpClientApp/images/imageimportnodes.png
:alt: images/imageimportnodes.png
#.
Click ``Import``
#.
Update the ``URL`` of ``http request`` node with ``RestDataExport`` module running the machine IP Address
..
**Note:**
* For detail, refer to [import export] (https://nodered.org/docs/user-guide/editor/workspace/import-export)
* The classifier results will be logged in the debug window.