Sign inSign up

beetaone/http-client-requests

By beetaone

Updated almost 2 years ago

Image
0

134

beetaone/http-client-requests repository overview

HTTP Client Requests

NameHTTP Client Requests
Versionv1.0.3
DockerHubbeetaone/http-client-requests
AuthorsMarcus Jones

Table of Contents

Description

This Module performs repeated HTTP requests (acting as a client) at a specified interval, to the given URL. The returned payload is forwarded to the next module. This module may be used to interact with a single REST API resource endpoint.

NOTE: Only one header is supported.

The Python class, HttpRequest, is an implementation of a simple HTTP client using the aiohttp library. It provides methods for sending a HTTP request and polling a URL at a specified interval. The class takes in a URL, method, authentication token, payload, and header as parameters. The class also contains some error handling, such as checking if the URL is valid and raising an error if the method is not one of the allowed values. The send_request method sends the HTTP request and returns the response. The poll method repeatedly sends the request and forwards the response.

Environment Variables

Module Specific

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

Environment VariablestypeDescription
URLstringThe full URL, including protocol and path
METHODstringHTTP request method; GET, POST, DELETE, PUT
AUTH_TOKENstringWill be passed as "{Authorization: Bearer AUTH_TOKEN}"
PAYLOADstringData for POST
HEADERstringAdditional HTTP header, as a JSON string
POLL_INTERVALintPoll interval in seconds
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)
EGRESS_URLSstringHTTP ReST endpoint for the next module
LOG_LEVELstringAllowed log levels: DEBUG, INFO, WARNING, ERROR, CRITICAL. Refer to logging package documentation.

Input

HTTP response body

Output

Output of this module is a string or JSON, as specified by the user.

Tag summary

Content type

Image

Digest

sha256:ec202856d

Size

55.1 MB

Last updated

almost 2 years ago

docker pull beetaone/http-client-requests:v1.0.3