Node-RED nodes for Watson Content Hub integration
Node-RED integration with IBM Watson Content Hub
This module provides a set of Node-RED nodes which integrate with IBM Watson Content Hub. The main goal of these nodes is to make it even simpler to integrate with IBM Watson Content Hub, as all API calls are nicely wrapped by the given nodes.
There is no known pre-requisite, but this module was mainly tested on Node-RED v0.16.2 and Node.js v4.2.1
Run the following command in your Node-RED user directory
npm install node-red-contrib-watson-content-hub
Restart node-red and do a refresh in the browser editor UI, to see the newly installed nodes.
This section describes a very basic scenario how you can make sure the IBM Watson Content Hub integration with Node-RED is working. We assume the extension is installed as described earlier.
Go to the node-red editor UI (ie http://localhost:1880/)
Add an inject input node, a debug output node and a User node from the Watson_Content_Hub supportedActions
Wire the nodes as outlined on the picture
Do a double-click on the Users node to enter the configuration dialog
Click on the edit icon on the Connection entry in the configuration dialog and add in your IBM ID credentials
NOTE It is recommended to add a name whrioch makes it easier to identify the configuration
Select the Add button to submit your input
For the purpose of the getting started scenario we leave the Operation at the default (Retrieve the current user) and submit the configuration by hitting the Done button.
Finally select the deploy button in the upper right corner of the editor UI
Now we can test the flow by hitting the input trigger and we will find the User node result in the debug section of the editor UI.
This version provides Node-RED nodes for all API endpoints in IBM Watson Content Hub. As this is a very early version, there is not a full coverage of all REST calls provided by IBM Watson Content Hub, but basic CRUD scenarios are implemented.
To get a better understanding how to work with the Node-RED nodes have a look at the examples folder
Adding IBM Watson Content Hub nodes to your IBM Bluemix Node-RED boilerplate
If you want to make use of this integration you have to run a Node-RED process somewhere. One very nice way to host this would be to use IBM Bluemix. This description provides you with the required steps on how you can add the IBM Watson Content Hub nodes into your existing Node-RED boilerplate.
Navigate to your IBM Bluemix Dashboard and select the Node-RED boilerplate app
On the overview page look for a widget called Continuous delivery. Assuming your toolchain integration is not yet setup click on the Enable button and follow the steps in the wizard.
Now you should have a new GitHub repository which reflects your Node-RED boilerplate application.
package.jsonand add the following entry to the
NOTE: The position inside of the
dependenciessection does not matter, just pay attention to set the colon at the right position
- Commit your change and wait. Bluemix now gets informed about the change and your Node-RED boilerplate app gets restarted. This process may take up to 5 minutes, even if the application in your IBM Bluemix Dashboard tells you it is started already.
ATTENTION Make sure your Node-RED application has a username and password set, because otherwise your IBM Watson Content Hub account is open to everybody.