IBMStreams streamsx.inetserver Toolkit > com.ibm.streamsx.inetserver 4.3.4 > com.ibm.streamsx.inet.rest > HTTPTupleInjection
Embeds a Jetty web server to allow HTTP or HTTPS POST requests to submit a tuple on its output ports. Each output port corresponds to a unique URL comprising the operator name and the port index.
A single tuple is generated for an incoming POST request. Each attribute in the output port's schema corresponds to a parameter in the POST with the attribute name, using application/x-www-form-urlencoded. If the parameter exists in the POST then its first value is assigned to the output tuple, if the value is not provided then the attribute will be set to its default value.
In addition to the URL for POST request, a URL is created that displays an automatically generated HTML form that can be displayed by a browser and used for manual injection of tuples.
Maximum Content Size: Jetty limits the amount of data that can post back from a browser or other client to this operator. This helps protect the operator against denial of service attacks by malicious clients sending huge amounts of data. The default limit is 200K bytes, a client will receive an HTTP 500 error response code if it tries to POST too much data. The limit may be increased using the maxContentSize parameter.
see also namespace:com.ibm.streamsx.inet
Optional: certificateAlias, context, contextResourceBase, host, keyPassword, keyStore, keyStorePassword, maxContentSize, port, sslAppConfigName, trustStore, trustStorePassword
Emits a tuple for each POST request on the inject URL with port index 0
Optional additional ports that emit a tuple for each POST request on the inject URL with the corresponding port index
Optional: certificateAlias, context, contextResourceBase, host, keyPassword, keyStore, keyStorePassword, maxContentSize, port, sslAppConfigName, trustStore, trustStorePassword
Alias of the certificate to use in the key store. When this parameter is set all connections use HTTPS and parameters keyStore and keyPassword are required.
Define a URL context path that maps to the resources defined by contextResourceBase. This allows a composite that invokes this operator in a toolkit to provide resources regardless of the value of the application's data directory. For example setting it to maps would result in the URL /maps/index.html mapping to the file index.html in the directory defined by contextResourceBase. Requires the parameter contextResourceBase to be set. If when the operator is initialized the context already exists then no action is taken. This allows multiple independent composites in the same toolkit to have common context and contextResourceBase settings, typically to point to a single set of HTML and Javascript resources for the toolkit.
If the operator provides URLs for its input or output ports then they are placed in the this context when this parameter is set. This then provides fixed locations for the URLs regardless of the depth of the operator invocation in the main composite.
Only a single context per invocation is supported.
Directory location of resources that will be available through the the URL context defined by the parameter context. Typically used to allow a toolkit to provide a set of resources in a fixed location. The set of resources is recommended to be stored in the application_dir/opt directory, which is automatically included in the bundle by default. Path of this directory can be absolute or relative, if relative path is specified then it is relative to the application directory. A set of default resources is included in the toolkit directory under ToolkitDir/opt/resources and will be loaded by the operator. This default resources can be viewed at http://hostname:8080/streamsx.inet.resources. A path within the application is obtained using the SPL function getThisToolkitDir(). Thus a composite in the file maps.spl in the namespace directory com.acme.streams.apps.map might have the following setting to map http://127.0.0.1:8080/maps to opt/resources/mapinfo in the application.
param context: “maps” contextResourceBase: getThisToolkitDir() + “/opt/resources/mapinfo”
If this parameter is applied parameter contextResourceBase is required too.
You can configure a host either as a host name or IP address to identify a specific network interface on which to listen. If not set, or set to the value of 0.0.0.0, the integrated jetty server listens on all local interfaces.
Password to the private key.
URL to the key store containing the certificate. If a relative file path then it is taken as relative to the application directory.
Password to the key store.
Change the maximum HTTP POST content size (K bytes) allowed by this operator.Jetty limits the amount of data that can posted from a browser or other client to the operator. This helps protect the operator against denial of service attacks by malicious clients sending huge amounts of data. The default maximum size Jetty permits is 200K bytes, thus the default value for this parameter is 200. For example, to increase to 500,000 bytes set maxContentSize to 500.
Port number for the embedded Jetty HTTP server, default: "8080". If the port is set to 0, the jetty server uses a free tcp port, and the metric serverPort delivers the actual value.
streamtool mkappconfig --description 'server cert and trust store' --property "server.jks=$(base64 --wrap=0 etc/keystore.jks)" --property "server.pass=password" --property "cacerts.jks=$(base64 --wrap=0 etc/cacerts.jks)" streams-certs
URL to the trust store containing client certificates. If a relative file path then it is taken as relative to the application directory. When this parameter is set, client authentication is required.
Password to the trust store.