Sign inSign up

weevenetwork/http-egress

By weevenetwork

Updated over 2 years ago

Responsible for passing all input data to a specified URL

Image
0

3.0K

weevenetwork/http-egress repository overview

HTTP Egress

NameHTTP Egress
GitHubweeve-modules/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 weeve platform:

Environment VariablesTypeDescription
EGRESS_WEBHOOK_URLSstringList of comma (,) separated HTTP addresses where data is sent.
METHODstringReST API request method: POST 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, during request if call fails, to this URL we pass error code, url and payload sent
Set by the weeve Agent on the edge-node

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

Environment VariablestypeDescription
MODULE_NAMEstringName of the module
MODULE_TYPEstringType of the module (INGRESS, PROCESS, EGRESS)
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:ce4f3d546

Size

49.4 MB

Last updated

over 2 years ago

docker pull weevenetwork/http-egress:v1.0.0