Sign inSign up

beetaone/http-egress

By beetaone

Updated almost 2 years ago

Image
0

162

beetaone/http-egress repository overview

HTTP Egress

NameHTTP Egress
Versionv1.0.0
DockerHubbeetaone/http-egress
authorsJakub Grzelak, Mesud Pasic

Description

HTTP Egress is a module responsible for passing all input data to a specified URL or a Webhook address by HTTP ReST API. Two ReST API methods are supported: POST an GET. If POST is chosen, then data are passed to a specified URL. If GET is chosen, then data are passed as URL's query string parameters.

This module is containerized using Docker.

Environment Variables

Module Specific

The following module configurations can be provided in a data service designer section on beetaone platform:

Environment VariablesTypeDescription
EGRESS_WEBHOOK_URLSstringList of comma (,) separated HTTP addresses where data is sent.
METHODstringReST API request method: POST, PUT, PATCH, DELETE or GET.
LABELSstringList of comma (,) separated labels to read from a previous module. Leave empty ("") to keep all data.
CONTENT_TYPE_JSONstringDetermines if during request 'Content-Type': 'application/json' will be passed on in request or not, default is no
AUTHENTICATION_REQUIREDenumDetermines if during request authentication is required
ACCESS_TOKENstringIf authentication is required this is the input for token, it also requires method like Basic or Bearer for example: Barer adhjaskjhjd-dsfdsfjsdkjf#42389dfsajfd==
AUTHENTICATION_API_KEYstringIf we need to specify authentication X-API-TOKEN, here users can enter it
ERROR_URLstringIf specified, the module will pass the error code, URL, and payload sent to this URL, instead of the previous module, if the HTTP request fails.
Set by the beetaone Agent on the edge-node

Other features required for establishing the inter-container communication between modules in a data service are set by beetaone agent.

Environment VariablestypeDescription
MODULE_NAMEstringName of the module
MODULE_TYPEstringType of the module (Input, Processing, Output)
INGRESS_HOSTstringHost to which data will be received
INGRESS_PORTstringPort to which data will be received
LOG_LEVELstringAllowed log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL. Refer to logging package documentation.

Dependencies

bottle
requests

Input

Input to this module is JSON body single object or array of objects:

Example:

{
  temperature: 15,
}
[
  {
    temperature: 15,
  },
  {
    temperature: 21,
  },
  {
    temperature: 25,
  },
];

Output

Output to this module is identical JSON body as input that is sent to a chosen endpoint.

Example:

{
  temperature: 15,
}
[
  {
    temperature: 15,
  },
  {
    temperature: 21,
  },
  {
    temperature: 25,
  },
];

Test with curl

curl --header "Content-Type: application/json" \
                --request POST \
                --data '{"random hash":"f36940fb3203f6e1b232f84eb3f796049c9cf1761a9297845e5f2453eb036f01"}' \
                localhost:5000

Tag summary

Content type

Image

Digest

sha256:356544b79

Size

49.3 MB

Last updated

almost 2 years ago

docker pull beetaone/http-egress:v1.0.0