Namespace com.ibm.streamsx.inet.rest

IBMStreams streamsx.inetserver Toolkit > com.ibm.streamsx.inetserver 4.3.4 > com.ibm.streamsx.inet.rest

A set of operators using HTTP (REST) apis to interact with streaming data.

These operators all embed an instance of Eclipse Jetty to provide an web-server embedded within the operator.

Access to streaming data is provided through the HTTPTupleView and HTTPXMLView operators. These two operators support HTTP GET requests to fetch the latest version of the streaming data in the operator's state.

Data can be injected into a stream through HTTPTupleInjection, HTTPXMLInjection, HTTPBLOBInjection and HTTPJSONInjection operators. Each operators extracts data from an HTTP POST and submits a tuple on an output port.

WebContext provides a mechanism to serve files at a fixed web context, a fixed path relative to the root URL of the web server. Note that all the operators also support a fixed context using the context and contextResourceBase operator parameters.

The HTTPRequestProcess operator enables a developer to process HTTP form's and REST calls in a Streams application and deliver the appropriate response to the HTTP client.

Overall, these set of operators allow a complete web-application to be self-contained within an SPL application. In addition to the operators the webserver will serve up HTML and Javascript files. Javascript can be used with the JSON data provided by HTTPTupleView to visual live data using graphical packages such as DOJO and D3.

Meta-data for the streams connected to the operators is also available through HTTP GET requests, to allow JavaScript applications to self-discover the format of the data and the to self-discover the connected streams and exposed contexts:
  • ports/info Meta information of the connected ports
  • contexts/info Meta information of the exposed contexts
  • / default context mapped to application_directory/opt/html
More fixed contexts are provided by the operators:
  • streamsx.inet.resources Utilities provided by the operators.
  • streamsx.inet.dojo The Dojo Javascript library located at $STREAMS_INSTALL/ext/dojo.

HTTPTupleView provides automatic visualization of tuples on its input ports. These are available through the URL streamsx.inet.resources/dojo/viewall.html.

This provides a table containing links for all the ports connected to all HTTPTupleView operators using the same Jetty webserver: The columns in the table are:
  • Info - Link to the JSON meta data about the port, including the names and types of the attributes.
  • Live Table - Link to a live table of the current viewable data. Some automatic formatting is applied based upon the name and type of an attribute.
  • Live Table (Raw) - Link to a live table of the current viewable data, with no formatting.
  • JSON Data - Link that provides the raw JSON data.
This tables use the Dojo Javascript library from the Steams install, and thus do not require external internet connectivity.

HTTPS Support and Sharing the Jetty Server

see also namespace:com.ibm.streamsx.inet

Operators

Functions

Types